public static void Mat_to_vector_vector_DMatch(Mat m, List<MatOfDMatch> lvdm) { if (lvdm == null) throw new java.lang.IllegalArgumentException("Output List can't be null"); if (m == null) throw new java.lang.IllegalArgumentException("Input Mat can't be null"); List<Mat> mats = new ArrayList<Mat>(m.rows()); Mat_to_vector_Mat(m, mats); lvdm.clear(); for (Mat mi : mats) { MatOfDMatch vdm = new MatOfDMatch(mi); lvdm.add(vdm); mi.release(); } mats.clear(); }
public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k) { Mat matches_mat = new Mat(); knnMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance) { Mat matches_mat = new Mat(); radiusMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public void match(Mat queryDescriptors, MatOfDMatch matches) { Mat matches_mat = matches; match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj); return; }
public static void drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask, int flags) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; Mat matches1to2_mat = matches1to2; Mat matchesMask_mat = matchesMask; drawMatches_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags); return; }
public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) { Mat matches_mat = matches; match_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, mask.nativeObj); return; }
public static void drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; Mat matches1to2_mat = matches1to2; drawMatches_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj); return; }
public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k) { Mat matches_mat = new Mat(); knnMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance) { Mat matches_mat = new Mat(); radiusMatch_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
/** * Analyzes a scene for a target object. * * @param scene The scene to be analyzed as a GRAYSCALE matrix * @param analysis The target object's analysis from analyzeObject * @return A complete scene analysis */ public SceneAnalysis analyzeScene(Mat scene, ObjectAnalysis analysis) throws IllegalArgumentException { MatOfKeyPoint keypointsScene = new MatOfKeyPoint(); //DETECT KEYPOINTS in scene detector.detect(scene, keypointsScene); //EXTRACT KEYPOINT INFO from scene Mat descriptorsScene = new Mat(); extractor.compute(scene, keypointsScene, descriptorsScene); if (analysis == null) { throw new IllegalArgumentException("Analysis must not be null!"); } if (analysis.descriptors.cols() != descriptorsScene.cols() || analysis.descriptors.type() != descriptorsScene.type()) { throw new IllegalArgumentException("Object and scene descriptors do not match in cols() or type()."); } MatOfDMatch matches = new MatOfDMatch(); matcher.match(analysis.descriptors, descriptorsScene, matches); //FILTER KEYPOINTS /*double max_dist = 0, min_dist = 100; for(int i = 0; i < objectAnalysis.descriptors.rows(); i++) { double dist = matches.get; if(dist < ) }*/ //STORE SCENE ANALYSIS return new SceneAnalysis(keypointsScene, descriptorsScene, matches, scene); }
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask, int flags) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0); Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); List<Mat> matchesMask_tmplm = new ArrayList<Mat>((matchesMask != null) ? matchesMask.size() : 0); Mat matchesMask_mat = Converters.vector_vector_char_to_Mat(matchesMask, matchesMask_tmplm); drawMatchesKnn_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags); return; }
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0); Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); drawMatchesKnn_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj); return; }
public static void drawMatches2(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0); Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); drawMatches2_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj); return; }
public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask, boolean compactResult) { Mat matches_mat = new Mat(); knnMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj, compactResult); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) { Mat matches_mat = matches; match_1(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj); return; }
public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks, boolean compactResult) { Mat matches_mat = new Mat(); Mat masks_mat = Converters.vector_Mat_to_Mat(masks); knnMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj, compactResult); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask, boolean compactResult) { Mat matches_mat = new Mat(); radiusMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj, compactResult); Converters.Mat_to_vector_vector_DMatch(matches_mat, matches); matches_mat.release(); return; }
public static void drawMatches2(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask, int flags) { Mat keypoints1_mat = keypoints1; Mat keypoints2_mat = keypoints2; List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0); Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm); List<Mat> matchesMask_tmplm = new ArrayList<Mat>((matchesMask != null) ? matchesMask.size() : 0); Mat matchesMask_mat = Converters.vector_vector_char_to_Mat(matchesMask, matchesMask_tmplm); drawMatches2_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags); return; }