A get the following error when executing my code:
Caused by: CvException [org.opencv.core.CvException: cv::Exception: /home/reports/ci/slave_desktop/50-SDK/opencv/modules/calib3d/src/fundam.cpp:1152: error: (-215) npoints >= 0 && (src.depth() == CV_32F || src.depth() == CV_32S) in function void cv::convertPointsFromHomogeneous(cv::InputArray, cv::OutputArray)
Here is the code I am using:
Mat res = new Mat(); // Result mat for triangulation
Mat P1 = new Mat(3,4,CvType.CV_32F);
double[] diagVal = {1,0,0,0,
0,1,0,0,
0,0,1,0};
P1.put(0, 0, diagVal);
int[] max = new int[4];
for(int i = 0; i < max.length; i++)
max[i] = 0;
Mat P2 = buildCameraMatrix(R1, T1);
Calib3d.triangulatePoints(P1, P2, objLeft, objRight, res);
TriangulatePoints results in a (914,4) Mat of Type CV_32F (res.type() == 5 is true).
What Am I doing wrong?