An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20080525/837e6c53/attachment.pl>
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
Ophelia Wang PhD candidate Department of Geography and Environment University of Texas at Austin 210 West 24th Street, Austin, TX 78712, USA Phone: 1-512-471-5116 Fax: 1-512-471-5049 Email: opheliawang at mail.utexas.edu
On Sun, 25 May 2008, Ophelia Wang wrote:
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.
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
Any suggestions? Thanks for you help. Ophelia
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
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