Currently faced with this challenge of mapping the pixel data I have gotten from an image to the actual X,Y coordinate in a WGS84 system
Currently using Python script to do this - but I am relatively new with it so I may be missing some stuff here >.<
I have a black-white image created using Canny edge detection till it's only white lines outlining the image.
Now I need to convert this black-white 'outline' image
into a txt file and convert those pixels into the equivalent WGS84 of the actual outdoors.
The original image is a snapshot of the top down view of point cloud data in X,Y,Z
I am able to get the original mincoord(X1,Y2) and maxcoord (X2,Y2) of the WGS84 of the original image.
Before:
After:
Save pixel data in txt format in PIL
from PIL import Image
im = Image.open("outdoor.jpg")
fil = open('file', 'w')
pixel = im.load()
row, column = im.size
for y in range(column):
for x in range(row):
pixel = pix[x, y]
fil.write(str(pixel) + '\n')
fil.close()
How could I do this mapping from the 'local' pixel data to the 'global' WGS84 coordinate equivalent and write it to a txt file with the X Y coordinates?
Thank you and all help is always appreciated :)