Photometrics / PyVCAM

Python3.X wrapper for Photometrics and QImaging PVCAM based cameras
MIT License
36 stars 17 forks source link

Recording coloured images #37

Closed Fabian-dfm closed 9 months ago

Fabian-dfm commented 11 months ago

Dear Sir or Madam,

I would like to know how i can obtain RGB images instead of black/white images with the pyvcam package. The image arrays only have 1 value per pixel and I know that the camera is capable of recording rgb values for each pixel.

Best regards

tomhanak commented 11 months ago

No Photometrics camera provides RGB values for each pixel. The color camera still uses monochromatic sensor with color filter array (CFA) on the sensor. So each pixel has assigned only one color based on Bayer mask. Please read more about it e.g. on wiki.

To get an RGB image, the raw pixels from the camera must go through debayering/demosaicing first. It is quite complex topic, read more e.g. on wiki.

In Python, an OpenCV can be used with cv2.COLOR_Bayer* values, like here.