Showing results for 
Search instead for 
Do you mean 

How to remove black background areas surrounding individual images in a mosaic.

by Technical Evangelist on ‎08-23-2016 11:24 AM - edited on ‎08-25-2016 01:24 PM by Technical Evangelist (3,850 Views)

Symptoms

When mosaicking several images and reprojecting to a different map projection the output mosaic image has areas of black pixels around each of the individual input images.  How can these black background areas be removed from the mosaic output?

 

Diagnosis

The black areas surrounding each input image is an inherent problem due to the fact that a raster image has to be rectangular. The nature of raster data is such that when imagery does not fit squarely within an raster file, NoData (null or background) values are inserted around the image to form a rectangle. This happens during the reprojection of individual images. Just because the actual image area has a non-rectangular shape, it does not mean that you will have a file that contains no data outside of the image area. Instead there are background pixel values in those areas to form a rectangular image.

 

Solution

 

The solution is to select the Compute Active Area option when adding your images to MosaicPro and set the Boundary Search Type to Edge. Selecting these options will compute a polygon around the edge of the imagery ensuring that the surrounding background area is not included in the mosaic process.

 

 

Comments
by jruhs
on ‎10-09-2018 12:16 PM

Active Areas is not working consistently for me. Some images come out properly rectanglar with the black nodata pixels removed, but some come in as triangles and trapezoids with parts of the orthoimage having been trimmed off. The Edge method always gives me error messages so these Active Areas have been computed using the Corner option.

by Technical Evangelist
on ‎10-10-2018 01:20 PM

@jruhs

  1. What version of ERDAS IMAGINE are you using?
  2. What is the error message you get when using the Edge boundary search type?
  3. Are you using the Corner boundary search type to compute the active area when some of the images get trimmed into triangles and trapezoids?
  4. Does this always happen to the same images? Do those images all have a NoData value set for them?
  5. Have you tried using the Crop Area option with the Corner boundary search?

Kind regards,

 

Stephen Bent

Hexagon Geospatial Support

by jruhs
on ‎10-10-2018 01:43 PM
  1. 2018 v 16.5.0 build 1058
  2. error message is: Image boundary edge search failed. Please try some other methods to define the active area.
  3. Yes, always Corner boundary search type background value range 0 to 0 or 0 to 1. Edge search type has never worked for me.
  4. It does seem to happen to the same images. The NoData value for the whole set of images is 0 but their are also areas of 1, 1, 1 pixels which is why i was using the background value range of 0 to 1
  5. I have tried using the Crop Area option with the Corner boundary search but the same thing happens
  6. activeareafail.png
  7. My active areas are also computing very very slowly

Thanks for responding!

by Technical Evangelist
on ‎10-10-2018 09:38 PM

@jruhs

Active area calculation can be slow  only when you are using old pyramid layer file. Please  delete the existing pyramid layers and recreate pyramids by using the Edit  ImageMetada tools.

 

Active area option may not give you good results when image boudary  are not regular. Sometimes  even a single bad pixel outsde  the image area may create big problem.  Therefore please create a support ticket.  We will  investigate  the cause of the problem.

 

 

 

Partha Roy

Hexagon Geospatial 

by paul.ctr.miller
on ‎08-29-2019 08:05 AM

I'm having same issue my borders are square but my project block was flown diagonally so i have a big background area that I want to eliminate from my mosaic 

Contributors