Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

no, not a bug, more an expectation mismatch.

opencv expects floating point images in the [0..1] range for drawing, so if your image iss [0..255] it will show up all white.

depending on what you need in your calculations, you can either apply a scale factor with convertTo() or just scale(divide) it for drawing, like:

imshow("IM", image / 255);

no, not a bug, more an expectation mismatch.

opencv expects floating point images in the [0..1] range for drawing, so if your image iss [0..255] it will show up all white.

depending on what you need in your calculations, you can either apply a scale factor with convertTo() or just scale(divide) it for drawing, like:

imshow("IM", image / 255);

(it's actually imshow(), which does some magic here (by pre-multiplying float imgs with 255, so you sometimes have to compensate that))