Most basic projectPoints example gives wrong answer
When I run projectPoints function using java code below with most simple inputs I get what I believe is incorrect answer. Did I miss something?
I get the following result:
(x,y,z)= [{0.0, 1.0, 1.0}, {0.0, 1.0, 5.0}, {0.0, 1.0, 10.0}]
(u,v)= [{0.0, 78.5398178100586}, {0.0, 19.73955535888672}, {0.0, 9.966865539550781}]
should be
(u,v)=[{0.0, 100.0}, {0.0, 20.0}, {0.0, 10.0}]
public static void main(String[] args) {
setDllLibraryPath("C:/aaa_eric/code/lib/x64");
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
MatOfPoint3f objectPts3f = new MatOfPoint3f(
new Point3(0.0,1.0, 1.0),
new Point3(0.0,1.0, 5.0),
new Point3(0.0,1.0,10.0));
MatOfPoint2f imagePts2f = new MatOfPoint2f();
Mat rVec = Mat.zeros(3,1, CvType.CV_64F);
Mat tVec = Mat.zeros(3,1, CvType.CV_64F);
//camera matrix, no distortion
Mat kMat = Mat.zeros(3, 3, CvType.CV_64F);
kMat.put(0, 0,
100.0, 0.0, 0.0,
0.0, 100.0, 0.0,
0.0, 0.0, 1.0);
Mat dMat = Mat.zeros(4, 1, CvType.CV_64F);
Calib3d.projectPoints(objectPts3f, imagePts2f, rVec, tVec, kMat, dMat);
System.out.println(objectPts3f.toList());
System.out.println(imagePts2f.toList());
}
I submitted a bug report: #11099. I'll report back if I learn more