I am experiencing some shifting polygon that I obtain via pixel to lat lon conversion. I have a program to do image processing in opencv that uses pixel coordinates and once I had obtain my contours, I would convert these into polygon by transforming the pixel points in the polygon to lat Lon and visualized on QGIS.

I am stuck now because I keep experiencing a shift in the polygon when plotted on lat Lon epsg 4326 when I plot the polygon on my original georeference image geotiff.

I suspect it may be a precision issue but seeing that the shift is 10-9 pixel in x and y direction which translate to about 0.1 - 0.2 m error on the geotiff file, I don’t think that’s the case.

Process flow:

  1. Geotiff image
  2. gdaltranslate to generate jgw, prj, jpg.
  3. process jpg
  4. Read prj and jgw for georeferencing and transformation between pixel to lat lon and vice versa.
  5. obtain contours
  6. transform polygon
  7. convert from pixel to lat Lon
  8. overlay polygon on geotiff to visualize
  • What is your question? – Vince Aug 29 '18 at 2:18
  • Question: what are possible cause of this shift? Check the jgw and prj information and my code uses the jgw and prj info generated from geotiff. – snookrun Aug 29 '18 at 2:21
  • Please Edit the question to contain both your question and the exact details in GeoTIFF .jpw headers, along with the exact commands used to process.your data. – Vince Aug 29 '18 at 10:16
  • Is that 10e-9 degrees? That doesn't correspond to 0.1-0.2 m error. As Vince asked, what are the before/after pixel sizes? The conversion could be using LL corner versus center of pixel. – mkennedy Aug 29 '18 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.