@Mathieu Barnachon
je réalise un projet android pour la reconnaissance d'un objet connu img1
voici les étapes :
descriptors = new Mat();
keypoints = new MatOfKeyPoint();
detector = FeatureDetector.create(FeatureDetector.ORB);
detector.detect(img1, keypoints);
descriptor = DescriptorExtractor.create(DescriptorExtractor.ORB);
descriptor.compute(img1, keypoints, descriptors);
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
ColorDetection.cvt_YUVtoRGBtoHSV(mYuv,mGraySubmat);
MatOfKeyPoint mKeyPoints = new MatOfKeyPoint();
MatOfDMatch matches = new MatOfDMatch();
detector.detect(mGraySubmat, mKeyPoints);
descriptor.compute(mGraySubmat, mKeyPoints, mIntermediateMat);
Log.i("matches", matches.size()+"");
matcher.match(mIntermediateMat, descriptors, matches);
Log.i("matches", matches.size()+"");
mIntermediateMat2.create(resultSize, CvType.CV_8UC1);
Features2d.drawMatches(img1, keypoints , mGraySubmat, mKeyPoints, matches, mIntermediateMat2);
Imgproc.resize(mIntermediateMat2, mIntermediateMat2, mRgba.size());
Imgproc.cvtColor(mIntermediateMat2, mRgba, Imgproc.COLOR_RGBA2BGRA, 4);
Utils.matToBitmap(mRgba, bmp);
when the last steps Features2d.drawMatches the application is not responding (I tested well) my question is:
when I extract matches (MatOfDMatch) I want to draw just the keypoints of image source in the scene video as shown in this link but I can not translate properly in java
http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html#feature-homography
when I get to the stage of drawing, I just want to draw a square, for example, the object recognition
I think you will have to be more specific about what it is you want to do. Perhaps give an example :)
@ubehagelig Hi, from a video scene (Android) I detect an object and saves it in my database, which amounts to saying using "get the touch begin position (x, y)" and then use methods 'OpenCV to collect this object or its contour.
@Marwen-Z, @Mathieu-Barnachon : This is not a forum, but a Q&A site. That means, one question and some answers. Discutions are not allowed in the Answer. Comments should clarify the question, and any changes to question should be made by editing it. If you have a new, subsequent question, you MUST open a new question.
I agree with sammy. But I also think this site lacks some "visible" guidelines for new users.