Ask Your Question

jim_73_mk1's profile - activity

2014-01-30 19:52:39 -0600 asked a question Stereo calibration: problem with projection matrices and SGBM

I am trying to create a depth map from a disparity using SGBM. The resulting disparity map has almost no definition. So I set up sliders for the various SGBM values and can get very limited results - they are basically blank.

After calibrating the cameras individually followed by the stereo calibration I can rectify images which comes out rather well:

rectified image

Something I've noticed is the projection matrices and the Q matrix have several NAN values. Also the ROI for each camera is all zeros which can['t be right. Below are the saved calibration setting that I am using showing the NAN values.

Since the RMS values for each single camera calibration are under 0.4 and the stereo RMS is less than 2.0 with a re-projection error of less then 4.0 I'm not sure what may be wrong at this point. Suggestions and help would be greatly appreciated.

Camera_0_Matrix
8.2360702625110662e+002 0. 3.1410424020211406e+002
0. 8.1860608380736392e+002 2.4384904263053622e+002
0. 0. 1.
Camera_1_Matrix
8.1134698384868875e+002 0. 3.1328331721626449e+002
0. 8.0724997468627953e+002 2.3930244099756220e+002
0. 0. 1.
Camera_0_Distortion_Coefficients
2.6712887348238189e-002 -1.8664642728347297e-001
-4.8596016262543446e-004 -1.4728080493686517e-003
5.2687479496305778e-001 0. 0. 0.
Camera_1_Distortion_Coefficients
3.9590803660099684e-002 -1.8981006469293660e-001
-6.4688587632222173e-003 -3.7797348771147284e-003
2.7996253215102412e-001 0. 0. 0.
Mat_R
9.9922618707330479e-001 -1.4827571495127988e-002 -3.6430347109269276e-002
1.4533977386417006e-002 9.9985983789215160e-001 -8.3107202823446188e-003
3.6548468754191266e-002 7.7748114984945516e-003 9.9930163701351293e-001
Mat_T
-7.1373089613768613e+001 -6.5822496464438818e-001 -6.3515467302110000e+000
Mat_E
6.8256121992123484e-002 6.3455389090094831e+000 -7.1055121292732304e-001
-3.7380546856077390e+000 6.4909033105906033e-001 7.1554634341813454e+001
-3.7961924878715458e-001 -7.1372845688807843e+001 5.6918241952876536e-001
Mat_F
7.2342254670288030e-008 6.7664989166222400e-006 -2.2929759854297700e-003
-3.9819395869095442e-006 6.9566352175857590e-007 6.3859013286650543e-002
6.0378280400693674e-004 -6.4036046720140641e-002 1.
Camera_0_Rotation_Matrix
9.9862396895832117e-001 -4.8951125057362125e-003 5.2213087396614198e-002
5.1174999253298069e-003 9.9997839183290060e-001 -4.1263860459532032e-003
-5.2191760043559916e-002 4.3879084815174659e-003 9.9862744126261294e-001
Camera_1_Rotation_Matrix
9.9602166255538394e-001 9.1856234214931377e-003 8.8636742058627288e-002
-9.5633854847882640e-003 9.9994690362209304e-001 3.8381759545177280e-003
-8.8596779729730887e-002 -4.6705737278212095e-003 9.9605662307048315e-001
Camera_0_Projection_Matrix
.Nan 0. .Nan 0.
0. .Nan .Nan 0.
0. 0. 1. 0.
Camera_1_Projection_Matrix
.Nan 0. .Nan .Nan
0. .Nan .Nan 0.
0. 0. 1. 0.
Mat_Q
1. 0. 0. .Nan
0. 1. 0. .Nan
0. 0. 0. .Nan
0. 0. 1.3955142868906164e-002 .Nan
ROI_0
0 0 0 0
ROI_1
0 0 0 0

2013-12-26 14:08:33 -0600 asked a question Gaussian Curvature

I am working with range images, gray scale images where the brightness indicates distance from camera. What I need for processing is a function that generates the gaussian curvature value for a location on the images. Is there such a thing in OpenCV or a simple way to computer a gaussian curvature?

2013-03-15 10:25:02 -0600 commented answer stereoCalibrate intermittantly fails

Thank you for responding... Yes I am checking to make sure both captured images have found all the chessboard corners as follows:

if(findChessboardCorners(view_0, board_size, pointBuf_0, CV_CALIB_CB_ADAPTIVE_THRESH CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE)) { found = findChessboardCorners(view_1, board_size, pointBuf_1, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE); }

In this case the variable "found" can only be true if both cameras see all the corners. Only then will the images be processed and parameters stored for passing along to stereoCalibrate().

Is it possible that findChessboardCorners() sometimes returns true when not all corners are found?

2013-03-14 18:23:23 -0600 received badge  Editor (source)
2013-03-14 15:36:56 -0600 asked a question stereoCalibrate intermittantly fails

I am running a stereo calibration after calibrating each camera independently. When running the stereo calibrate if I leave the chessboard pattern visible to the two cameras relatively close and not moving it then the stereo calibration works. Moving farther away also works but if the calibration board is moved around it will typically fail with an assertion error:

OpenCV Error: Assertion failed (nimages > 0 && nimages == (int)imagePoints1.l() && (!imgPtMat2 || nimages == (int)imagePoints2.total())) in unknown func, file ......\src\opencv\modules\calib3d\src\calibration.cpp,line 3168

I assume the data passed into stereoCalibrate() is correct since it works when the calibration pattern is not moved. Why would moving the calibration pattern cause the stereo calibration to fail?