2013-04-30 08:00:44 -0600 | received badge | ● Teacher (source) |
2013-04-30 05:08:14 -0600 | commented answer | compareHist problem, type != CV_32F You're right that both matrices need to be of type CV_32F - however, the method that the compareHist function (currently) uses to check this is flawed. The test H1.type() == CV_32F will return false if the matrix is stored as e.g. a 2D, n-channel matrix. If n was 3, then H1.type() would be CV_32FC3, and CV_32FC3 != CV_32F. Hence my pull request to change to use H1.depth() - this will return CV_32F even if it is a multi-channel matrix. This bug would only be seen if you're using a histogram stored as a multi-channel cv::Mat - which is only the case for histograms of greater than 2 dimensions. I think your suggestion might indeed be the answer to the original post, though - having a matrix of the wrong type is a more likely scenario - so I'll upvote this. |
2013-04-30 00:15:46 -0600 | received badge | ● Necromancer (source) |
2013-04-29 13:03:46 -0600 | received badge | ● Editor (source) |
2013-04-29 12:21:43 -0600 | received badge | ● Supporter (source) |
2013-04-29 12:21:04 -0600 | answered a question | compareHist problem, type != CV_32F I've come across the same problem using the but I think that EDIT: I've sent a pull request to change |