Reputation: 63
I'm using EmguCV Matrix.Add method to append one matrix to another matrix.
Emgu.CV.Matrix<float> descriptors = new Emgu.CV.Matrix<float>(0, dictionarySize);
Emgu.CV.Matrix<float> BOWDescriptor = imageDescriptorExtractor.Compute(trainingImage, keyPoints);
descriptors.Add(BOWDescriptor);
The corresponding OpenCV code is given below:
Mat bowDescriptor(0, dictionarySize, CV_32FC1);
Mat bowDescriptor;
bowDE.compute(img, keypoints, bowDescriptor);
descriptors.push_back(bowDescriptor);
During compilation, I will not get any exception. But, when running the app I get the following error:
An unhandled exception of type 'Emgu.CV.Util.CvException' occurred in Emgu.CV.dll Additional information: OpenCV: Unknown array type
Does this have something to do with CV_32FC1 data type? Is my OpenCV to EmguCV conversion correct?
Appreciate your help on this.
Thanks Jay
Upvotes: 0
Views: 1634
Reputation: 1088
CV_32FC1 just means a single channel, 32-bit floating point array, and since you can't have zero channels, the default Matrix constructor should be fine.
Have you tried putting a breakpoint on your "Add" call and examining the two matrices? I'm not sure when EmguCV throws that exception, but perhaps there is a mismatch in the matrix sizes.
Also, I just noticed that your constructor for the "descriptors" object has 0 rows; was this a typo?
Upvotes: 1