-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Enhance camera fixture test #79337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance camera fixture test #79337
Conversation
8e41216 to
cce2332
Compare
|
I am still new to tests and samples, and try to find the balance between the two regarding this which I stumbled upon the other day:
This is the first time I read about it, so might be quoting the wrong thing: it still sounds like a very comprehensive way to test the capture sample itself. What a nice way to automatically test almost every video system! |
josuah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also looks much like what the display driver sample does:
https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/display/src/main.c#L35-L41
Using the same CONFIG_TEST
https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TEST
Very glad to have this color conversion code at hand! Great universal sensor text fixture!
By testing the middle of the bars, this should be plenty robust for a wide range of image sensors, and tel whether the image arrived correctly or not.
cce2332 to
0b36788
Compare
=> In fact, I used the |
|
@hakehuang Could you help review this ? |
|
I just came upon this library part of Zephyr project, and it features color conversion functions: Not sure how fit it is for a simple colorbar test like here though. There might be a few color conversion utilities needed by various drivers. For instance, video controls that are too low-level and hardware-specific to be exposed, requiring some light math and color conversion to be exposed as CIDs. 🤔 For another PR! |
|
@josuah : thanks ! Unfortunately, I went through this zscilib but didn't find an rgb_to_cielab function so that it could be used here. |
Add mimxrt1170_evk@B to test platforms. Signed-off-by: Phi Bang Nguyen <[email protected]>
The logs that the fixture test are based on are not printed anymore due to recent changes from "printk" to "LOG_DBG". Change the log level so that it can work again. Remove "Capture started" as it is not a relevant test regex. Logs are sometimes not correctly printed in the console, for example, we can see: DEBUG - DEVICE: muart:~$ [mapture started As "Capture started" is a one-time log, fixture test will then fail due to timeout. Also, consolidate other regex. Signed-off-by: Phi Bang Nguyen <[email protected]>
Currently, the camera fixture test can only tell whether data are dumped onto memory. This is to check further if the image content is correct. The algorithm is rather simple: compare the average color of each bar of a generated pattern with a predefined target in CIELAB76 color space (which is nearly perceptually uniform). Signed-off-by: Phi Bang Nguyen <[email protected]>
0b36788 to
a9afd67
Compare
|
Rebased as #76144 was merged |
josuah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a first step before hardware-in-the-loop twister tests:
https://docs.zephyrproject.org/latest/develop/test/twister.html#running-tests-on-hardware
But for now, the video test infrastructure is not there:
https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/video
Just a build-all target:
https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/drivers/build_all/video
Is it meant to become a ztest in tests/ once the video test infrastructure is there or is this meant to stay in samples/?
+1 as before video tests are ready, this is the only way to integrate this code.
P.S.: not sure why I thought this was the SMPTE test pattern... 😅
I am not expert in test and don't know how it will be changed in the future. But IMO, this (camera fixture test) is totally based on the code of the sample and is used to test the sample (although it can reveal problems in the camera drivers) so it should be here. It's not the special case for video as we can see in other samples, there are often / always a |
This is added via PRs zephyrproject-rtos#79337 and zephyrproject-rtos#79263 to automatically check if a colorbar pattern generated by a camera pipeline is correct or not. Signed-off-by: Phi Bang Nguyen <[email protected]>
This is added via PRs #79337 and #79263 to automatically check if a colorbar pattern generated by a camera pipeline is correct or not. Signed-off-by: Phi Bang Nguyen <[email protected]>
This PR enhances the current camera fixture testcase.