Java Code Examples for org.opencv.utils.Converters#vector_vector_KeyPoint_to_Mat()

The following examples show how to use org.opencv.utils.Converters#vector_vector_KeyPoint_to_Mat() . 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: DescriptorExtractor.java    From sudokufx with Apache License 2.0 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 2
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 3
Source File: Feature2D.java    From MOAAP with MIT 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 4
Source File: Feature2D.java    From OpenCvFaceDetect with Apache License 2.0 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 5
Source File: DescriptorExtractor.java    From PixaToon with GNU General Public License v3.0 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 6
Source File: DescriptorExtractor.java    From MOAAP with MIT 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 7
Source File: DescriptorExtractor.java    From Form-N-Fun with MIT 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 8
Source File: DescriptorExtractor.java    From SmartPaperScan with Apache License 2.0 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 9
Source File: Feature2D.java    From MOAAP with MIT 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 10
Source File: Feature2D.java    From SmartPaperScan with Apache License 2.0 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 11
Source File: Feature2D.java    From opencv-documentscanner-android with Apache License 2.0 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 12
Source File: Feature2D.java    From LPR with Apache License 2.0 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 13
Source File: DescriptorExtractor.java    From LPR with Apache License 2.0 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 14
Source File: DescriptorExtractor.java    From VIA-AI with MIT 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 15
Source File: GenericDescriptorMatcher.java    From marvel with MIT License 3 votes vote down vote up
/**
* <p>Adds images and their keypoints to the training collection stored in the
* class instance.</p>
*
* @param images Image collection.
* @param keypoints Point collection. It is assumed that <code>keypoints[i]</code>
* are keypoints detected in the image <code>images[i]</code>.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.html#genericdescriptormatcher-add">org.opencv.features2d.GenericDescriptorMatcher.add</a>
*/
   public  void add(List<Mat> images, List<MatOfKeyPoint> keypoints)
   {
       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);
       add_0(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);

       return;
   }
 
Example 16
Source File: DescriptorExtractor.java    From Android-Car-duino with GNU General Public License v2.0 3 votes vote down vote up
/**
* <p>Computes the descriptors for a set of keypoints detected in an image (first
* variant) or image set (second variant).</p>
*
* @param images Image set.
* @param keypoints Input collection of keypoints. Keypoints for which a
* descriptor cannot be computed are removed and the remaining ones may be
* reordered. Sometimes new keypoints can be added, for example:
* <code>SIFT</code> duplicates a keypoint with several dominant orientations
* (for each orientation).
* @param descriptors Computed descriptors. In the second variant of the method
* <code>descriptors[i]</code> are descriptors computed for a <code>keypoints[i]</code>.
* Row <code>j</code> is the <code>keypoints</code> (or <code>keypoints[i]</code>)
* is the descriptor for keypoint <code>j</code>-th keypoint.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_extractors.html#descriptorextractor-compute">org.opencv.features2d.DescriptorExtractor.compute</a>
*/
   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);
       Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
       return;
   }
 
Example 17
Source File: DescriptorExtractor.java    From ResistorScanner with MIT License 3 votes vote down vote up
/**
* <p>Computes the descriptors for a set of keypoints detected in an image (first
* variant) or image set (second variant).</p>
*
* @param images Image set.
* @param keypoints Input collection of keypoints. Keypoints for which a
* descriptor cannot be computed are removed and the remaining ones may be
* reordered. Sometimes new keypoints can be added, for example:
* <code>SIFT</code> duplicates a keypoint with several dominant orientations
* (for each orientation).
* @param descriptors Computed descriptors. In the second variant of the method
* <code>descriptors[i]</code> are descriptors computed for a <code>keypoints[i]</code>.
* Row <code>j</code> is the <code>keypoints</code> (or <code>keypoints[i]</code>)
* is the descriptor for keypoint <code>j</code>-th keypoint.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_extractors.html#descriptorextractor-compute">org.opencv.features2d.DescriptorExtractor.compute</a>
*/
   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);
       Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
       return;
   }
 
Example 18
Source File: DescriptorExtractor.java    From marvel with MIT License 3 votes vote down vote up
/**
* <p>Computes the descriptors for a set of keypoints detected in an image (first
* variant) or image set (second variant).</p>
*
* @param images Image set.
* @param keypoints Input collection of keypoints. Keypoints for which a
* descriptor cannot be computed are removed and the remaining ones may be
* reordered. Sometimes new keypoints can be added, for example:
* <code>SIFT</code> duplicates a keypoint with several dominant orientations
* (for each orientation).
* @param descriptors Computed descriptors. In the second variant of the method
* <code>descriptors[i]</code> are descriptors computed for a <code>keypoints[i]</code>.
* Row <code>j</code> is the <code>keypoints</code> (or <code>keypoints[i]</code>)
* is the descriptor for keypoint <code>j</code>-th keypoint.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_extractors.html#descriptorextractor-compute">org.opencv.features2d.DescriptorExtractor.compute</a>
*/
   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);
       Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
       return;
   }
 
Example 19
Source File: GenericDescriptorMatcher.java    From effective_android_sample with Apache License 2.0 3 votes vote down vote up
/**
* <p>Adds images and their keypoints to the training collection stored in the
* class instance.</p>
*
* @param images Image collection.
* @param keypoints Point collection. It is assumed that <code>keypoints[i]</code>
* are keypoints detected in the image <code>images[i]</code>.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.html#genericdescriptormatcher-add">org.opencv.features2d.GenericDescriptorMatcher.add</a>
*/
   public  void add(List<Mat> images, List<MatOfKeyPoint> keypoints)
   {
       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);
       add_0(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj);

       return;
   }
 
Example 20
Source File: DescriptorExtractor.java    From SoftwarePilot with MIT License 3 votes vote down vote up
/**
* <p>Computes the descriptors for a set of keypoints detected in an image (first
* variant) or image set (second variant).</p>
*
* @param images Image set.
* @param keypoints Input collection of keypoints. Keypoints for which a
* descriptor cannot be computed are removed and the remaining ones may be
* reordered. Sometimes new keypoints can be added, for example:
* <code>SIFT</code> duplicates a keypoint with several dominant orientations
* (for each orientation).
* @param descriptors Computed descriptors. In the second variant of the method
* <code>descriptors[i]</code> are descriptors computed for a <code>keypoints[i]</code>.
* Row <code>j</code> is the <code>keypoints</code> (or <code>keypoints[i]</code>)
* is the descriptor for keypoint <code>j</code>-th keypoint.
*
* @see <a href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_extractors.html#descriptorextractor-compute">org.opencv.features2d.DescriptorExtractor.compute</a>
*/
   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);
       Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
       return;
   }