Image to World Transformation

Hello everyone,

I’ve recently encountered a challenge while working on point transformations between image and world coordinates. Using OpenCV’s solvePnP function, I successfully transformed world points to image points. Here is a brief overview of my current implementation:

import cv2

world_points = [[0,0,0], [0.72,0,0], [0.72,0.72,0], [0,0.72,0]]
img_points = [[2346, 838], [2286, 838], [2286, 778], [2346, 778]]

success, rvec, tvec = cv2.solvePnP(world_points, img_points, K, D, flags=cv2.SOLVEPNP_ITERATIVE)
R, _ = cv2.Rodrigues(rvec)

While I can project from world to image coordinates perfectly, I’m struggling with the reverse: projecting image points back to their original world coordinates. I assumed this process would be straightforward but haven’t succeeded with various methods suggested for image-to-world projection.

Could anyone provide guidance or share insights on how to accurately compute the world points from image points using the results from solvePnP?

Thank you in advance for your help!

Your question looks AI-generated. I see sure signs in various aspects, among them that your question is logically inconsistent. I am also aware of your other account.

? Thanks for the feedback, I didn’t know that clean up my message using AI is against rule here. I’ll edit my message or remove the topic and create another one.

you misunderstand. it’s not about cleanup. it’s about your question being logically inconsistent. solvePnP does not project points.

I didn’t mentioned that SolvePnP projects points. Please read my message again, I mentioned that I want to use the result from SolvePnP to compute world points from the image points. It means rotation and translation coming from SolvePnP function can be used for it. I have mentioned SolvePnP specifically as it is also possible to do it using other technique as well which was not my ideal way to follow.

I know that you are here as moderator and you are supposed to be careful of people’s topic here, but your comment to my question was unfair. Please review it and let me know if you can help to cleanup this topic and make space for people who actually want to answer me. Thanks