Hello, we are currently trying to integrate our NXP i.MX8MP’s ISP into the camera pipeline of an IMX327 image sensor. The drivers implementation is based upon a driver example for the IMX219 image sensor.
This example originates from NXP’s AN13963: i.MX 8M Plus IMX219 Sensor. Sadly the original link to the related Github repository is no longer valid. Luckily a community member made a backup of the original repo, so that all the required sources are available.
Using this example (and others scattered around the NXP Community forums) we were able to implement a first revision of our IMX327 ISP driver, build it (using Yocto) and deploy it onto a development board.
The general image pipeline seems to be up and running with this driver. There is clearly correct image data from the sensor in the resulting images. However, the image stream deteriorates quite significantly over the span of a few images. After one or two seconds there seems to only be random noise in all color channels left.
./video_test -w 1920 -h 1080 -f RAW10 -t file -m 0 -d 2
The following images show the first 4 frames obtained via video_test with the -t file output type. The original .raw files are contained in the attachments (see raws.zip).
video_test_image_3.png
video_test_image_4.png
The first image (video_test_image_1.png) does show a noisy but relatively clear image of the captured scene. The second image is already unrecognizable and from the third image onwards there is only random noise left.
gst-launch-1.0 -v v4l2src device=/dev/video2 ! "video/x-raw,format=YUY2,width=1920,height=1080" ! queue ! imxvideoconvert_g2d ! ximagesink
The attached video gstreamer_video.mp4 shows the start of the gstreamer stream. The quick deterioration can be observed there aswell.
The following screenshots from the video show the deterioration frame by frame:
gstreamer_image_1.jpg
gstreamer_image_2.jpg
gstreamer_image_3.jpg
gstreamer_image_4.jpg
gstreamer_image_5.jpg
gstreamer_image_6.jpg
gstreamer_image_7.jpg
It appears to me that there is an issue during the debayering phase in the ISP. The sensors color information seems to not be correctly processed by the ISP.
My assumption is, that some part of the ISP pipeline is not configured correctly yet. There is a high chance of that being the case since all of the sensor specific configuration data was copied over from the IMX219. The idea was to first get the ISP pipeline running somehow using the IMX219’s config data and to then tune the image quality via the calibration XML file.
A first attempt at improving the image quality using the vvext tool proved only somewhat successful. No clear detail can be made visible, only rough outlines:
vvext settings:
FPS: 1
BLS: 0, 0, 0, 0
DEMOSAIC: normal
DPCC: enabled
HDR: 3, 16.0
DWE, AEC, AWB, AF, LSC, CPROC, GAMMA, FILTER, CAC, CNR, DPF and WDR3 disabled
After these improvements it still looks like there is something wrong with the debayering process.
For completeness, the attached zip logs.zip contains all the logs produced by the example applications.
Contents:
Has anyone seen this kind of behaviour before? Any hints or pointers as to why the debayering seems to be failing would be greatly appreciated.
If there is any additional information I can provide to aid in finding this issue, please let me know.
解決済! 解決策の投稿を見る。
Update: I was able to solve the issue, or at least identify it. The issue was the ISP trying to set the exposure and gain. Once I disabled it (comment out IOCTLs VVSENSORIOC_S_EXP, VVSENSORIOC_S_VSEXP, VVSENSORIOC_S_GAIN and VVSENSORIOC_S_VSGAIN) I received proper images via gstreamer:
I assume the calibration data in the .xml specifies a target value for the image quality (e.g. contrast level or median brightness). The ISP then presumably tries to optimze the image towards this target state using exposure and gain.
However I do not yet have proper calibration data for the IMX327 sensor. The calibration data I used was copied over from the IMX219 example of AN13963. Therefore the target value probably does not make sense for the IMX327 sensor.
The ISP then tries to reach an unreachable state via the setting of exposure and gain making the image quality and noise level increasingly worse.
Of course the proper fix for this problem is to produce/obtain sensor specific calibration data. That way the target state fits the IMX327 sensor.
Update: I was able to solve the issue, or at least identify it. The issue was the ISP trying to set the exposure and gain. Once I disabled it (comment out IOCTLs VVSENSORIOC_S_EXP, VVSENSORIOC_S_VSEXP, VVSENSORIOC_S_GAIN and VVSENSORIOC_S_VSGAIN) I received proper images via gstreamer:
I assume the calibration data in the .xml specifies a target value for the image quality (e.g. contrast level or median brightness). The ISP then presumably tries to optimze the image towards this target state using exposure and gain.
However I do not yet have proper calibration data for the IMX327 sensor. The calibration data I used was copied over from the IMX219 example of AN13963. Therefore the target value probably does not make sense for the IMX327 sensor.
The ISP then tries to reach an unreachable state via the setting of exposure and gain making the image quality and noise level increasingly worse.
Of course the proper fix for this problem is to produce/obtain sensor specific calibration data. That way the target state fits the IMX327 sensor.
I have mailed to you, pls check it
Dear @joanxie ,
I got following color issue with the 2nd camera pipeline, even if it was the only launched pipeline :
The good image (from the fist pipeline) should be as below :
Have you ever noticed similar issue? Knowing that we are using the LF6.1.36-2.1.0 release.
Thanks and best regards,
Khang