Skip to content

Replacing the Matrix vlaues

4 messages · PUJAN RAJ REGMI, Ophelia Wang, Roger Bivand

#
Hi all,

I've been having troubles to get rid of background values (255) of
aerial photo
mosaics (.img) in Erdas Imagine. I've tried "mosaic" (which has options
of
ignore certain input and output background and 0 values), "rescale"
(ignore 0
and 255), ArcGIS copy raster (ignore 0 and 255), etc. etc. Everything
that has
an option to ignore both 0 and 255 that I've tried.

None of those worked in terms of removing the white background of the
aerial
photo mosaics. I have nearly 50 images, so I can't manually create AOI
and then
subset each mosaic based on AOI.

Any suggestions? Thanks for you help.

Ophelia
#
On Sun, 25 May 2008, Ophelia Wang wrote:

            
There are (at least) two things mixed up here. One concerns the actual 
values, the other their graphical representation. You could script a loop 
to set SpatialGridDataFrame variables meeting your conditions to NA, which 
would display as transparent in many R graphics devices, but getting the 
missing values across to other systems might need patience. A combination 
of R and Python might get them into Arc - R to set to NA and export, then 
Python or VBA to import the file with NAs into Arc. Do you need to crop 
them too?

Roger

  
    
#
Hi all,

Thanks for all the responses. I finally fixed the problem by creating a binary
mask that sets the aerial photos as 1 and the white background (layer 1=255,
layer 2=254 and 255, layer 3=255) as 0. I then used the mask function in Erdas'
utilities to mask out the unwanted background.

Ophelia