title: Contrast stretching an image by openCV
body: <p>I'm trying to stretch the contrast of an image to the range of 0-255 using cvNormalize. But when I print out the output pixel values, Some negative numbers appear as the pixel value. I appreciate if you help me find out where the origin of the problem is. This is the code:</p>
  
  <pre><code>cvNormalize(srcImage, dstImage, 0, 255, CV_MINMAX );
  
  for ( int pixel = 0; pixel &lt; dstImage-&gt;height * dstImage-&gt;width; pixel++ ) {
      printf("%d\t",*(dstImage-&gt;imageData + pixel));
  }
  </code></pre>