#1 Mon 30 July 2012 12:51
- ppluvinet
- Participant assidu
- Lieu: VALENCE
- Date d'inscription: 6 Aug 2007
- Messages: 626
GDAL : référencer photo BMP
Bonjour,
Je dispose d'une cinquantaine de vieilles photos (format BMP RGB). Et pour le référencement, je dispose des XMIN, XMAX, YMIN, YMAX de chaque photo en lambert 2 étendue. .
Je souhaiterai les géoréférencer. J'ai voulu utiliser GDAL et j'ai essayé quelque chose du style :
Code:
gdalwarp -t_srs EPSG:27572 -tr 5 5 -te 555894 1986782 558993 1991288 "D:\RASTER\1948\photobmp\1.bmp" "D:\RASTER\1948\photobmp\1tifOK7.tif"
Or le résultat est une image entièrement noire, bien calée, mais noire !
voici la description d'une des image :
Code:
gdalinfo "D:\RASTER\1948\photobmp\1.bmp" Driver: BMP/MS Windows Device Independent Bitmap Files: D:\E0775_data\RASTER\1948\photobmp\1.bmp Size is 3396, 4937 Coordinate System is `' Origin = (-1417.000000000000000,1417.000000000000000) Pixel Size = (2834.000000000000000,-2834.000000000000000) Corner Coordinates: Upper Left ( -1417.000, 1417.000) Lower Left ( -1417.000,-13990041.000) Upper Right ( 9622847.000, 1417.000) Lower Right ( 9622847.000,-13990041.000) Center ( 4810715.000,-6994312.000) Band 1 Block=3396x1 Type=Byte, ColorInterp=Red Band 2 Block=3396x1 Type=Byte, ColorInterp=Green Band 3 Block=3396x1 Type=Byte, ColorInterp=Blue
Comment m'y prendre mieux ? avec GDAL ou un autre outil?
Je précise que les photos n'ont pas forcément toute la même dimension mais à priori la même résolution.
Merci d'avance,
Dernière modification par ppluvinet (Mon 30 July 2012 12:55)
Pascal PLUVINET
Hors ligne
#2 Mon 30 July 2012 13:21
Re: GDAL : référencer photo BMP
Bonjour,
Que donne le gdalinfo pour l'image tiff ? Il doit y avoir une option à rajouter pour garder les bandes.
D'abord j'essayerai en gardant le même format (bmp) ou bien je converti mes bmp en tiff avec l'outil "convert" et géoréférence avec gdalwarp.
Y.
Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !! - GeoRezo vous aide ? Aidez GeoRezo !
Hors ligne
#3 Mon 30 July 2012 13:36
- ppluvinet
- Participant assidu
- Lieu: VALENCE
- Date d'inscription: 6 Aug 2007
- Messages: 626
Re: GDAL : référencer photo BMP
Voici les info du tif (tout noir) généré :
Code:
Driver: GTiff/GeoTIFF
Files: D:\E0775_data\RASTER\1948\photobmp\1tifOK7.tif
Size is 3099, 4506
Coordinate System is:
PROJCS["NTF (Paris) / Lambert zone II",
GEOGCS["NTF (Paris)",
DATUM["Nouvelle_Triangulation_Francaise_Paris",
SPHEROID["Clarke 1880 (IGN)",6378249.2,293.4660212936265,
AUTHORITY["EPSG","7011"]],
AUTHORITY["EPSG","6807"]],
PRIMEM["Paris",2.5969213],
UNIT["grad",0.01570796326794897],
AUTHORITY["EPSG","4807"]],
PROJECTION["Lambert_Conformal_Conic_1SP"],
PARAMETER["latitude_of_origin",46.8],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",0.99987742],
PARAMETER["false_easting",600000],
PARAMETER["false_northing",2200000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","27572"]]
Origin = (555894.000000000000000,1991288.000000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 555894.000, 1991288.000) ( 0d34'32.35"W, 44d42'38.17"N)
Lower Left ( 555894.000, 1986782.000) ( 0d34'31.06"W, 44d39'55.92"N)
Upper Right ( 558993.000, 1991288.000) ( 0d32' 6.74"W, 44d42'38.82"N)
Lower Right ( 558993.000, 1986782.000) ( 0d32' 5.55"W, 44d39'56.57"N)
Center ( 557443.500, 1989035.000) ( 0d33'18.93"W, 44d41'17.38"N)
Band 1 Block=3099x1 Type=Byte, ColorInterp=Red
Band 2 Block=3099x1 Type=Byte, ColorInterp=Green
Band 3 Block=3099x1 Type=Byte, ColorInterp=BluePascal PLUVINET
Hors ligne
#4 Mon 30 July 2012 13:41
- ppluvinet
- Participant assidu
- Lieu: VALENCE
- Date d'inscription: 6 Aug 2007
- Messages: 626
Re: GDAL : référencer photo BMP
J'ai tenté de créer un BMP référencé et voici les info concernant le nouveau raster (toujours noir) :
Code:
Driver: BMP/MS Windows Device Independent Bitmap
Files: D:\E0775_data\RASTER\1948\photobmp\1tifOK8.bmp
D:\E0775_data\RASTER\1948\photobmp\1tifOK8.aux
D:\E0775_data\RASTER\1948\photobmp\1tifOK8.rrd
D:\E0775_data\RASTER\1948\photobmp\1tifOK8.bmp.aux.xml
Size is 3099, 4506
Coordinate System is:
PROJCS["NTF (Paris) / Lambert zone II",
GEOGCS["NTF (Paris)",
DATUM["Nouvelle_Triangulation_Francaise_Paris",
SPHEROID["Clarke 1880 (IGN)",6378249.2,293.4660212936265,
AUTHORITY["EPSG","7011"]],
TOWGS84[-168,-60,320,0,0,0,0],
AUTHORITY["EPSG","6807"]],
PRIMEM["Paris",2.33722917,
AUTHORITY["EPSG","8903"]],
UNIT["grad",0.01570796326794897,
AUTHORITY["EPSG","9105"]],
AUTHORITY["EPSG","4807"]],
PROJECTION["Lambert_Conformal_Conic_1SP"],
PARAMETER["latitude_of_origin",52],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",0.99987742],
PARAMETER["false_easting",600000],
PARAMETER["false_northing",2200000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
AUTHORITY["EPSG","27572"]]
Origin = (555894.000000000000000,1991288.000000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Metadata:
PyramidResamplingType=NEAREST
Corner Coordinates:
Upper Left ( 555894.000, 1991288.000) ( 0d37'13.49"W, 49d54'43.62"N)
Lower Left ( 555894.000, 1986782.000) ( 0d37'11.87"W, 49d52' 1.50"N)
Upper Right ( 558993.000, 1991288.000) ( 0d34'36.56"W, 49d54'44.38"N)
Lower Right ( 558993.000, 1986782.000) ( 0d34'35.06"W, 49d52' 2.26"N)
Center ( 557443.500, 1989035.000) ( 0d35'54.24"W, 49d53'22.95"N)
Band 1 Block=3099x1 Type=Byte, ColorInterp=Red
Overviews: 1550x2253, 775x1127, 388x564
Band 2 Block=3099x1 Type=Byte, ColorInterp=Green
Overviews: 1550x2253, 775x1127, 388x564
Band 3 Block=3099x1 Type=Byte, ColorInterp=Blue
Overviews: 1550x2253, 775x1127, 388x564Pascal PLUVINET
Hors ligne
#5 Mon 30 July 2012 14:21
- ppluvinet
- Participant assidu
- Lieu: VALENCE
- Date d'inscription: 6 Aug 2007
- Messages: 626
Re: GDAL : référencer photo BMP
J'ai fini par trouver ce que je cherchais :
Code:
gdal_translate -strict -stats -a_ullr 555894 1991288 558994 1986782 -of BMP "D:/bmp_source.bmp" "D:/bmp_output.bmp"
Pascal PLUVINET
Hors ligne


