For a deep learning project, I trained a YOLO based model to detect objects on satellite images (from spacenet dataset; epsg:4326). However, as the Darknet only takes JPG/PNG images as input(to the best of my knowledge), I had to convert TIFF files to JPG first and also convert the bounding box labels to pixel coordinates. For creating bounding boxes, I used some examples from spacenet utilities and a bit of experimentation.

Now that I have the pixel prediction for objects from the YOLO model and I want to be able to map these pixel coordinates back to the longitude/latitude information (using the corresponding geomappings in TIFF file?) so I can put the results on an interactive map such as ArcGIS. How can I convert the pixel coordinates of the predicted bounding boxes, back to the real world longitude, latitude information.

  • What software are you using? I have some Python scripts I can share that do this. The georeferencing info will contain the coordinates of the upper-left-most pixel and the resolution, and that is enough to do the mapping. Really it's quite easy once you figure out how to access the georef info, and there are a handful of Python packages that will do the conversion automatically. – Jon Jul 28 '18 at 20:22
  • Yes, I'm looking for a Python-based solution. It will be really helpful if you can share those Python scripts. At present, I have a jpg and tiff files of the same resolution and I have pixel-based coordinates for the objects in the images. I just want to convert the pixel data to long-lat coordinates by maybe using the geospatial information present in the tiff file. – sircasms Jul 28 '18 at 22:00
  • I haven't had time to dig up my code, but here's a question I asked that has code that should get you what you want: gis.stackexchange.com/questions/244560/… – Jon Jul 31 '18 at 3:12

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.