How do I access to raw pixel data through Spinnaker API?
Answered-
Official comment
Accessing Raw Bayer Data Raw image data can be accessed programmatically via Spinnaker Image class. In 8 bits per pixel modes such as BayerRG8, the first byte represents the pixel at [row 0, column 0], the second byte at [row 0, column 1], and so on. Image data always starts in the top left corner of the image.
Spinnaker C++ API
// Assuming image is 640 x 480 resolution. The current pixel format as well as PixelColorFilter indicate the Bayer Tile Mapping for the camera. For example, BayerRG8 is RGGB.
ImagePtr pResultImage = cam.GetNextImage();
unsigned char* data = (unsigned char*)pResultImage->GetData();
// Assuming image is 640 x 480
data[0] = Row 0, Column 0 = red pixel (R)
data[1] = Row 0, Column 1 = green pixel (G)
data[640] = Row 1, Column 0 = green pixel (G)
data[641] = Row 1, Column 1 = blue pixel (B)
The contents above can be found from the knowledge base article Transitioning from FlyCapture2 to Spinnaker SDK.
Please sign in to leave a comment.
Comments
1 comment