OV7251 RAW10 format
-
Hello I have a MSU-M0014-1-01(OV7251) and I'm trying to determine what would be required to get RAW10 frames.
From what I've investigated the voxl-camera-server will either way trim the buffer received from the lower layer to RAW8.
When doing the initial stream configuration for the preview stream HAL_PIXEL_FORMAT_RAW10 is passed to the lower layer. But even with this step the received data is still in RAW8 format.
This leads me to believe that the actual supported format by the low level driver is RAW8, and this is chosen to begin with as being the only option.If this is not the case and the sensor operates as RAW10, where exactly along the way is this trimming performed and how can this be adjusted to obtain RAW10 frames?
I hope someone can help with some info or documentation.
-
@Gicu-Panaghiu said in OV7251 RAW10 format:
Hello I have a MSU-M0014-1-01(OV72
The function that converts to RAW10 can be found here
The check for RAW10 is here
-
Hello @Gicu-Panaghiu,
I am going to assume you are using VOXL1, since you did not specify..
We do have RAW8 and RAW10 support for OV7251. The selection of the format has to be done in several places.
First, you have to select the correct camera driver, specifically..
ls /usr/lib/libmmcamera_ov7251*.so /usr/lib/libmmcamera_ov7251.so /usr/lib/libmmcamera_ov7251_8bit.so /usr/lib/libmmcamera_ov7251_hflip_8bit.so /usr/lib/libmmcamera_ov7251_rot180_8bit.so /usr/lib/libmmcamera_ov7251_vflip_8bit.so
there are 5 options and one of them is
_8bit.so
which means it will natively ouptput 8bit data (all others output 10 bit data).the driver name, such as
ov7251_8bit
has to be the sensor name<SensorName>ov7251_8bit</SensorName>
in/system/etc/camera/camera_config.xml
.You can check
camera_config.xml
for what sensor library is used for your OV7251.When you run
voxl-configure-cameras
script, it will actually copy one of the default camera_config.xml that are set up for a particular use case, and I believe it will indeed select the8bit
one - this was done to save cpu cycles needed to convert 10bit to 8bit, since majority of the time only 8bit pixels are used.Now, you mentioned that
HAL_PIXEL_FORMAT_RAW10
is passed to the stream config and unfortunately this does not have any effect on what the driver outputs. If the low level driver (e.g. libmmcamera_ov7251_8bit.so) is set up to output RAW8, it will output RAW8 if you request eitherHAL_PIXEL_FORMAT_RAW8
orHAL_PIXEL_FORMAT_RAW10
.So if you update the camera_config.xml to the 10bit driver and just keep the
HAL_PIXEL_FORMAT_RAW10
in the stream config (thensync
andreboot
), you should be getting a 10 bit RAW image from the camera. But since the camera server is currently expecting 8 bit image, if you just interpret the image as 8 bit, it will appear garbled, so you will need to handle the 10 bit image (decide what you want to do with it) in the camera server. -
@Alex-Kushleyev thanks for the detailed response.
Sorry for not specifying, I am on a VOXL2.
Under /usr/lib what is available at the moment isBinary file /usr/lib/camera/com.qti.sensor.ov7251.so matches Binary file /usr/lib/camera/com.qti.sensor.ov7251_front_left.so matches Binary file /usr/lib/camera/com.qti.sensor.ov7251_front_right.so matches Binary file /usr/lib/camera/com.qti.sensor.ov7251_rear_left.so matches Binary file /usr/lib/camera/com.qti.sensor.ov7251_rear_right.so matches
The only camera_config.xml I have identified is the one within voxl-camera-server.
Since I am configuring the tracking camera, I assume ov7251.so is used which is RAW8.
Is there currently any sensor library on VOXL2 which supports 10bit?Assuming the correct driver is in place, as you mention I would still have to modify and deploy a voxl-camera-server which would:
- Unpack the pixel data
- Pass a image with IMAGE_FORMAT_RAW16 to the pipe with the unpacked data
From what I see in the voxl-logger this format is already supported and I would then obtain 16bit grayscale images.
-
I see.. I am not as experienced with VOXL2 just yet, let me ping @modaltb , perhaps he can comment on the current state and how we might get to the functionality you need.
-
It looks like the ov7251 drivers are setup for 8bit only right now:
<registerAddr>0x30b0</registerAddr> <registerData>0x08</registerData>
At this point we would need to enable this in the drivers, I've added it to our backlog but don't have a time frame at this point to share but intend to try in next release.
-
@modaltb thanks for the response. Hope it will make it in :).