tomtao / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

OpenCV error when tried to use cv SURF #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I tried to create a simple sample using cv SURF feature but got the
following error. Could you take a look what I did wrong or provide a simple
example how to use cv SURF function? Thanks.

OpenCV Error: Assertion failed (CV_MAT_TYPE(img->type) == CV_8UC1) in
unknown function, file ..\..\..\..\ocv\opencv\src\cv\cvsurf.cpp, line 698

Here is the junit test I tried to run:

    @Test
    public void shouldRetrieveSURFPoint() throws Exception {
        ObjectFinder finder = new ObjectFinder(cvLoadImage("lily.jpg"));
        Settings setting = finder.getSettings();
        assertNotNull(setting);
    }

Original issue reported on code.google.com by bambo...@gmail.com on 25 May 2010 at 3:36

GoogleCodeExporter commented 9 years ago
This means the image type needs to be CV_8UC1. To load the file lily.jpg this 
way,
you can call cvLoadImage("lily.jpg", 0) instead. The 
acquireRoiFromObjectFinder()
method of the TrackingWorker class in ProCamTracker contains a simple example:
http://code.google.com/p/javacv/source/browse/trunk/procamtracker/src/name/audet
/samuel/procamtracker/TrackingWorker.java#295

Samuel

Original comment by samuel.a...@gmail.com on 25 May 2010 at 3:42

GoogleCodeExporter commented 9 years ago
Thanks a lot for the prompt response. I tried with cvLoadImage("lily.jpg", 0) 
and it
worked. I'll take a look at your sample code to get more detail information. 
Thanks
again for the great work.

Original comment by bambo...@gmail.com on 25 May 2010 at 4:00