Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample 1: How to use SURF to extract features #45

Closed
GoogleCodeExporter opened this issue Oct 26, 2015 · 8 comments
Closed

Sample 1: How to use SURF to extract features #45

GoogleCodeExporter opened this issue Oct 26, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

Because I believe that examples are the easiest way how to use JavaCV, I am 
sending a sample of running SIFT on images.

In the attached code I am sending en example how to use OpenCV surf to extract 
features from an image.

What steps will reproduce the problem?
1. Compile and run the code

What is the expected output? What do you see instead?
Obtaining information about point of interest.

It would be nice to extend the code so we can:
1) Extract points of interest. The code in C is the following:

CvSeqReader img_reader =  new CvSeqReader();
cvStartReadSeq( imageDescriptors, img_reader, 0 );
for (int i = 0; i < imageDescriptors.size(); i++) {
    float descriptor = (float) img_reader.ptr;
    CV_NEXT_SEQ_ELEM(img_reader.seq.elem_size, img_reader);
    memcpy(img_ptr, descriptor,
        length * com.sun.jna.Native.getNativeSize(Float.class));
        img_ptr += length;
}

2) make the whole example functional as in find_obj.cpp 
(https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/find_obj.cpp?re
v=2270).
The code to be fixed is commented at the moment.

What version of the product are you using? On what operating system?
This should work under all the version and operating systems


Original issue reported on code.google.com by burge...@gmail.com on 21 Jan 2011 at 9:21

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for the samples! Although for SURF I had already done something named 
ObjectFinder:
http://code.google.com/p/javacv/source/browse/trunk/javacv/src/com/googlecode/ja
vacv/ObjectFinder.java

In any case, I'm thinking to start adding samples like those that people send 
me in a separate samples folder in future releases..

Original comment by samuel.a...@gmail.com on 29 Jan 2011 at 12:49

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Latest version includes some samples, but given that JavaCV already comes with 
a working ObjectFinder, I will leave this incomplete sample out of them.

Original comment by samuel.a...@gmail.com on 19 Feb 2011 at 3:54

  • Changed state: WontFix

@GoogleCodeExporter
Copy link
Author

Can you please explain whether this code example can use with new javacv 
package because when I try to execute it throws compile errors regarding the 
symbol can not find errors

for example
                CvSeq imageKeypoints = new CvSeq();
                CvSeq imageDescriptors = new CvSeq();
                CvSURFParams params = cvSURFParams(500, 1);

                cvExtractSURF(image, null, imageKeypoints.pointerByReference(),imageDescriptors.pointerByReference(), storage,params.byValue(), 0);

In this code line I can't get the pointerByReference(), .byValue() methods, 
could you please explain me the reason for that.
 can you please explain what is the reason for that ?

Original comment by lbnnir...@gmail.com on 20 Jun 2012 at 12:45

@GoogleCodeExporter
Copy link
Author

I'm using opencv_2.4.2 and javaCV_0.2 but the SurfExample.java  file is not 
working. though I'm a newbie with javaCV here! Any help would be appreciated.

Original comment by ase...@gmail.com on 7 Mar 2013 at 6:57

@GoogleCodeExporter
Copy link
Author

hello I have the same problem with the same mistakes, I am also newbie it seems 
SurfExample.java file is incomplete .. I need help .. could someone help me 
make it work?

Original comment by elpitbu...@gmail.com on 1 Jul 2013 at 5:07

@GoogleCodeExporter
Copy link
Author

Please refer to ObjectFinder.java instead:
http://code.google.com/p/javacv/source/browse/src/main/java/com/googlecode/javac
v/ObjectFinder.java

Original comment by samuel.a...@gmail.com on 15 Jul 2013 at 1:36

@GoogleCodeExporter
Copy link
Author


I am using the code of objectFinder.java at link provided in above comment. But 
the Following line is giving me error(in class settings). I am using the latest 
version of opencv, i.e 2.4.8 and also the latest version of javacv, i.e. 0.7.
CvSURFParams parameters=cvSURFParams(500,1);

Original comment by mehul18...@gmail.com on 27 Jan 2014 at 4:31

@GoogleCodeExporter
Copy link
Author

Where can I find the OpenCV implementation for SURF?

Original comment by andra.du...@gmail.com on 7 Jun 2015 at 8:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant