Hello,
I am dealing with estimation distance of object with PnP method. I already did some measuremnts and my calculated distance is far above actual distance. I also used a calibrated camera. For distance calculation, I use result distance in 3 axes from PnP and distance pattern in 3D:
tvec = cv2.solvePnP(
objectPoints = model,
imagePoints = key_points,
cameraMatrix = camera_matrix,
distCoeffs = dist_coeffs,
flags=cv2.SOLVEPNP_ITERATIVE
)[2]
pnp_distance = mt.sqrt(tvec[0]**2 + tvec[1]**2 + tvec[2]**2)
Here you can see that calculated measurement (dots) are above real values (line). Is there some extra options to make PnP method more precise, or maybe I did something wrong? Thanks for help in advance!