[gdal-dev] Antialiasing problem with gdaladdo at edges/nodata sections

Even Rouault even.rouault at spatialys.com
Tue Nov 22 02:55:36 PST 2016


Andreas,

I assume you run a recent enough version of GDAL ?

As the image uses JPEG compression, one explanation would be that the 
transition betweeen data and nodata is not "clean" (which is a feature of JPEG 
compresssion). Therefore you would need to first translate your image to a 
uncompressed one (or one with a non	-JPEG compression), and run nearblack -
white on it so as to clean those edges.

Even

> Hi,
> 
> I have Orthoimages where the boundaries aren't rectangular, but they
> have corners and sometimes even diagonal edges.
> 
> I noticed, that after creating pyramids/overview with gdaladdo, that I
> get antialiasing/rendering artefacts that aren't present in the original
> image at full resolution. See attached image that shows the problem. I
> used a pink background to emphasize the problem.
> 
> My nodata values are set to white (rgb 255,255,255) in the original
> image.
> 
> Here is the gdaladdo command that I used:
> 
> gdaladdo -r cubic --config BIGTIFF_OVERVIEW YES --config
> COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY 85 --config
> PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
> dop2002_lv95.tif 2 4 8 16 32 64 128 256 512 1024
> 
> This is the output of gdalinfo on the original image:
> 
> -----------------------
> 
> Driver: GTiff/GeoTIFF
> Files: dop2002_lv95 - Kopie.tif
> Size is 240000, 190000
> Coordinate System is:
> PROJCS["CH1903+ / LV95",
> GEOGCS["CH1903+",
> DATUM["CH1903+",
> SPHEROID["Bessel 1841",6377397.155,299.1528128,
> AUTHORITY["EPSG","7004"]],
> TOWGS84[674.374,15.056,405.346,0,0,0,0],
> AUTHORITY["EPSG","6150"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.0174532925199433,
> AUTHORITY["EPSG","9122"]],
> AUTHORITY["EPSG","4150"]],
> PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],
> PARAMETER["latitude_of_center",46.95240555555556],
> PARAMETER["longitude_of_center",7.439583333333333],
> PARAMETER["azimuth",90],
> PARAMETER["rectified_grid_angle",90],
> PARAMETER["scale_factor",1],
> PARAMETER["false_easting",2600000],
> PARAMETER["false_northing",1200000],
> UNIT["metre",1,
> AUTHORITY["EPSG","9001"]],
> AXIS["Easting",EAST],
> AXIS["Northing",NORTH],
> AUTHORITY["EPSG","2056"]]
> Origin = (672000.000000000000000,234000.000000000000000)
> Pixel Size = (0.100000000000000,-0.100000000000000)
> Metadata:
> AREA_OR_POINT=Area
> TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> TIFFTAG_XRESOLUTION=1
> TIFFTAG_YRESOLUTION=1
> Image Structure Metadata:
> COMPRESSION=YCbCr JPEG
> INTERLEAVE=PIXEL
> SOURCE_COLOR_SPACE=YCbCr
> Corner Coordinates:
> Upper Left ( 672000.000, 234000.000) ( 13d51' 5.78"W, 35d55'48.10"N)
> Lower Left ( 672000.000, 215000.000) ( 13d47'45.10"W, 35d46' 1.03"N)
> Upper Right ( 696000.000, 234000.000) ( 13d35'53.15"W, 35d59'13.56"N)
> Lower Right ( 696000.000, 215000.000) ( 13d32'34.61"W, 35d49'25.99"N)
> Center ( 684000.000, 224500.000) ( 13d41'49.73"W, 35d52'37.44"N)
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
> NoData Value=255
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
> NoData Value=255
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
> NoData Value=255
> 
> ----------------------------------------------------------------------------
> ---
> 
> 
> Is there a way to get rid of these artefacts at the nodata borders?
> 
> Thank you and greetings,
> 
> Andreas


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list