c++cameraimage-formats

how to get bayer image without converting to RGB in pylon?


I want to get a Bayer format image from Basler Camera using C++. I set pixel-format to BayerBG8 (for example) and the camera can save image data. The image data is in ptrGrabResult of type CGrabResultPtr but how can I access to pixels value? Using a convertor, the data convert to a pylon RGB image and is available, but how to get Bayer image without converting to RGB in pylon?


Solution

  • Use the GetArray() method for that, so something like ptrGrabResult->GetArray(); should work for you.