1

I was wondering if there is a way to force an Image to load as 8U. I saw at the OpenCV Documentation that you can specify whether to load an Image as Single or Three Channel, but nothing is mentioned about the Color Depth. Any suggestions?

Thanks for your help!!! :D

someone
  • 361
  • 2
  • 3
  • 13

1 Answers1

1

The default colour depth for imread() is 8U, and presumably cvLoadImage() is the same. Have you considered using the newer, more user-friendly C++ interface to OpenCV, which uses Mat and imread()?

1''
  • 26,823
  • 32
  • 143
  • 200
  • Yes, I know it's much better. My whole application is written in C, though... As about the answer, will it load for sure as `8U`? Because I am accessing the Image Data directly in my code (I don't use CvScalar) and any changes may ruin everything... :D – someone Aug 13 '13 at 15:02
  • 1
    Yes, I'm sure. To use integers, floats and doubles instead of uchars, you need to convert explicitly. – 1'' Aug 13 '13 at 15:05