X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Oct 2009 02:05 PM by  anon
Texture Filtering and Masking Roads Problem?
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Oct 2009 02:05 PM
    Normal 0 false false false MicrosoftInternetExplorer4 Hi ENVI community, I'm having a problem with masking out features of a texture filter analysis. I'm hoping someone on here can help me out. Thanks in advance! Problem: My area of interest (military base) is heavily fragmented with roads. I want to filter for texture (both first and second order in various window sizes) a satellite image over this area of interest. However, I do not want to include any reflectance data from the roads in my analysis. That is, I'm only interested in capturing texture from pixels which represent vegetated areas. I want to carry out this analysis in ENVI because the program has the capabilities of using multiple 2nd order texture filters which is important to my analysis. It'd be great to somehow label the roads pixels as "no data" across my area of interest. However, as I understand it, ENVI does not recognize "no data" as a legitimate pixel value. Therefore, I am trying to create a mask to exclude roads from my analysis. I have tried to go about this approach two ways which I detail below. Both give me conflicting results. Method 1: ArcGIS approach a) Create a vector shapefile mask in ArcGIS which excludes all roads. b) Apply the mask to my landsat scene (bands 1-5, 7, and NDVI) in ArcGIS to come up with an Arc Raster file of my landsat spectral bands that only includes vegetated regions at my study area (that is with roads masked from the scene) that I want processed for texture. The pixels that were masked now read "no data". Therefore, they should be excluded from texture filtering. d) I then save this as a TIFF file, then import into ENVI and process for texture. Problem with this approach: As far as I can tell, ENVI doesn't know what to do with "no data" pixels. So, the program automatically labels these "no data" pixels as 255. You can manually tell ENVI how to read these pixels - but, I believe it has to be a numerical value. This influences the output from the texture processing since this information of pixels labeled 255 is included in most of my moving window sizes (1x1, 3x3, 5x5, 7x7). I have many roads at my study area close to sampling locations that have been masked. Therefore, this is a big problem for my analysis.  Method 2: ENVI approach a) I used my vector shapefile masks from Method 1 step a). and brought this into ENVI along with my landsat bands. b) I then set up the texture filter in ENVI to only process the spatial subset of my vector shapefile for a particular band (either of 1-5, 7, and/or NDVI). c) It somewhat works. Yet as far as I can tell, ENVI still seems to be processing quite a bit of information from areas that are supposed to be masked. The way I'm checking to see if this is working correctly is by processing first-order mean in a 3x3 window using the "Focal Stats" option in ArcGIS. This analysis correctly excludes pixels valued as "no data". I then do my Method 2: ENVI approach. After comparing this versus the ArcGIS approach I notice the same pixels, in respective image outputs obtained from the two differing methods, have quite different values. I believe there is a way to get around this. But, I must have some flaws in my approaches? Would you recommend modifications, or new methodology? I'm a bit stumped and would greatly appreciate any help/advice anyone could offer. Thanks for your time! Eric

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Oct 2009 03:41 PM
    Hi Eric, I'm not surprised that your ArcGIS approach doesn't work.  If ENVI is giving real numerical values to the pixels that had "no data" in Arc, then that is not going to be helpful to you in ENVI. So, I like your ENVI approach in theory.  But I am left wondering exactly how you are using your mask?  I just tried running a texture filter on an image, and I noticed that the Texture Input File dialog doesn't give you the option to specify a mask band.  So, I can't see how you could be masking the area out for that calculation in ENVI.  Are you actually applying the mask to the image first, and then running the new masked image as the input for the texture filter?  If so, what value are you giving the pixels under the mask?  It seems to me that whatever value you give them, that value will be included in any texture calculations that happen to the file.  I think one problem is that the texture measures for a given pixel are calculated from a window of pixel values surrounding that pixel.  It's hard to know what to do when calculating texture measures in an areas where part of the window for the calculation falls on a pixel that you don't want to include in the analysis.  Is the right thing to do to give that unwanted pixel a value of zero in the texture calculation?  Or is it to not return a texture measure for that area? Or adjust the calculation to use a smaller window, containing only (and all of) the "good" pixels from the original window.  You could do the first option by using Basic Tools > Masking > Apply Mask to assign values of 0 to all of the pixels in your image that are under your mask.  The latter two options are not available in ENVI. Peg

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Oct 2009 04:41 PM
    Normal 0 false false false MicrosoftInternetExplorer4 Normal 0 false false false MicrosoftInternetExplorer4 Thank you for your reply Peg.   To answer your first question regarding my order of operations:   For one approach, I did try to apply the mask to the image first in Arc, then I saved this file as a TIFF (while giving a value to the "no data" cells), then brought this into ENVI and ran texture on the new masked image. But, as you correctly point out, that isn't quite right since a value needs to be selected for the pixels within the masked region and the moving windows and nieghborhood statistics would capture this information. So, whatever value that is put here (i.e., 0, etc.) is including in the texture filtering and skewing the wanted results.   To detail my approach for using an ROI/ENF while processing texture within ENVI.   Filter > Texture > Occurrence Measures > (Select a Landsat Band) > before advancing to next window select “Spatial Subset” > ROI/ENF (This allows me to select a vector shapefile that I had previously created as the mask to exclude all roads) > (Select Shapefile used to mask roads - This appears to set a rough boundary/polygon around my study area – but, it’s only a rough boundary and does not include the fine scale masking of the roads) > run texture filter.   Problem: As I mentioned, the ROI/ENF only appears to select a rough area of interest or just a polygon around my study area. This does not mask any of the roads within my study area that I was hoping for.   I tried the option you mentioned (i.e., building a mask). However, it essentially was a similar approach. I was only successful in again creating a very rough area of interest (essentially a polygon) around my study area. This did not include the mask for any of the roads within my study area.   Maybe it’s just not possible to do this in ENVI? As far as I can tell, I do believe it works correctly in ArcGIS to mask the roads across a Landsat scene from a region. Then use the focal statistics tool to process texture on pixels with digital number values and ignore all pixels labeled “no data”. However, ArcGIS is only limited to a few basic first order texture measures. Therefore, it is not very useful for many types of texture analysis.   As you suggest, I think I may have to decide about decreasing my window sizes, or possibly excluding some regions of my study area which are highly fragmented with roads.   Thanks again for the very helpful advice Peg!   Eric   

    Deleted User



    New Member


    Posts:
    New Member


    --
    16 Oct 2009 12:20 AM
    Hi Eric I believe that the first approach will work if, in ArcGIS, you reclassify 'nodata' to '-999' before importing and using the raster as a mask in ENVI. Eva
    You are not authorized to post a reply.