Industrial Cameras FAQ/ Color image converted from ca...

Color image converted from camera raw image shows inappropriate color. (No.1519)

If user application converts camera raw image to BGR or BGRA format image specifying Bayer type PixelFormat shown in instruction manual of the camera as source image PixelFormat, the output image may show inappropriate color when ReverseX or ReverseY feature is enabled.

There are 4 kinds of filter layout, GR, RG, GB, and BG layout, in bayer color filter. The following layout is BG layout.

BGBGBGBGBGBG
GRGRGRGRGRGR
BGBGBGBGBGBG
GRGRGRGRGRGR
BGBGBGBGBGBG
GRGRGRGRGRGR

When Bayer type PixelFormat is selected, camera will output each pixel value as is.
Camera instruction manual shows PixelFormat value when ReverseX and ReverseY feature is disabled.

When ReverseX or ReverseY feature is enabled, the order of pixel values output from the camera is changed, which means that type of Bayer type PixelFormat is changed. User application can read PixelFormat corresponding to current ReverseX and ReverseY setting from PixelFormat register.

Camera will send PixelFormat information of the sending image in leader block of image stream. User application can get PixelFormat value of a received image from uiPixelFormat member of CAM_IMAGE_INFO structure.

User application cam get CAM_IMAGE_INFO structure as an argument of Strm_ReadCurrentImage() or Strm_LockBuffer() function when user application uses High-Level streaming API. When user application uses Low-Level streaming API, Strm_GetStrmReqInfo() is available for getting CAM_IMAGE_INFO structure from StreamRequest object obtained with Strm_DequeueRequest().

Using PixelFormat value obtained from CAM_IMAGE_INFO structure or PixelFormat value read out from the camera in converting Bayer type camera raw image is recommended to avoid getting inappropriate color image.

back

Was this FAQ helpful?

Please let us know your opinion about the FAQ so that we will be able to improve our FAQ. (Within 800 characters)
Note: If you need a reply to your inquiry (e.g. inquiry about products), please use the inquiries form provided on Contact Us page. Please note that we cannot answer to your questions filled in below.

Please click below to change the cookie settings used on our website.