jloyd / javacv

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

SurfDescriptorExtractor.compute() fails due to unknown array type #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
public void findDescriptors(BufferedImage initialFrame) {
        IplImage targetImage = IplImage.createFrom(initialFrame);
        SurfDescriptorExtractor extractor = new SurfDescriptorExtractor();
        KeyPoint keypoints = new KeyPoint();
        CvMat descriptors = new CvMat();
        extractor.compute(targetImage, keypoints, descriptors);
        ...
}

OpenCV Error: Bad argument (Unknown array type) in cvarrToMat, file 
/home/naveg/Downloads/OpenCV-2.3.0/modules/core/src/matrix.cpp, line 641
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/naveg/Downloads/OpenCV-2.3.0/modules/core/src/matrix.cpp:641: error: (-5) Unknown array type in function cvarrToMat

targetImage is 8 bit, single channel grayscale, as expected by the SURF 
extractor. The test of IS_IMAGE in matrix.cpp is evidently failing, and I'm not 
sure why. Perhaps JavaCV is not setting up the IplImage header properly?

Original issue reported on code.google.com by evangold...@gmail.com on 14 Jul 2011 at 5:39

GoogleCodeExporter commented 9 years ago
The problem is not your image, it's your "descriptors" variable. You need to 
initialize it to something like "null", as explained in the README.txt file. 
This is *not* an /issue/ of JavaCV. Please post questions on the mailing list 
the next time. Thank you

Original comment by samuel.a...@gmail.com on 16 Jul 2011 at 4:08