Touseefelahi / GigeVision

Simple GigeVision implementation, GVSP, GVCP protocol implemented
97 stars 31 forks source link

StreamReceiver OpenCV RGB Images #120

Closed blauertee closed 1 month ago

blauertee commented 1 month ago

Is it possible to receive RGB Images via the OpenCV StreamReceiver? Since the Mat constructor is hardcoded with channels = 1 it seems like not out of the box.

I don't really get why this:

GvspInfo.BytesPerPixel = (int)Math.Ceiling((double)(singlePacket[21] / 8));

always returns one even, though PxelFormat is BayerRG8.

Thanks in Advance!

Touseefelahi commented 1 month ago

BayerRG8 is sort of encoding RGB pixels in to 1 byte of either R/G/B depending on Row and Column. Simplest way would be to get the BayerRG image and convert using opencv function.

read about it here: https://www.1stvision.com/cameras/IDS/IDS-manuals/en/basics-raw-bayer-pixel-formats.html

blauertee commented 1 month ago

Thank's!