mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
calib3d module in opencv is split into 3 modules: 3d, calib and stereo.
stereo module in opencv_contrib is renamed to xstereo
This commit is contained in:
@@ -3,7 +3,8 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.opencv.core.*;
|
||||
import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv.3d.Cv3d;
|
||||
import org.opencv.calib.Calib;
|
||||
import org.opencv.highgui.HighGui;
|
||||
import org.opencv.imgcodecs.Imgcodecs;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
@@ -17,8 +18,8 @@ class PerspectiveCorrectionRun {
|
||||
|
||||
//! [find-corners]
|
||||
MatOfPoint2f corners1 = new MatOfPoint2f(), corners2 = new MatOfPoint2f();
|
||||
boolean found1 = Calib3d.findChessboardCorners(img1, new Size(9, 6), corners1 );
|
||||
boolean found2 = Calib3d.findChessboardCorners(img2, new Size(9, 6), corners2 );
|
||||
boolean found1 = Calib.findChessboardCorners(img1, new Size(9, 6), corners1 );
|
||||
boolean found2 = Calib.findChessboardCorners(img2, new Size(9, 6), corners2 );
|
||||
//! [find-corners]
|
||||
|
||||
if (!found1 || !found2) {
|
||||
@@ -28,7 +29,7 @@ class PerspectiveCorrectionRun {
|
||||
|
||||
//! [estimate-homography]
|
||||
Mat H = new Mat();
|
||||
H = Calib3d.findHomography(corners1, corners2);
|
||||
H = Cv3d.findHomography(corners1, corners2);
|
||||
System.out.println(H.dump());
|
||||
//! [estimate-homography]
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv._3d;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.DMatch;
|
||||
@@ -82,7 +82,7 @@ class SURFFLANNMatchingHomography {
|
||||
objMat.fromList(obj);
|
||||
sceneMat.fromList(scene);
|
||||
double ransacReprojThreshold = 3.0;
|
||||
Mat H = Calib3d.findHomography( objMat, sceneMat, Calib3d.RANSAC, ransacReprojThreshold );
|
||||
Mat H = Cv3d.findHomography( objMat, sceneMat, Cv3d.RANSAC, ransacReprojThreshold );
|
||||
|
||||
//-- Get the corners from the image_1 ( the object to be "detected" )
|
||||
Mat objCorners = new Mat(4, 1, CvType.CV_32FC2), sceneCorners = new Mat();
|
||||
|
||||
Reference in New Issue
Block a user