what is the best way to georeference image data to google staelite map?
I am trying to mark field boundaries by meta’s segment anything pretrained model from a given lat-lon input.
My approach is capturing a screenshot from the google map using pyppeteer or google API, then feeding the image to SAM vit h, then find contours from the output mask and finally converting the pixel coordinates of the contours to geocoordinates using some formula provided by chatgpt.
For checking the accuracy I create a kml file with the geocoordinates generated and import to my maps google.
The results are inaccurate. Though the image output of SAM is correct.
But there is some problem in pixel to lat-lon conversion or my approach. I may need to use georeferencing. I don’t know how to do that accurately.
Any help or suggestions would be greatly appreciated. I am also providing the code with one of my approaches