X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06 Jul 2007 07:02 AM by  anon
Combine Classifications
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
06 Jul 2007 07:02 AM
    Hi everyone, I am doing a post-classification change detection on a barrier island, ultimately preforming a hurricane Dennis impact analysis. For date1, I have several single band ISODATA classification files. In each file, some of the clusters are labeled, and others were intentionally left unidentified. I then would mask out known pixels and re-run the ISODATA classification on unknown pixels. This "cluster bust" approach to classification has produced multiple classification files. This same process was used to classify date2, once again resulting in multiple, single band classification files. I would like to preform the change detection analysis in ENVI and therefore need 1 classification file for Date1 and likewise for Date2. My question is, how would I "merge" the multiple classification files for Date1? Advanced Thanks for anyones input!!

    Deleted User



    New Member


    Posts:
    New Member


    --
    06 Jul 2007 07:02 AM
    So there are multiple classification files for each date. But for each of those files, is there a consistent classification? Or are you going to need to create one large classification that contains all the classes in the individual files? I'd be very tempted to solve this problem with masks. Create a mask so that in your first class image, the 'unknown' class is zero and everything else is one. Then do the same thing for the second class image, and you can use a band math expression like (b1*b1mask) + (b2*b2mask) to combine them. This works b/c classification images are just images with their pixel values set to their classification number if i'm remembering correctly. So you just have to work out the classification scheme between all the class images. If it's consistent, such that class 1 is the same for all the class. files, this is actually easier b/c the unknown class is, i think, already a 0. In that case, the expression should simplify to b1 + b2 + b3....etc. At the end of all this band math, you're probably going to have to change the envi header for your final product to reflect a file type of 'ENVI classification' and set up the class names in the header, etc. Hope that helps, Jeff

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    06 Jul 2007 07:02 AM
    Jeff is right - you can solve this in band math and using masking, although you don't have to actually make a mask file, it can be done in the band math equation itself. Here is an example: b1*(b1 gt 0) + b2*(b2 gt 0) + b3*(b3 gt 0) The above equation is taking the variable 'b1' and multiplying it by a mask of itself (b1 gt 0) so it returns only the pixels with values greater than 0. Then it adds it to the other variables b2 and b3 (or as many variables as you have classification images), so that the result includes all classification results greater than 0 (unclassified). Note that this only works if classes 1, 2, 3.. n are consistent across classified images. That is, whatever class '1' is in one image also needs to be represented as a value of '1' in all input images or you will get undesired class combinations. If your classification values are not consistent, you will need to perform a bit more prep on the files and possibly reclass some classes. With regards to Ziad Aly's questions: - if you move your Cursor Location/Value tool around the black areas, are they actually 0 or do they return a value? If they have a value, it might be a data stretching issue. Try changing the stretch type in the display under the Enhance menu. If the values are actually 0 when they should not be, it could be a problem with the band math equation. - The result of band math will be an 'ENVI Standard' file type. To change this back to an 'ENVI Classification' file type, go to File ->Edit ENVI Header and select the band math result file. In the Header Info dialog, select the drop down arrow next to 'File Type' and choose 'ENVI Classification'. You will be prompted to enter the number of classes. You should enter the number of known classes + 1 for 'unclassified' in this dialog. In the next dialog, you can assign colors and class names to the classes. Save the header and now the grayscale image will be displayed as a Classification type image.
    You are not authorized to post a reply.