Remove Collar from ECW File (Orthophoto Mosaic)

This is a limitation of early versions (<= 3.3) of the ECW format which didn't support NoData values or Alpha transparency. The lossy compression makes it even harder to remove the collars as the black values aren't exactly RGB 0,0,0 but vary.

To get rid of the collar you'll need to mask/clip the collar and convert the image to another format that does support NoData values, mask bands or Alpha transparency. You can use ECWs compressed using version 4 or later of the ERDAS ECW/JP2 SDK, JPEG2000 or Geotiff.

There are a few ways to remove the collar, I tend to either draw a polygon around the "good" data and clip with that or use the GDAL nearblack utility.


ECW since 2010 has supported alpha transparency that removes what you refer to as "collars". This is a legacy limitation in ECW v3 files only.

ECW v4 files are written automatically by all ERDAS software tagged 2010 and above which includes Imagine and ERMapper. Third party products that use the v4 SDK may support writing or certainly reading this file version (reading is provided free of charge for desktop apps). I do not know off-hand if FME 2012 have updated their ECW support

Note: The ECW format versions are backwards compatible. If you have an ECW v4 file with an alpha band defined but are reading with an application using the v3 SDK, the additional band will simply be ignored. Check the erdas.com website for some free ECW plugins, specifically for your ArcInfo license that will add ECW v4 support

Unfortunately the prevalence of v3 compressors has meant many people assume the limitations remain and is somehow a limitation of wavelet formats. This is not certainly not true

References,

  • http://www.gdal.org/frmt_ecw.html
  • http://erdas.com/products/ecw/ERDASECWJPEG2000SDK/Details.aspx
  • http://erdas.com/products/ecw/ECWPlugins/Downloads.aspx

There are ways to manipulate FME 2012 to remove the collar. It is a complicated process and too much to type here. One quick way to show how it can be done is to use the RasterExpressionEvaluator and the expression

if(A[0]<$(MAXPIXVALUE)&&A[1]<$(MAXPIXVALUE)&&A[2]<$(MAXPIXVALUE),0,A[0]);if(A[0]<$(MAXPIXVALUE)&&A[1]<$(MAXPIXVALUE)&&A[2]<$(MAXPIXVALUE),0,A[1]);if(A[0]<$(MAXPIXVALUE)&&A[1]<$(MAXPIXVALUE)&&A[2]<$(MAXPIXVALUE),0,A[2])

Where MAXPIXVALUE is a user parameter set to the max pixle value to be considered black. In my case it was around 8. The expression searches each pixel and band. If any one band has a value less than than the MAXPIXVALUE specified it considers that cell to have no data. If the pixel value is say 9,8,8 it will leave the pixel as is because one band is higher than the specified value.

In my scenario, I used the expression to create a shapefile that fit the imagery exactly and clipped the original ecws to the shapefile created by the expression.