Ask Your Question

dnns's profile - activity

2019-08-27 02:35:16 -0600 received badge  Enthusiast
2019-08-19 09:26:55 -0600 received badge  Teacher (source)
2019-08-19 09:19:00 -0600 received badge  Self-Learner (source)
2019-08-15 04:39:23 -0600 marked best answer python ret value vastly different from reprojection error

In this question, I am referring to the documentation example given here: https://docs.opencv.org/4.1.0/dc/dbb/...

To give a short summary: It's an example on how to calibrate a camera using a chessboard-pattern. In the example the author calibrates the camera like this:

ret, mtx, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None)

It is stated in the documentation, that the ret-value is supposed to be the overall RMS of the reprojection error: (Check: https://docs.opencv.org/4.1.0/d9/d0c/...)

However, at the end of the script, the author calculates the reprojection error like this:

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( "self-calculated error: {}".format(mean_error/len(objpoints)) )
print( "ret-value: {}".format(ret))

So this does - to my understanding - calculate the average normed reprojection-error per point per image. However, this is vastly different from the ret-value, that is given back to the user by calibrateCamera. Running the code and comparing the results leads to the results:

self-calculated error: 0.02363595176460404
ret-value: 0.15511421684649151

These are an order of maginute different and I think that should not be the case, ...right (?!) And the more important question: It is often stated, that the most important value to define "a good calibration" is a reprojection error < 1 and close to zero. Which reprojection error should be used for that?

I really hope someone can answer this question as it has been bugging me for a week now.

Cheers,

Dennis

2019-08-15 04:39:22 -0600 received badge  Scholar (source)
2019-08-15 04:38:56 -0600 answered a question python ret value vastly different from reprojection error

I found this on StackOverflow, which answers the question. The sum must be calculated inside the root. However the formu

2019-08-14 06:59:16 -0600 edited answer Problem in copying part of image to another

Because "part" in your example provides an undefined array. Your Image has the width 1000, but you're indexing 1080 to 1

2019-08-14 06:59:16 -0600 received badge  Editor (source)
2019-08-14 06:58:49 -0600 answered a question Problem in copying part of image to another

Because "part" in your example provides an undefined array. Your Image has the width 1000, but you're indexing 1080 to 1

2019-08-14 06:37:19 -0600 answered a question Point correspondences for camera calibration using non-standard pattern

I'm not sure it works with only one point. Costum Calibration patterns are however possible with openCV. https://www.yo

2019-08-14 04:12:53 -0600 asked a question python ret value vastly different from reprojection error

python ret value vastly different from reprojection error In this question, I am referring to the documentation example

2019-08-02 03:22:22 -0600 received badge  Self-Learner (source)
2019-08-02 03:22:17 -0600 marked best answer size of distCoeffs

Dear Forum,

how is the size of the distortion vector chosen by the program? Does it only depend on the type of the camera lens model (Fisheye, etc.)?

If not, can one set a preferred size for the distCoeffs somehow?

Cheers,

Dennis

2019-08-02 02:10:39 -0600 answered a question size of distCoeffs

i found a working solution for me, using the flag CALIB_RATIONAL_MODEL in calibrateCamera. The documentation provides t

2019-07-31 02:10:33 -0600 asked a question size of distCoeffs

size of distCoeffs Dear Forum, how is the size of the distortion vector chosen by the program? Does it only depend on t