Modelbuilder: Maximum Likelihood Classification with iteration.

5760
8
Jump to solution
12-20-2014 07:26 PM
AndrewRoberts2
New Contributor III

Hey there!

I am having an issue in modelbuilder that I cannot quite work my head around. I have many aerial photos of the same region over time. There are slight differences between the photos but I am using the same training samples for each classification. I have about 60 photos and I will be doing this for multiple areas so I wanted to create a model.

I have done this without the use of iterators but the model becomes impossibly large and incredibly time consuming to produce or change but it was sucessful. Here is an image of what I am trying to do without iterator:

working.png

Here is what I have come up with using a Raster iterator.

Not_working.png

I cannot determine why this is not working when using the iterate raster function. It is essentially doing the same thing as the top image. The iteration works fine when I remove the maximum likelihood classification tool. When this tool is removed it creates a signature file for each raster in the selected workspace.

Anyone have any ideas what I am missing?

Thanks!

-Andrew

0 Kudos
1 Solution

Accepted Solutions
AndrewRoberts2
New Contributor III

OK... I believe I have found the issue. When I create the output of the Create Signature Tool as %name%.gsg if creates the sig files as follows... 001.jpg.gsg , 002.jpg.gsg, etc...

However if I change %name% to %n% it names the signature files as the iteration number... 01.gsg, 02.gsg, 03.gsg, etc...

I believe the double extension is what was messing this up.

-Andrew

View solution in original post

0 Kudos
8 Replies
larryzhang
Occasional Contributor III


Andrew,

With the same signature file from the first image, can you reproduce your classification task on other images without ModelBuilder?

In your loop in ModelBuilder, I feel that the signature file from the second image (or the remaining) still duplicates from the first one.


Can you verify those?

0 Kudos
larryzhang
Occasional Contributor III

One more is:

Pls verify your loop workflow with using the gp tool 'Iso Cluster'?

0 Kudos
AndrewRoberts2
New Contributor III

Hey Larry,

Thanks for the reply!

With the same signature file from the first image, can you reproduce your classification task on other images without ModelBuilder?

I could reproduce my classification on other images with the same signature file as the first image without ModelBuilder. However, the images have been taken with different settings. Therefore, I believe the signature files could be different between photos. My goal is to determine which camera setting produces the best classification/if there are even any differences in the accuracy of the classification based on camera setting.

In your loop in ModelBuilder, I feel that the signature file from the second image (or the remaining) still duplicates from the first one.

This does not overwrite the signature files. The way it is setup in modelbuilder, a signature file will be made for each image and using the function %Name% it will be named according the image used in that iteration. This means that all the signature files will have different names and will not overwrite each other.

Pls verify your loop workflow with using the gp tool 'Iso Cluster'?

I am not exactly sure what you mean by this but I will look into it!

Thanks again!!

-Andrew Roberts

0 Kudos
larryzhang
Occasional Contributor III

Andrew,

The idea behind Q #2 & 3 is: how does your workflow create the signature file for each image with the loop?

If you replace with gp tool 'Iso Cluster' to generate the signature file for each image, it sounds logical to me. Isn't it?

When dealing massive image analysis as a batch via the ModelBuilder with loop, it is challenging, for sure ...

Pls keep posting...

0 Kudos
AndrewRoberts2
New Contributor III

I don't believe I can use the Iso Cluster tool for this because the signature file needs to be generated from the training samples.

0 Kudos
MikeCusi
Occasional Contributor II

As the model works fine without the iterator, you can also just use the model without the iterator, the run it as a batch.

0 Kudos
AndrewRoberts2
New Contributor III

Sorry for the delayed reply...

I have attempted to remove the iterator and run this as a batch but I get an error saying that none of the processes are ready to run.

I am getting this error from attempting to run this model as a batch and selecting all the raster which I want to classify.

-Andrew

0 Kudos
AndrewRoberts2
New Contributor III

OK... I believe I have found the issue. When I create the output of the Create Signature Tool as %name%.gsg if creates the sig files as follows... 001.jpg.gsg , 002.jpg.gsg, etc...

However if I change %name% to %n% it names the signature files as the iteration number... 01.gsg, 02.gsg, 03.gsg, etc...

I believe the double extension is what was messing this up.

-Andrew

0 Kudos