Convert pixel to points in world coordinates

asked 2019-12-18 13:01:05 -0500

Ben470 gravatar image

updated 2019-12-19 08:38:28 -0500


I have used color in range to mask my photo to pic out the colored stripes. I wish to find the position of the colored stripes in world coordinates. I know the approx height of the colored stripes above the camera, and I assume stripes are near horizontal. A = 2690 – mm distance to bottom stripe B = 4380 – mm distance to middle stripe C = 5670 – mm distance to top stripe I am new to image processing and OpenCV I wondered if there are any functions which can convert pixels to position? image description

edit retag flag offensive close merge delete



I don't understand anything. What kind of image is it? Some kind of LIDAR? What is your data?

Anyway, if it's LIDAR or other depth camera, you'd rather use the raw point cloud instead of projecting it to an image and try something with OpenCV. Especially if you need the spatial information. For point cloud processing there is the PCL library.

If you are using a 2D photo, you need a precise camera position to be able to get the world coordinates.

kbarni gravatar imagekbarni ( 2019-12-19 03:46:14 -0500 )edit

Hi, Sorry for not being clear this is just a 2D photo and i do have relative precise camera position

Ben470 gravatar imageBen470 ( 2019-12-19 08:17:26 -0500 )edit

Can you post orignal image?

supra56 gravatar imagesupra56 ( 2019-12-19 08:25:39 -0500 )edit

Now attached

Ben470 gravatar imageBen470 ( 2019-12-19 08:38:52 -0500 )edit

Ok, it's more clear now. Anyway, this is not an easy problem. Not because it's difficult to detect those stripes, but because from this shallow angle the slightest error will have important incidence on the result.

I would try a SIFT keypoint detection and matching between the captured image and the photo of the sail, then find the position and angle from the estimated homography matrix. The position still needs to be transformed in real life coordinates.

Anyway, as I said, probably the error will be too important for a precise positioning of the sail. You should also think about another solution.

kbarni gravatar imagekbarni ( 2019-12-20 08:11:33 -0500 )edit

Thank you very much for your comments. Will update here if I come up with a solution or change idea

Ben470 gravatar imageBen470 ( 2019-12-27 10:26:20 -0500 )edit