BoofCV v1.1.2 CameraCalibrationStereo GUI Version, Re-projection Errors after calibration return NaN

18 views
Skip to first unread message

Chris Niessl

unread,
Feb 7, 2024, 3:10:07 PMFeb 7
to BoofCV
Hello,

I'm currently using the GUI option on CameraCalibrationStereo from the applications.jar to obtain calibration information for a stereo camera, running it via:
java -jar applications.jar CameraCalibrationStereo --VerboseDebug --GUI

I fed 20 captured image pairs into the Planar Stereo Calibration GUI, and was able to get out StereoParameters from the 'Calib' tab in the left side-bar:

StereoParameters
 left=CameraPinholeRadial
 fx=1465.7593831055951
 fy=1466.139339338661
 skew=0.0
 cx=1045.0777859204775
 cy=587.0033976856058
 width=1920
 height=1200
 r0= .090613402 r1=-.149851575

 right=CameraPinholeRadial
 fx=1463.8278252677048
 fy=1464.93711199008
 skew=0.0
 cx=1032.2696093351494
 cy=561.7504063956554
 width=1920
 height=1200
 r0= .105780261 r1=-.170300821

 right_to_left=
  p=
 3.04377078 -.023742569 .0208924

 q=
  .007760093 -.005254133 -.001686263 .999954665

However, when I go to the 'Stats' tab to obtain the Reprojection Error, I get NaN values for almost all of the mean and max errors for the majority of the captures:

Metrics             left right
quality.fill_border  60%  58%
quality.fill_inner  100%  99%
quality.geometric   100% 100%

Reprojection Errors (px):
mean=NaN max=NaN

image      | max (px)
capture_000.png      NaN
                  NaN
capture_001.png      NaN
                  NaN
capture_002.png      NaN
                  NaN
capture_003.png      NaN
                  NaN
capture_004.png      NaN
                  NaN
capture_005.png      NaN
                  NaN
capture_006.png      NaN
                  NaN
capture_007.png 21354961.144
                  NaN
capture_008.png      NaN
                  NaN
capture_009.png      NaN
                  NaN
capture_010.png      NaN
                  NaN
capture_011.png      NaN
                  NaN
capture_012.png      NaN
                  NaN
capture_013.png      NaN
                  NaN
capture_014.png      NaN
                  NaN
capture_015.png      NaN
                  NaN
capture_016.png      NaN
                  NaN
capture_017.png      NaN
                  NaN
capture_018.png      NaN
                  NaN
capture_019.png      NaN
                  NaN

My suspicion is that the actual errors are indeed being measured, since I see the error circles when the Error Visual Flag is checked, but that they may not be returned by computeErrors() in CalibrateStereoPlanar.java (line 359 onward) when ran by computeQualityText (Line 304). However, when running with verboseDebug, I did not get any output from the terminal I ran CameraCalibrationStereo from.

I tried doing a lookup for NaN and computeErrors both here in the BoofCV group, and with the search function on https://boofcv.org but did not find anything. Any locations in the source I should look in to try and find the issue, or if its something as simple as I needed to take more images, would be appreciated. I can provide images or the yaml results if needed.

Thanks,
Chris

Peter A

unread,
Feb 8, 2024, 1:08:28 PMFeb 8
to boo...@googlegroups.com
Hi Chris,

I just pushed a fix and it is available in the latest SNAPSHOT code. I think a bug was accidentally introduced in one of the recent updates. There is now a unit test to catch this in the future. Thanks for pointing that out!

Cheers,
- Peter


--
You received this message because you are subscribed to the Google Groups "BoofCV" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boofcv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boofcv/b2cdff36-6fa8-45d1-85e5-695ff9b089edn%40googlegroups.com.


--
"Now, now my good man, this is no time for making enemies."    — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.

Chris Niessl

unread,
Feb 8, 2024, 1:35:38 PMFeb 8
to boo...@googlegroups.com
Hi Peter,

The fix worked! I'm now getting reasonable reprojection error metrics.

Metrics             left right
quality.fill_border  60%  58%
quality.fill_inner  100%  99%
quality.geometric   100% 100%

Reprojection Errors (px):
mean=1.416 max=11.971

image            | max (px)
capture_000.png     2.347
                    2.774
capture_001.png     2.927
                    2.493
capture_002.png     2.282
                    1.947
capture_003.png     7.402
                    7.121
capture_004.png     1.450
                    0.879
capture_005.png     4.778
                    2.660
capture_006.png     3.872
                    7.883
capture_007.png     2.090
                    2.532
capture_008.png     3.042
                    2.455
capture_009.png     1.118
                    1.402
capture_010.png     1.447
                    0.650
capture_011.png     2.012
                    1.778
capture_012.png     3.231
                    3.707
capture_013.png     4.897
                    3.225
capture_014.png     1.952
                    1.423
capture_015.png     8.394
                   10.413
capture_016.png     6.707
                    7.336
capture_017.png     9.703
                   11.971
capture_018.png     2.357
                    1.427
capture_019.png     8.068
                    7.952

Thank you!
-Chris

You received this message because you are subscribed to a topic in the Google Groups "BoofCV" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/boofcv/ckSsoVR7U_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to boofcv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boofcv/CAFKAwfs1uw2k826XadUhEJ0oTi8JozY4t%2BbyjY-Mr-d7f075dg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages