I have a Raspberry PI 3 b+ and a TheImagingSource DYK 33GX250 camera. However, when I open the aravis viewer, I can’t change the pixel format “PolarizedBayerGB8” and I can’t stream. How can I change the pixel format? Thanks in advance.
Aravis viewer relies on GStreamer for the conversion from the device pixel format to the display pixel format. I don’t think there is a GStreamer converter for polarized bayer.
After that, I tried to change the pixel format by using a Python code. This is my code:
import numpy as np
from gi.repository import Aravis,GLib
if name == “main”:
if len(sys.argv) > 1:
path = “frame.png”
cam = Camera(None)
frame = cam.pop_frame()
print("Saving image to ", path)
But unfortunately, I got a error:
gi.repository.GLib.GError: arv-gc-error-quark: [PixelFormat] Value 17301515 not found (4)
I can’t figure out what is the problem.
If I have read correctly the camera documentation, it only supports polarized pixel formats. You should be able to verify this point using
arv-tool-0.8 features PixelFormat.
Thanks for your quick response. It turns out that the camera supports only the formats ‘PolarizedBayerBG16’, ‘PolarizedBayerBG12Packed’ and ‘PolarizedBayerBG8’. So, I changed the line cam.set_pixel_format(Aravis.PIXEL_FORMAT_BAYER_BG_8) to cam.set_pixel_format_from_string(‘PolarizedBayerBG8’). Code works but the image is grayscale. Do you have any idea why I get grayscale image instead of a coloured one?
I also tried the line cam.set_feature(‘PixelFormat’,‘PolarizedBayerBG8’) but it did not work either.
Aravis does not convert pixel formats. It is the job of the library you are using to display or save the camera raw data, being either cv2 or gstreamer.
“Polarized” images produced by your camera are very specific, so I guess you have to code a conversion that fits your need.