You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I was checking the calculation of the projection errors. And I dont get my head around how it is calculated. I think it is not correct. Please correct me if I'm wrong I'm new to this topic.
mean_error = 0
for i in xrange(len(objpoints)):
imgpoints2, _ = cv.projectPoints(objpoints[i], rvecs[i], tvecs[i], mtx, dist)
error = cv.norm(imgpoints[i], imgpoints2, cv.NORM_L2)/len(imgpoints2)
mean_error += error
print( "total error: {}".format(mean_error/len(objpoints)) )
What we want is the euclidean distance of imgpoint1 to the reprojected imgpoint2 in each point of the pattern over all images.
You loop over the len of Objectpoints and calc the error of imagepoints in respect to reprojected imagepoints. If i understood the cv.norm fct correctly the error is calculated by
but what we really want is the distance for each edge point of the frame in each image:
error =sqrt( [(imgpoints[i][0,1,1] -imgpoints2[0,1,1])^2 +(imgpoints[i][0,1,2] -imgpoints2[0,1,2])^2] +sqrt([(imgpoints[i][0,2,1] -imgpoints2[0,2,1])^2 +(imgpoints[i][0,2,2] -imgpoints2[0,2,2])^2]) + sqrt(...) +.... )/len(imgpoints)
So you need to add another loop to calc the L2 norm for each point not as a n-dim array vector.
Am I completley off?
Many thanks
The text was updated successfully, but these errors were encountered:
Hello, I was checking the calculation of the projection errors. And I dont get my head around how it is calculated. I think it is not correct. Please correct me if I'm wrong I'm new to this topic.
What we want is the euclidean distance of imgpoint1 to the reprojected imgpoint2 in each point of the pattern over all images.
You loop over the len of Objectpoints and calc the error of imagepoints in respect to reprojected imagepoints. If i understood the cv.norm fct correctly the error is calculated by
error =sqrt( [(imgpoints[i][0,1,1] -imgpoints2[0,1,1])^2 +(imgpoints[i][0,1,2] -imgpoints2[0,1,2])^2] +[(imgpoints[i][0,2,1] -imgpoints2[0,2,1])^2 +(imgpoints[i][0,2,2] -imgpoints2[0,2,2])^2] + .... ) / len(imgpoints)
but what we really want is the distance for each edge point of the frame in each image:
error =sqrt( [(imgpoints[i][0,1,1] -imgpoints2[0,1,1])^2 +(imgpoints[i][0,1,2] -imgpoints2[0,1,2])^2] +sqrt([(imgpoints[i][0,2,1] -imgpoints2[0,2,1])^2 +(imgpoints[i][0,2,2] -imgpoints2[0,2,2])^2]) + sqrt(...) +.... )/len(imgpoints)
So you need to add another loop to calc the L2 norm for each point not as a n-dim array vector.
Am I completley off?
Many thanks
The text was updated successfully, but these errors were encountered: