Hi Chaitanya (& all),
I tried your nearblack comment, and got:

 nearblack -white -o 0394w.tif 0394.tif
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitati
ERROR 4: Creation of file 0394w.tif failed.


I think I am having trouble understanding the setting/using of nodata values.
I have now also downloaded and compiled gdal 1.8.0 (but nearblack remained on v1.7.3) on ubuntu 10.04 LTS, and recreated my vrt, to no improvement.

To recap: I have 179 3*8bit RGB band aerial images that have been orthorectified. The resulting skewness in the images has created white slivers in the corners, and I am presuming that these white slivers are recognised as "nodata". (My first mistake?)

I use the following to create a vrt:
gdalbuildvrt -addalpha -hidenodata -srcnodata "255 255 255" -vrtnodata "0 0 0" -input_file_list files 177_untiled_orthos_nodata_180.vrt

Thinking that the above will tell gdalbuildvrt that, for the input orthos, white should be recognised as 'nodata', and in the VRT, those white pixels should be converted to black, as nodata.
Well, as you've guessed, it didn't happen this way, and I still have the white bits after mosaicking my VRT thus:
gdal_translate -projwin -16000 -3520650 -13000 -3525650 177_untiled_orthos_nodata.vrt try1.tif

I tried re-running gdalbuildvrt specifying -vrtnodata "255 255 255" (to match the input ortho files) and the outside border of my vrt turned white, but the slivers between the mosaicked orthos were still present.

Please can someone show me the correct way to address this problem.

I have included gdalinfo results for both an individual ortho, and for the vrt itself.

Thanks & regards,
Zoltan






**********************************  GDALINFO on indicidual ORTHO ****************************************
geograph@gs0:~/vrt_177$ gdalinfo --version
GDAL 1.8.0, released 2011/01/12
geograph@gs0:~/vrt_177$
geograph@gs0:~/vrt_177$
geograph@gs0:~/vrt_177$
geograph@gs0:~/vrt_177$ gdalinfo /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0003.tif
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Driver: GTiff/GeoTIFF
Files: /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0003.tif
Size is 4840, 9547
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams" does not end in null byte
Coordinate System is:
PROJCS["Projection = Transverse Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",27],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-47885.500000000000000,-3486281.500000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=Orthophoto of Inner 0003 of Model 002003
  TIFFTAG_SOFTWARE=uSMART
  TIFFTAG_XRESOLUTION=400
  TIFFTAG_YRESOLUTION=400
  TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  -47885.500,-3486281.500) ( 26d29'45.49"E, 31d29'52.22"S)
Lower Left  (  -47885.500,-3491055.000) ( 26d29'44.66"E, 31d32'27.20"S)
Upper Right (  -45465.500,-3486281.500) ( 26d31'17.19"E, 31d29'52.57"S)
Lower Right (  -45465.500,-3491055.000) ( 26d31'16.40"E, 31d32'27.55"S)
Center      (  -46675.500,-3488668.250) ( 26d30'30.93"E, 31d31' 9.88"S)
Band 1 Block=4840x1 Type=Byte, ColorInterp=Red
  Overviews: 2420x4773, 1210x2386, 605x1193, 302x596, 151x298, 75x149, 37x74
Band 2 Block=4840x1 Type=Byte, ColorInterp=Green
  Overviews: 2420x4773, 1210x2386, 605x1193, 302x596, 151x298, 75x149, 37x74
Band 3 Block=4840x1 Type=Byte, ColorInterp=Blue
  Overviews: 2420x4773, 1210x2386, 605x1193, 302x596, 151x298, 75x149, 37x74
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
Warning 1: TIFFFetchNormalTag:ASCII value for tag "ImageDescription" does not end in null byte
Warning 1: TIFFFetchNormalTag:ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations
geograph@gs0:~/vrt_177$
*******************************************************************************************************


**********************************  GDALINFO on individual VRT *******************************************
geograph@gs0:~/vrt_177$ gdalinfo 177_untiled_orthos_nodata_180.vrt
Driver: VRT/Virtual Raster
Files: 177_untiled_orthos_nodata_180.vrt
       /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0003.tif
       /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0005.tif

[one, two, skip a few...]

       /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0392.tif
       /mnt/geo_lvm0/ngi_jobs/orthos_8bit/NGI_177_untiled_orthos/0394.tif
Size is 97430, 112568
Coordinate System is:
PROJCS["Projection = Transverse Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",27],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-48104.500000000000000,-3486058.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Corner Coordinates:
Upper Left  (  -48104.500,-3486058.000) ( 26d29'37.23"E, 31d29'44.93"S)
Lower Left  (  -48104.500,-3542342.000) ( 26d29'27.26"E, 32d 0'12.22"S)
Upper Right (     610.500,-3486058.000) ( 27d 0'23.13"E, 31d29'48.53"S)
Lower Right (     610.500,-3542342.000) ( 27d 0'23.26"E, 32d 0'15.89"S)
Center      (  -23747.000,-3514200.000) ( 26d44'57.72"E, 31d45' 1.34"S)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=128x128 Type=Byte, ColorInterp=Alpha
geograph@gs0:~/vrt_177$
*******************************************************************************************************



On 2011-02-16 19:39, Chaitanya kumar CH wrote:
Zoltan,

Have you tried the nearblack GDAL utility on the original 176 images?
http://www.gdal.org/nearblack.html

On Wed, Feb 16, 2011 at 5:25 PM, Zoltan Szecsei <zolt...@geograph.co.za> wrote:
On 2011-02-16 12:20, Zoltan Szecsei wrote:
Hi All,
I've built a vrt with 176 images.

I now need to mosaic this whole area into roughly 5 x 5 ortho images.

How can I force the white edges into background of the overlapping orthos?
I'm a little cautious of simply (finding a way to) making "white" transparent as it is only the white on the edges that need to be backgrounded.

Hi again,
Since the above post, I have tried different ways to set nodata, but to no avail - I still get the white edges:
(see jpeg sent with my original post)

gdalbuildvrt -addalpha -hidenodata -input_file_list files 177_untiled_orthos_nodata.vrt
gdalbuildvrt -srcnodata "0 0 0"  -addalpha -hidenodata -input_file_list files 177_untiled_orthos_blk.vrt
gdalbuildvrt -srcnodata "255 255 255"  -addalpha -hidenodata -input_file_list files 177_untiled_orthos_white.vrt

How should I be masking out the nodata (or even white pixels) so that when I mosaic a bunch of tiffs together, I dont get the white stripes in the resulting image?

Using GDAL 1.7.3, released 2010/11/10 on Ubuntu 10.04
Viewing with Quantum GIS - 1.6.0-Trunk on Ubuntu 10.04 (same box).
...but running the whole lot in xterms with Xming & putty from my WinVista box.


Regards,

Zoltan




--

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.

65 Main Road, Muizenberg 7945
Western Cape, South Africa.

34° 6'16.35"S 18°28'5.62"E

Tel: +27-21-7884897  Mobile: +27-83-6004028
Fax: +27-86-6115323     www.geograph.co.za
===========================================



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3446 - Release Date: 02/15/11

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E


-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.

65 Main Road, Muizenberg 7945
Western Cape, South Africa.  

34° 6'16.35"S 18°28'5.62"E 

Tel: +27-21-7884897  Mobile: +27-83-6004028
Fax: +27-86-6115323     www.geograph.co.za
===========================================

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3455 - Release Date: 02/20/11

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to