Reverse subset/clip?
By dmeek in ERDAS Software Forum
Is there a way within Erdas to do a reverse subset/clip, by that I mean as opposed to clipping to the boundaries of a second polygon/raster (i.e. being left with the proverbial cookie-or the intersection of the clipping polygon/raster and original raster ) you are instead left with everything outside the boundaries of the second polygon/raster (i.e. the cookie dough that remained from cookie-cutting the raster)...(trying to draw some AOIs and use them for cloud removal).
----------------------------------
You were sent this email because you opted to receive email notifications when someone created a new thread, or replied to a topic within this forum, ERDAS Software Forum.
To unsubscribe:
Re: Reverse subset/clip?
By Donn Rodekohr in ERDAS Software Forum
Yes, there is always a way. The way may be somewhat convoluted and not as direct as you would like, but there is always a way.
Here are two ways I've done it in the past.
1. The Double mask method. First identify your clouds and outline them with an AOI. Use this AOI to subset the clouds into a clouds.img file. This is the first mask. Now write a model kind of like this:
Input files: source.img, clouds.img
Function statement: either 0 if (clouds.img) or source.img otherwise.
(this is shorthanded notation leaving out all of the modeler syntax. It simply tests to see if a value >0 is present in clouds.img, and if so, write a value of 0)
The output of this model is the source file masked by the first mask, hence the Double Mask.
2. You can use the raster editing tools to FILL the cloud AOIs with 0's but I would not recommend this method. the Editing tools are destructive in that they over-write the source file values. One slip and you can destroy your source image. But, If you are careful and don't have but one or two clouds to remove, you can do it this way.
----------------------------------
You were sent this email because you opted to receive email notifications when someone responded to this thread.
By dmeek in ERDAS Software Forum
Thanks for the great idea;
in constructing the first mask I'm having the following problem: I create and save an AOI layer, but when I try to use the mask tool, I get an "error opening layer,AOI" message .....Any ideas as to what might be causing this?
Re: Reverse subset/clip?
By Donn Rodekohr in ERDAS Software Forum
Use the SUBSET tool to create the first mask.
Re: Reverse subset/clip?
By dmeek in ERDAS Software Forum
That all worked pretty well; however the resulting union of the two images retains these fairly dark artifacts where the clouds were masked by the AOIs and the max values were input from the second image. So far, I've tried using Brightness Inversion, Histogram Equalization, and Convolution tools...but to no avail. Is there a way to do some sort of smoothing, overall across the image to either equalize the contrast or soften the edges where the ellipses were-or some way to create the AOI's so they themselves have a more soft border?
Thanks again,
David
Re: Reverse subset/clip?
By Donn Rodekohr in ERDAS Software Forum
Those dark areas are probably zero values where the clouds used to be. You can soften the border by running a smoothing filter over the image.
If the images are going to be used for presentation backgrounds you can change the viewer background to a non-offensive gray or green or tan and turn transparency on. The the black-holes that are clouds will be seen as gray, green, or tan holes that are less eye attracting.
If you want to smooth the edges with blended zeros and real values you can run a convolution filter and set "Apply only to" zero. That will let real values alone and only alter the values within the cloud mask.
Re: Reverse subset/clip?
By dmeek in ERDAS Software Forum
Thanks for those insights; it turns out upon looking again at the images that there is some haze in the first image and the second image lacks the haze; as a result, it seems the difference is more in general contrast between the hazy first image (that is generally cloud free) and the hazeless second image (that has the clear areas that I'm putting into the first image. I've been trying to use the "Haze Reduction" tool (both with High and Low Pass) on the hazy image, but it doesn't seem to be having quite the desired effect (i.e. getting it to be "the same" as the second image....any thoughts on other approaches? i..e equalizing across the images somehow...subtract something from the first?
Thanks again,
David