Select to view content in your preferred language

Batch indices in Imagery tab

646
5
04-10-2024 06:55 AM
RyanDavidson1
Occasional Contributor

Hi

In the imagery tab you can create an indice of an RGB.jpg. This works fine but I would like to be able to do multiple images. So far I haven't found a tool or a batch option to do this. Has anyone got any suggestions? At the moment I would be happy to be able to do 20 at a time but the goal would be around 100-200 images. I also looked at the raster functions option but no luck there with a batch. 

0 Kudos
5 Replies
EdMorris
Esri Contributor

Hello Ryan

I've been thinking about this for a few days. I assume you don't have a solution for this?

I'm wondering if the following could be a solution?

My first thought is: Why don't you create a Geodatabase Mosaic Dataset? You can learn about these at this link here if you haven't come across them before:

Mosaic datasets—ArcGIS Pro | Documentation

A mosaic dataset allows you to apply a single index to the whole dataset and would mean you don't need to apply it individually to 200 images which could be a very efficient way of applying an index to 200 images.

If you don't or can't want to create a Geodatabase Mosaic Dataset then perhaps there is a workflow which can be applied to a dataset in batch mode?

I would think about attempting to do the following:

1:  I assume all the tiles come from the same sensor which means you understand how many bands there and you know what wavelengths each band references and that these values are the same across your 200 images.

2: I would suggest for a single image you apply the index and then export that out as a layer (.lyrx) file. This layer file can then be applied to all other images as the layer file's properties created by the index, can then be applied to the other datasets.

How can we achieve this? I would look at creating a model using ModelBuilder.

3: Create a Model and use the Iterate Rasters Model Builder tool. The tool outputs a reference to the Raster and its Name.

4: Add the Apply Symbology  From Layer tool to the model. This allows you to connect the output Raster as the tool's Input Layer and then choose the .lyrx file as the Symbology layer of the tool. This will hopefully apply the symbology of the lyrx file (which contains the index symbology) to the current raster dataset which is being processed.

It's going to look something like this below:

EdMorris_0-1713369480860.png

You can see the model hasn't been connected properly which is why it is still grey.

If you are working with the source jpeg (so that the imagery is not loaded into the Contents pane), you may need to add the Make Raster Layer tool after the Iterate Rasters iterator tool to create that in memory raster layer to which the Apply Symbology From Layer tool is then applied to.

I haven't tried this as I don't have datasets but I think this might be worth a go...

I hope this helps

ed

0 Kudos
RyanDavidson1
Occasional Contributor

Thanks Ed, I will give it a try!

0 Kudos
RyanDavidson1
Occasional Contributor

Unfortunately the apply symbology from layer doesn't work on the raw images as they need to be converted first from 3 bands to single band first (working on that). From there they can be classified and I imagine that method might work. 

0 Kudos
RyanDavidson1
Occasional Contributor

Hi Ed

I tried your first suggestion of creating a mosaic dataset. I understand the concept but couldn't get the result. The images were added to the mosaic dataset, when i tested exporting them that worked fine too. When i applied the indice tool to the mosaic dataset then only one image was processed and it landed outside of the mosaic dataset. I imported it back in and then exported to the same folder i tested with the raw images and only the one processed image was saved there along with the originals. 

I'm guessing this is because the images are stacked when i load them? Meaning they are not sitting beside each other but rather in stack. A little more info for you, these images are single drones images with default coordinate system. I'm not interested in spatial accuracy, rather classifying them into two classes. Whichever way i load them into Pro they all land exactly in the same place on the map.

Time to try your other suggestion

0 Kudos
EdMorris
Esri Contributor

OK!
I hope things worked out for you and you have a workable solution!

0 Kudos