All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opencv.features2d.DescriptorExtractor Maven / Gradle / Ivy


//
// This file is auto-generated. Please don't modify it!
//
package org.opencv.features2d;

import java.lang.String;
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.utils.Converters;

// C++: class javaDescriptorExtractor
/**
 * 

Abstract base class for computing descriptors for image keypoints.

* *

class CV_EXPORTS DescriptorExtractor

* *

// C++ code:

* * *

public:

* *

virtual ~DescriptorExtractor();

* *

void compute(const Mat& image, vector& keypoints,

* *

Mat& descriptors) const;

* *

void compute(const vector& images, vector >& keypoints,

* *

vector& descriptors) const;

* *

virtual void read(const FileNode&);

* *

virtual void write(FileStorage&) const;

* *

virtual int descriptorSize() const = 0;

* *

virtual int descriptorType() const = 0;

* *

static Ptr create(const string& descriptorExtractorType);

* *

protected:...

* *

};

* *

In this interface, a keypoint descriptor can be represented as a

* *

dense, fixed-dimension vector of a basic type. Most descriptors follow this * pattern as it simplifies computing distances between descriptors. Therefore, * a collection of descriptors is represented as "Mat", where each row is a * keypoint descriptor.

* * @see org.opencv.features2d.DescriptorExtractor : public Algorithm */ public class DescriptorExtractor { protected final long nativeObj; protected DescriptorExtractor(long addr) { nativeObj = addr; } private static final int OPPONENTEXTRACTOR = 1000; public static final int SIFT = 1, SURF = 2, ORB = 3, BRIEF = 4, BRISK = 5, FREAK = 6, OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT, OPPONENT_SURF = OPPONENTEXTRACTOR + SURF, OPPONENT_ORB = OPPONENTEXTRACTOR + ORB, OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF, OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK, OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK; // // C++: void javaDescriptorExtractor::compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors) // /** *

Computes the descriptors for a set of keypoints detected in an image (first * variant) or image set (second variant).

* * @param image Image. * @param keypoints Input collection of keypoints. Keypoints for which a * descriptor cannot be computed are removed. Sometimes new keypoints can be * added, for example: SIFT duplicates keypoint with several * dominant orientations (for each orientation). * @param descriptors Computed descriptors. In the second variant of the method * descriptors[i] are descriptors computed for a keypoints[i]". * Row j is the keypoints (or keypoints[i]) * is the descriptor for keypoint j"-th keypoint. * * @see org.opencv.features2d.DescriptorExtractor.compute */ public void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors) { Mat keypoints_mat = keypoints; compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj); return; } // // C++: void javaDescriptorExtractor::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors) // /** *

Computes the descriptors for a set of keypoints detected in an image (first * variant) or image set (second variant).

* * @param images Image set. * @param keypoints Input collection of keypoints. Keypoints for which a * descriptor cannot be computed are removed. Sometimes new keypoints can be * added, for example: SIFT duplicates keypoint with several * dominant orientations (for each orientation). * @param descriptors Computed descriptors. In the second variant of the method * descriptors[i] are descriptors computed for a keypoints[i]". * Row j is the keypoints (or keypoints[i]) * is the descriptor for keypoint j"-th keypoint. * * @see org.opencv.features2d.DescriptorExtractor.compute */ public void compute(List images, List keypoints, List descriptors) { Mat images_mat = Converters.vector_Mat_to_Mat(images); List keypoints_tmplm = new ArrayList((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; } // // C++: static javaDescriptorExtractor* javaDescriptorExtractor::create(int extractorType) // /** *

Creates a descriptor extractor by name.

* *

The current implementation supports the following types of a descriptor * extractor:

*
    *
  • "SIFT" -- "SIFT" *
  • "SURF" -- "SURF" *
  • "BRIEF" -- "BriefDescriptorExtractor" *
  • "BRISK" -- "BRISK" *
  • "ORB" -- "ORB" *
  • "FREAK" -- "FREAK" *
* *

A combined format is also supported: descriptor extractor adapter name * ("Opponent" -- "OpponentColorDescriptorExtractor") + descriptor * extractor name (see above), for example: "OpponentSIFT".

* * @param extractorType a extractorType * * @see org.opencv.features2d.DescriptorExtractor.create */ public static DescriptorExtractor create(int extractorType) { DescriptorExtractor retVal = new DescriptorExtractor(create_0(extractorType)); return retVal; } // // C++: int javaDescriptorExtractor::descriptorSize() // public int descriptorSize() { int retVal = descriptorSize_0(nativeObj); return retVal; } // // C++: int javaDescriptorExtractor::descriptorType() // public int descriptorType() { int retVal = descriptorType_0(nativeObj); return retVal; } // // C++: bool javaDescriptorExtractor::empty() // public boolean empty() { boolean retVal = empty_0(nativeObj); return retVal; } // // C++: void javaDescriptorExtractor::read(string fileName) // public void read(String fileName) { read_0(nativeObj, fileName); return; } // // C++: void javaDescriptorExtractor::write(string fileName) // public void write(String fileName) { write_0(nativeObj, fileName); return; } @Override protected void finalize() throws Throwable { delete(nativeObj); } // C++: void javaDescriptorExtractor::compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors) private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj); // C++: void javaDescriptorExtractor::compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors) private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj); // C++: static javaDescriptorExtractor* javaDescriptorExtractor::create(int extractorType) private static native long create_0(int extractorType); // C++: int javaDescriptorExtractor::descriptorSize() private static native int descriptorSize_0(long nativeObj); // C++: int javaDescriptorExtractor::descriptorType() private static native int descriptorType_0(long nativeObj); // C++: bool javaDescriptorExtractor::empty() private static native boolean empty_0(long nativeObj); // C++: void javaDescriptorExtractor::read(string fileName) private static native void read_0(long nativeObj, String fileName); // C++: void javaDescriptorExtractor::write(string fileName) private static native void write_0(long nativeObj, String fileName); // native support for java finalize() private static native void delete(long nativeObj); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy