I have captured a 12bit image from a camera (and converted it to 16bit for openCV) I use the pylon library, because I have a basler camera:
camera.PixelFormat.SetValue(PixelFormat_Mono12);
formatConverter.OutputPixelFormat = PixelType_Mono16;
With this 12bit image I want to do some calculating stuff. For displaying this image I just converted this image to 8bit by using:
image16bit.convertTo(image8bit, CV_8U);
But now this image is very noisy (image1) image1-noisy-12bit
When I capute a native 8bit image, then this image is not noisy (image2) image 2 -notnoisy-8bit.
Can someone explain, why this happens and how to convert the 12bit image to 8bit without this noise?