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)