alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

Changing pixel formats. #18

Closed wjun0830 closed 4 years ago

wjun0830 commented 4 years ago

Hello.

There is no available pixel formats that is both compatible with Color and OpenCV.

Can you provide how to convert bayerRG pixel formats to opencv Umat or the image file so i can save the images in color?

NiklasKroeger-AlliedVision commented 4 years ago

Hi and sorry for the long wait.

Which camera model are you using? I was under the impression that vimba should be able to handle the transformation to RGB but currently I unfortunately do not have a color camera handy to test this.

Some research however showed that with cv2.cvtColor(src_image, color_code) you might be able to transform the image with the color code cv2.COLOR_BayerRG2RGB. For a full list of color conversion codes you can check the opencv documentation.

I hope this helps.

wjun0830 commented 4 years ago

I am using GT 1930C and now finally figured out using your python implementation. I think I missed how to control the frame object. Because of that, I couldn't use the cvtColor haha..