I am trying to stretch the contrast of an image in the range of 0-255 using cvNormalize. But when I print the output pixel values, some negative numbers display as the pixel value. I appreciate if you can help me figure out where the problem arose. This is the code:
cvNormalize(srcImage, dstImage, 0, 255, CV_MINMAX );
for ( int pixel = 0; pixel < dstImage->height * dstImage->width; pixel++ ) {
printf("%d\t",*(dstImage->imageData + pixel));
}
source
share