BingyaoHuang / single-shot-pro-cam-calib

[TASE & ISMAR'18] A Fast and Flexible Projector-Camera Calibration System
http://vision.cs.stonybrook.edu/~bingyao/pub/calibration_TASE
Other
161 stars 42 forks source link

error use cv.findHomography #19

Closed fare129 closed 6 months ago

fare129 commented 7 months ago

Hi Huang, now that I've run into this problem, can you please give some advice? I am using matlab2021a+mexopencv-3.4.1. Detail: 错误使用 cv.findHomography MEX �ļ���������ı�׼�쳣�� What() ��: OpenCV(3.4.1) D:\dev\opencv\modules\calib3d\src\fundam.cpp:372: error: (-5) The input arrays should be 2D or 3D point sets in function cv::findHomography

��.

出错 Calibration.getNodesAndPrjCorners>findMatchAndWarp (第 83 行) [Hcp, inliers] = cv.findHomography(camNodesUndistort, prjNodes, ...

出错 Calibration.getNodesAndPrjCorners (第 47 行) [prjCorners(:,:,i), nodePairs{i}] = findMatchAndWarp(imLightNames{i}, ...

出错 calibrateGUI (第 93 行) [nodesCell, ~] = Calibration.getNodesAndPrjCorners(calibInfo, camParams, camCorners, verbose, useParallel);

出错 calibApp/CalibrateButtonPushed (第 868 行) calibrateGUI(app); % call calibration function

错误使用 matlab.ui.control.internal.controller.ComponentController/executeUserCallback (第 410 行) 计算 Button PrivateButtonPushedFcn 时出错。

fare129 commented 7 months ago

These are the photos I took. colorGrid01 colorGrid02 colorGrid03 colorGrid04 colorGrid05 lightGrid01 lightGrid02 lightGrid03 lightGrid04 lightGrid05

BingyaoHuang commented 7 months ago

Can you check whether any of input to cv.findHomography is empty?

fare129 commented 7 months ago

yes, it is empty, and when I use your data, the program works fine, but the data I collect myself reports an error. Can you tell me if it is because the background of the picture taken has an effect? A pure white background is needed is it?

fare129 commented 7 months ago

Because when I reshot with a different background, there had a new problem: 索引中的冒号运算符的非有限端点或增量。

出错 ImgProc.segColorGrid (第 129 行) imBWCb(y-winSize:y+winSize,x-winSize:x+winSize) = 1;

出错 ImgProc.getMatchedNodes (第 28 行) [imBWGrid, imColorGridMasked] = ImgProc.segColorGrid(whiteLight, colorGrid, camCorners, verbose);

出错 Calibration.getNodesAndPrjCorners>findMatchAndWarp (第 72 行) [camNodes, prjNodes] = ImgProc.getMatchedNodes(imLightName, imColorName, camCorners, prjW, prjH, verbose);

出错 Calibration.getNodesAndPrjCorners (第 47 行) [prjCorners(:,:,i), nodePairs{i}] = findMatchAndWarp(imLightNames{i}, ...

出错 calibrateGUI (第 93 行) [nodesCell, ~] = Calibration.getNodesAndPrjCorners(calibInfo, camParams, camCorners, verbose, useParallel);

出错 calibApp/CalibrateButtonPushed (第 868 行) calibrateGUI(app); % call calibration function

错误使用 matlab.ui.control.internal.controller.ComponentController/executeUserCallback (第 410 行) 计算 Button PrivateButtonPushedFcn 时出错。

BingyaoHuang commented 7 months ago

Maybe the board segmentation did not work well on your setup. You can set break point and debug the code, see whether the intermediate results look reasonable. You can tick Verbose option in the software to enter debug mode.

fare129 commented 7 months ago

Yes, it will report an error on the segmentation part, does this look like it means that the background should be as whiteboard background as possible, as much as possible as in your case? 1709543917768

fare129 commented 7 months ago

Here's a photo captured from my second experiment.I don't think the interference should count for much anymore, but it's still a mistake in the segmentation. colorGrid01 lightGrid01

BingyaoHuang commented 7 months ago

Yes, it will report an error on the segmentation part, does this look like it means that the background should be as whiteboard background as possible, as much as possible as in your case? 1709543917768

The checkerboard region should be all black. You can check the segmentation results of my data, and compare it with yours.