# Forum

### Author Topic: Converting drone image pixels to a global coordinate (lat and long)  (Read 3045 times)

#### gurjar

• Newbie
• Posts: 1
##### Converting drone image pixels to a global coordinate (lat and long)
« on: November 17, 2023, 08:08:10 AM »
Hi,  I am currently working on a project involving a drone's RGB images and need assistance in converting pixel coordinates from the image into the world coordinate system.

Could you please provide guidance or support regarding this matter? Your expertise in this area would be highly valuable to the success of my project.

Thank you in advance for your time and assistance.

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14888
##### Re: Converting drone image pixels to a global coordinate (lat and long)
« Reply #1 on: November 17, 2023, 07:14:16 PM »
Hello gurjar,

Below you can see an example of the script below, that returns 3D coordinates based on pixel coordinates on the first image:

Code: [Select]
`import Metashapepoints = [(10,10), (10,500), (500,500), (500,10)]chunk = Metashape.app.document.chunkcrs = chunk.crsT = chunk.transform.matrixN = 0 #for the first camera in chunkcamera = chunk.cameras[N]if chunk.model:    surface = chunk.modelelif chunk.point_cloud:    surface = chunk.point_cloudelse:    surface = chunk.tie_pointsvertices = list()for point in points:    x, y = point    ray_origin = camera.unproject(Metashape.Vector([x, y, 0]))    ray_target = camera.unproject(Metashape.Vector([x, y, 1]))    point3D = surface.pickPoint(ray_origin, ray_target)    if not point3D:        continue #skip    point3D = crs.project(T.mulp(point3D))    vertices.append(point3D)print(vertices)print("Script finished")`
Best regards,
Alexey Pasumansky,
Agisoft LLC