Matt Spencer New Member
Posts:14  
18 Jul 2017 12:47 PM |
|
Hi, I have areas of NoData outside of my image which keep being incorrectly classified during classification, so I would like to remove them. It is shown here http://i63.tinypic.com/b8mhbk.png - the NoData areas are the white areas outside the image. Is there a way to do this in ENVI, as I am struggling to figure it out. Thanks.
|
|
|
|
MariM Veteran Member
Posts:2396  
19 Jul 2017 07:54 AM |
|
Assuming you are using ENVI 5.3 or 5.4 (new interface, not classic), you can go to View Metadata->Edit Metadata and add in the 'Data value to ignore'. Set this to your background value, You can find your background value by using the Cursor value tool to find the pixel value of the background. Then save the header. The file will be closed and then re-opened and now the background should be transparent in the display. It should also be ignored during classification and other processes.
|
|
|
|
Matt Spencer New Member
Posts:14  
19 Jul 2017 08:59 AM |
|
The data values are 'No Data', the Cursor Value window shows 'Data: [No Data, No Data, No Data]' but there is no waty to set the ignore value to No Data? Thanks
|
|
|
|
MariM Veteran Member
Posts:2396  
19 Jul 2017 11:57 AM |
|
Ah, then this means you already have a 'Data Ignore value' set in your header. What tool are you using to classify your image? If you are using the Classification Workflow, then it should recognize the DIV. If you are using one of the ENVI Classic tools under the Supervised menu, such as Maximum Likelihood, Mahalanobis distance, etc then it will not recognize the DIV. In this case, you need to make a mask of your background using the Build Mask tool. You may need to remove the DIV from your header so you can see what the actual data value of the background is so that you can generate a mask.using this value.
|
|
|
|
Matt Spencer New Member
Posts:14  
19 Jul 2017 12:35 PM |
|
Thanks. I''ve already created a mask using a shapefile of my study area which gives the No Data areas a value of 0 and my study area values of 1, but No Data areas are still classifed in the classification as 'Masked pixels' which I don't want. I am using Maximum Likelihood in ENVI 5.3 as I am not sure how to load the training data in the Classification Workflow as it won't load from the ROI .xml file. I will try removing the DIV from the header and creating a mask.
|
|
|
|
MariM Veteran Member
Posts:2396  
19 Jul 2017 12:52 PM |
|
If they show as 'masked pixels' it means they were excluded from the classification which is what you want, yes? Masked pixels are different than 'unclassified' pixels which are included in the classification processing but did not meet any threshold for your algorithm. What do you want these pixels to be? You can apply your mask to the classification image and set the masked value to whatever you like.
|
|
|
|
Matt Spencer New Member
Posts:14  
20 Jul 2017 01:32 PM |
|
Does the 'Compute statistics' tool recognise the DIV? Because I seem to get different eigenvector values if I remove the DIV and compute statistics with the mask compared to when I keep the DIV and compute them without the mask. I'm therefore not sure what statistics are correct. Thanks.
|
|
|
|
Matt Spencer New Member
Posts:14  
20 Jul 2017 02:20 PM |
|
I think it is the effect of the mask when applied in the 'Compute statistics' tool, because i have tried it with the DIV + no mask, no DIV + mask and DIV + mask. The statistics are the same when I used DIV + mask compared to No DIV + mask, so I am inclined to stick with the statistics from when i used no DIV and mask. Also, when I ran a PCA without using a mask there was values outside of the study area of, for example, 1.71. This mask is simply made from a shapfile of my study area, so I can use it for computing statisitcs as well as in the PCA without having to assign any values to the mask. Is that correct? I am not worried about using it for the classification, more so about getting the correct statistics and PCA. Thanks
|
|
|
|
MariM Veteran Member
Posts:2396  
21 Jul 2017 09:50 AM |
|
The PCA tool is a Classic tool and requires a mask as input to exclude pixels - this is also true of Compute Statistics tool. These Classic tools do not recognize the DIV. However, if you choose the 'Quick Stats' from the Data manager or Layer Manager, it *will* honor the DIV. This is because it is a tool of the new interface which recognizes this header value. It is a little confusing since there are a mix of classic and new tools as the interface transitions. Yes, you are correct. If you just want to exclude pixels from Compute Statistics or PCA, you can use the mask and you really don't need to 'apply' it. The Apply Mask is used to actually change those values to a single chosen value.
|
|
|
|
Stavroula Giannakopoulou New Member
Posts:49  
30 Dec 2019 02:25 AM |
|
Hello everyone and Merry Christmas, I have a question regarding the Data Ignore Values and the mask that I use. Despite that, I implemented those processes the Quick Stats tool did not take into account the data ignore value when calculating histogram statistics. Is there a way to solve this error? Because I can't find a solution! Thank you very much in advance for your help!
|
|
|
|
Jason Wolfe New Member
Posts:59  
30 Dec 2019 07:44 AM |
|
This issue was fixed in ENVI 5.3.1. If you have an earlier version of ENVI, the Quick Stats tool will not correctly take into account data ignore values.
|
|
|
|
Stavroula Giannakopoulou New Member
Posts:49  
01 Jan 2020 06:12 AM |
|
Thank you very much for your response! It was very helpful!
|
|
|
|