Non-Square Pixel on georeferencing of images using GDAL

المشرف العام

Administrator
طاقم الإدارة
I have a image in .jpg format. I have some GCP and also know the pixels values of these GCp in that image. Now i trying to convert this image into geotiff. for that I have coded the following lines. But the output seems to be weird. Although the geo information are tagged in the images but the pixels in the output seems to have non-square pixel. Anybody help please???

My code :

GDALDatasetH hSrcDSarray; GDALAllRegister(); hSrcDSarray = GDALOpen("test.jpg", GA_ReadOnly ); hDriverarr = GDALGetDriverByName( "GTiff" ); GDALDatasetH hDstDSarray; char **papszOptions = NULL; GDALProgressFunc pfnProgress = GDALTermProgress; hDstDSarray= GDALCreateCopy( hDriverarr, "geo.tif", hSrcDSarray, FALSE, papszOptions, pfnProgress, NULL ); double w=GDALGetRasterXSize( hSrcDSarray ); //get width double h=GDALGetRasterYSize( hSrcDSarray ); //get height // The GCP and pixels values come from external file GDAL_GCP *gcps = NULL; gcps = (GDAL_GCP *) malloc(((10000-2)/4)*sizeof(GDAL_GCP) ); for(int i=0;i
 
أعلى