org.opencv.core.MatOfKeyPoint Java Examples

The following examples show how to use org.opencv.core.MatOfKeyPoint. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Converters.java    From Document-Scanner with GNU General Public License v3.0 6 votes vote down vote up
public static void Mat_to_vector_vector_KeyPoint(Mat m, List<MatOfKeyPoint> kps) {
    if (kps == 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);
    for (Mat mi : mats) {
        MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
        kps.add(vkp);
        mi.release();
    }
    mats.clear();
}
 
Example #2
Source File: Converters.java    From Camdroid with Apache License 2.0 6 votes vote down vote up
public static void Mat_to_vector_vector_KeyPoint(Mat m, List<MatOfKeyPoint> kps) {
    if (kps == 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);
    for (Mat mi : mats) {
        MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
        kps.add(vkp);
        mi.release();
    }
    mats.clear();
}
 
Example #3
Source File: Features2d.java    From LicensePlateDiscern with MIT License 5 votes vote down vote up
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask)
{
    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_1(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);
    
    return;
}
 
Example #4
Source File: Features2d.java    From MOAAP with MIT License 5 votes vote down vote up
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;
}
 
Example #5
Source File: FeatureDetector.java    From FaceDetectDemo with Apache License 2.0 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #6
Source File: Feature2D.java    From MOAAP with MIT License 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #7
Source File: FeatureDetector.java    From FtcSamples with MIT License 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #8
Source File: Feature2D.java    From MOAAP with MIT License 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
    detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #9
Source File: Feature2D.java    From OpenCV-android with Apache License 2.0 5 votes vote down vote up
public  void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors)
{
    Mat keypoints_mat = keypoints;
    compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
    
    return;
}
 
Example #10
Source File: Features2d.java    From Camdroid with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #11
Source File: FeatureDetector.java    From Machine-Learning-Projects-for-Mobile-Applications with MIT License 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints, Mat mask)
{
    Mat keypoints_mat = keypoints;
    detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj);
    
    return;
}
 
Example #12
Source File: Features2d.java    From OpenCvFaceDetect with Apache License 2.0 5 votes vote down vote up
public static void drawKeypoints(Mat image, MatOfKeyPoint keypoints, Mat outImage)
{
    Mat keypoints_mat = keypoints;
    drawKeypoints_2(image.nativeObj, keypoints_mat.nativeObj, outImage.nativeObj);
    
    return;
}
 
Example #13
Source File: Feature2D.java    From OpenCvFaceDetect with Apache License 2.0 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
    detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #14
Source File: Feature2D.java    From SmartPaperScan with Apache License 2.0 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #15
Source File: FeatureDetector.java    From OpenCV-AndroidSamples with MIT License 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints, Mat mask)
{
    Mat keypoints_mat = keypoints;
    detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj);
    
    return;
}
 
Example #16
Source File: Features2d.java    From Image-Detection-Samples with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #17
Source File: Feature2D.java    From Chinese-number-gestures-recognition with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public  void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
    Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
    Mat descriptors_mat = new Mat();
    compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
    descriptors_mat.release();
    return;
}
 
Example #18
Source File: Feature2D.java    From LPR with Apache License 2.0 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #19
Source File: Features2d.java    From pasm-yolov3-Android with GNU General Public License v3.0 5 votes vote down vote up
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask)
{
    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_1(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);
    
    return;
}
 
Example #20
Source File: Features2d.java    From OpenCV-android with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example #21
Source File: Features2d.java    From MOAAP with MIT License 5 votes vote down vote up
public static void drawKeypoints(Mat image, MatOfKeyPoint keypoints, Mat outImage, Scalar color, int flags)
{
    Mat keypoints_mat = keypoints;
    drawKeypoints_0(image.nativeObj, keypoints_mat.nativeObj, outImage.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3], flags);
    
    return;
}
 
Example #22
Source File: Features2d.java    From MOAAP with MIT License 5 votes vote down vote up
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;
}
 
Example #23
Source File: Feature2D.java    From MOAAP with MIT License 5 votes vote down vote up
public  void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, boolean useProvidedKeypoints)
{
    Mat keypoints_mat = keypoints;
    detectAndCompute_0(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj, useProvidedKeypoints);
    
    return;
}
 
Example #24
Source File: Feature2D.java    From LicensePlateDiscern with MIT License 5 votes vote down vote up
public  void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, boolean useProvidedKeypoints)
{
    Mat keypoints_mat = keypoints;
    detectAndCompute_0(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj, useProvidedKeypoints);
    
    return;
}
 
Example #25
Source File: FeatureDetector.java    From pasm-yolov3-Android with GNU General Public License v3.0 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #26
Source File: FeatureDetector.java    From Image-Detection-Samples with Apache License 2.0 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #27
Source File: FeatureDetector.java    From OpenCvFaceDetect with Apache License 2.0 5 votes vote down vote up
public  void detect(Mat image, MatOfKeyPoint keypoints)
{
    Mat keypoints_mat = keypoints;
    detect_1(nativeObj, image.nativeObj, keypoints_mat.nativeObj);
    
    return;
}
 
Example #28
Source File: FeatureDetector.java    From FaceT with Mozilla Public License 2.0 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
    detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #29
Source File: FeatureDetector.java    From SimpleDocumentScanner-Android with MIT License 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
    detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}
 
Example #30
Source File: FeatureDetector.java    From MOAAP with MIT License 5 votes vote down vote up
public  void detect(List<Mat> images, List<MatOfKeyPoint> keypoints)
{
    Mat images_mat = Converters.vector_Mat_to_Mat(images);
    Mat keypoints_mat = new Mat();
    detect_3(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);
    Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
    keypoints_mat.release();
    return;
}