LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   openCV: Assertion failed (https://www.linuxquestions.org/questions/linux-newbie-8/opencv-assertion-failed-4175557797/)

alishba 11-02-2015 01:18 PM

openCV: Assertion failed
 
I am using opencv for image processing, while comparing images by using command compareHist i am getting the following error:

OpenCV Error: Assertion failed (H1.type() == H2.type() && H1.type() == CV_32F) in compareHist, file /home/alishba/opencv-2.4.9/modules/imgproc/src/histogram.cpp, line 1985
terminate called after throwing an instance of 'cv::Exception'
what(): /home/alishba/opencv-2.4.9/modules/imgproc/src/histogram.cpp:1985: error: (-215) H1.type() == H2.type() && H1.type() == CV_32F in function compareHist

Aborted (core dumped)

Demosa 11-02-2015 03:08 PM

So programming questions are probably not in this section (honestly, openCV has little to do with linux as it is multiplatform), but I did a little openCV work back in grad school, so lets go for it

We have nothing to work with here. What we need to see to be able to look into anything is your code, specifically related to how you call the function and initialize the arrays for
Code:

double cv::compareHist( InputArray _H1, InputArray _H2, int method )
The error it is throwing is your side, your images that you are trying to compare with a histogram are not passing that assertion that they are both type CV_32F (error 215 means failed assertion)


All times are GMT -5. The time now is 02:52 AM.