From what I know, OpenCV handles 8, 16, and 32 bit images correctly.
depending on what you want to do, you should
- or converting your 12-bit image to 8 bits (provided that it is a 12-bit encoded image with a buyer)
- or convert it manually to 16, filling the values ββwith zeros. From what I found here , this could already be done in your image.
I would advise you to take a closer look at how your pixels fit exactly in your image before doing anything. This will help you know better which is better. A good way to do this is to use bless or another hex editor.
EDIT:
Taken from here , your data (I think) is encoded more than 16 bits with the addition
Just convert from 16 bits to 8 bits using Opencv, you should do the trick, as this is done when converting to JPEG. Have you at least tried?
source share