Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

According to the docu, equalizeHist doesn't change the image-format, however, the docu doesn't state if it works in-place or not, so please try it this way:

cv::Mat tmp;
equalizeHist(img_1, tmp);
img_1 = tmp;

Also note, that your image must be in grayscale - is that the case?

If this doesn't help, one other idea comes to my mind: Have you checked if you get keypoints from your equalized image at all? If not, descriptors_1 may get empty and you'll probably get such an error.

According to the docu, equalizeHist doesn't change the image-format, however, the docu doesn't state if it works in-place or not, so please try it this way:

cv::Mat tmp;
equalizeHist(img_1, tmp);
img_1 = tmp;

Also note, that your image must be in grayscale - is that the case?

If this doesn't help, one other idea comes to my mind: Have you checked if you get keypoints from your equalized image at all? If not, descriptors_1 may get will be empty and you'll probably get such an error.