001
002//
003// This file is auto-generated. Please don't modify it!
004//
005package org.opencv.features2d;
006
007import java.lang.String;
008import java.util.ArrayList;
009import java.util.List;
010import org.opencv.core.Mat;
011import org.opencv.core.MatOfKeyPoint;
012import org.opencv.utils.Converters;
013
014// C++: class javaDescriptorExtractor
015//javadoc: javaDescriptorExtractor
016public class DescriptorExtractor {
017
018    protected final long nativeObj;
019    protected DescriptorExtractor(long addr) { nativeObj = addr; }
020
021
022    private static final int
023            OPPONENTEXTRACTOR = 1000;
024
025
026    public static final int
027            SIFT = 1,
028            SURF = 2,
029            ORB = 3,
030            BRIEF = 4,
031            BRISK = 5,
032            FREAK = 6,
033            AKAZE = 7,
034            OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
035            OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
036            OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
037            OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
038            OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
039            OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
040            OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;
041
042
043    //
044    // C++:  bool empty()
045    //
046
047    //javadoc: javaDescriptorExtractor::empty()
048    public  boolean empty()
049    {
050        
051        boolean retVal = empty_0(nativeObj);
052        
053        return retVal;
054    }
055
056
057    //
058    // C++:  int descriptorSize()
059    //
060
061    //javadoc: javaDescriptorExtractor::descriptorSize()
062    public  int descriptorSize()
063    {
064        
065        int retVal = descriptorSize_0(nativeObj);
066        
067        return retVal;
068    }
069
070
071    //
072    // C++:  int descriptorType()
073    //
074
075    //javadoc: javaDescriptorExtractor::descriptorType()
076    public  int descriptorType()
077    {
078        
079        int retVal = descriptorType_0(nativeObj);
080        
081        return retVal;
082    }
083
084
085    //
086    // C++: static javaDescriptorExtractor* create(int extractorType)
087    //
088
089    //javadoc: javaDescriptorExtractor::create(extractorType)
090    public static DescriptorExtractor create(int extractorType)
091    {
092        
093        DescriptorExtractor retVal = new DescriptorExtractor(create_0(extractorType));
094        
095        return retVal;
096    }
097
098
099    //
100    // C++:  void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
101    //
102
103    //javadoc: javaDescriptorExtractor::compute(image, keypoints, descriptors)
104    public  void compute(Mat image, MatOfKeyPoint keypoints, Mat descriptors)
105    {
106        Mat keypoints_mat = keypoints;
107        compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
108        
109        return;
110    }
111
112
113    //
114    // C++:  void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
115    //
116
117    //javadoc: javaDescriptorExtractor::compute(images, keypoints, descriptors)
118    public  void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors)
119    {
120        Mat images_mat = Converters.vector_Mat_to_Mat(images);
121        List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
122        Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
123        Mat descriptors_mat = new Mat();
124        compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
125        Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
126        keypoints_mat.release();
127        Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
128        descriptors_mat.release();
129        return;
130    }
131
132
133    //
134    // C++:  void read(String fileName)
135    //
136
137    //javadoc: javaDescriptorExtractor::read(fileName)
138    public  void read(String fileName)
139    {
140        
141        read_0(nativeObj, fileName);
142        
143        return;
144    }
145
146
147    //
148    // C++:  void write(String fileName)
149    //
150
151    //javadoc: javaDescriptorExtractor::write(fileName)
152    public  void write(String fileName)
153    {
154        
155        write_0(nativeObj, fileName);
156        
157        return;
158    }
159
160
161    @Override
162    protected void finalize() throws Throwable {
163        delete(nativeObj);
164    }
165
166
167
168    // C++:  bool empty()
169    private static native boolean empty_0(long nativeObj);
170
171    // C++:  int descriptorSize()
172    private static native int descriptorSize_0(long nativeObj);
173
174    // C++:  int descriptorType()
175    private static native int descriptorType_0(long nativeObj);
176
177    // C++: static javaDescriptorExtractor* create(int extractorType)
178    private static native long create_0(int extractorType);
179
180    // C++:  void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
181    private static native void compute_0(long nativeObj, long image_nativeObj, long keypoints_mat_nativeObj, long descriptors_nativeObj);
182
183    // C++:  void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
184    private static native void compute_1(long nativeObj, long images_mat_nativeObj, long keypoints_mat_nativeObj, long descriptors_mat_nativeObj);
185
186    // C++:  void read(String fileName)
187    private static native void read_0(long nativeObj, String fileName);
188
189    // C++:  void write(String fileName)
190    private static native void write_0(long nativeObj, String fileName);
191
192    // native support for java finalize()
193    private static native void delete(long nativeObj);
194
195}