title: How to create a mapping function that will map the Image pixel data to actual WGS84 coordinate data of the original Point Cloud Data
body: <p>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</p>
  <p>Currently using Python script to do this - but I am relatively new with it so I may be missing some stuff here &gt;.&lt;</p>
  <p>I have a black-white image created using Canny edge detection till it's only white lines outlining the image.</p>
  <p>Now I need to convert this black-white 'outline' image</p>
  <p>into a txt file and convert those pixels into the equivalent WGS84 of the actual outdoors.</p>
  <p><strong>The original image is a snapshot of the top down view of point cloud data in X,Y,Z</strong></p>
  <p>I am able to get the original mincoord(X1,Y2) and maxcoord (X2,Y2) of the WGS84 of the original image.</p>
  <p>Before:</p>
  <p><a href="https://i.stack.imgur.com/EYoWK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EYoWK.jpg" alt="InitialGreyImage" /></a></p>
  <p>After:</p>
  <p><a href="https://i.stack.imgur.com/dfzKf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dfzKf.jpg" alt="EdgeDetection" /></a></p>
  <p><a href="https://stackoverflow.com/questions/28424465/save-pixel-data-in-txt-format-in-pil">Save pixel data in txt format in PIL</a></p>
  <pre><code>from PIL import Image  
  
  im = Image.open(&quot;outdoor.jpg&quot;)
  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()
    
  </code></pre>
  <p>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?</p>
  <p>Thank you and all help is always appreciated :)</p>