Skip to content
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

T-Display S3 PRO w/ OV5640: lots of QUIRC error ECC failure when scanning QR on computer screens #190

Open
totallynarwhal opened this issue Dec 9, 2024 · 1 comment

Comments

@totallynarwhal
Copy link

totallynarwhal commented Dec 9, 2024

After applying fix for #183, I found that the OV5640 still has a hard time scanning QR codes from computer screens.

Logs shows a lots of QUIRC error due to ECC failure.

Logs:

�clogXBI (1876) ./main/camera.c: 236: CAMERA_IMAGE_WIDTH: 640
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogXCI (1876) ./main/camera.c: 237: CAMERA_IMAGE_HEIGHT: 480
�clogXEI (1876) ./main/camera.c: 238: UI_CAMERA_IMAGE_WIDTH: 480
�clogXFI (1876) ./main/camera.c: 239: UI_CAMERA_IMAGE_HEIGHT: 640
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogX@I (1876) ./main/camera.c: 240: UI_DISPLAY_WIDTH: 336
�clogXAI (1876) ./main/camera.c: 241: UI_DISPLAY_HEIGHT: 222
�clogXJI (1876) ./main/camera.c: 242: DISPLAY_IMAGE_SCALE_FACTOR: 66%
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogXCI (1876) ./main/camera.c: 243: DISPLAY_IMAGE_WIDTH: 320
�clogXDI (1876) ./main/camera.c: 244: DISPLAY_IMAGE_HEIGHT: 222
�clogX5I (1876) ./main/camera.c: 245: XOFFSET: 0
...
�clogXHI (55466) ./main/qrmode.c: 1709: Scanning/posting 'pin' data
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogX;I (55466) ./main/qrscan.c: 186: SCAN WIDTH: 353
�clogX<I (55466) ./main/qrscan.c: 187: SCAN HEIGHT: 353
�clogXqI (55466) ./main/sensitive.c: 89: Setting sens stack tls pointer to 0x3c2a9d40 for task 'jade_camera'
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogXCI (55466) ./main/camera.c: 236: CAMERA_IMAGE_WIDTH: 640
�clogXDI (55466) ./main/camera.c: 237: CAMERA_IMAGE_HEIGHT: 480
�clogXFI (55466) ./main/camera.c: 238: UI_CAMERA_IMAGE_WIDTH: 480
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogXGI (55466) ./main/camera.c: 239: UI_CAMERA_IMAGE_HEIGHT: 640
�clogXAI (55466) ./main/camera.c: 240: UI_DISPLAY_WIDTH: 336
�clogXBI (55466) ./main/camera.c: 241: UI_DISPLAY_HEIGHT: 222
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogXKI (55466) ./main/camera.c: 242: DISPLAY_IMAGE_SCALE_FACTOR: 66%
�clogXDI (55466) ./main/camera.c: 243: DISPLAY_IMAGE_WIDTH: 320
�clogXEI (55466) ./main/camera.c: 244: DISPLAY_IMAGE_HEIGHT: 222
--- Warning: Failed to decode multiple lines in a row. Try checking the baud rate and XTAL frequency setting in menuconfig
�clogX6I (55466) ./main/camera.c: 245: XOFFSET: 0
�clogX8I (55466) ./main/camera.c: 246: YOFFSET: 153
...
�clogXHI (78166) ./main/qrscan.c: 29: Detected 1 QR codes in image.
�clogXHI (78436) ./main/qrscan.c: 29: Detected 1 QR codes in image.
�clogXNW (78446) ./main/qrscan.c: 42: QUIRC error Format data ECC failure
�clogXHI (78956) ./main/qrscan.c: 29: Detected 1 QR codes in image.
�clogXBW (78956) ./main/qrscan.c: 42: QUIRC error ECC failure
�clogXHI (79206) ./main/qrscan.c: 29: Detected 1 QR codes in image.
�clogXNW (79206) ./main/qrscan.c: 42: QUIRC error Format data ECC failure
�clogXHI (79466) ./main/qrscan.c: 29: Detected 1 QR codes in image.
�clogXBW (79466) ./main/qrscan.c: 42: QUIRC error ECC failure
...

I tinkered around and have a couple of observations:

  1. If I switch the camera image resolution from VGA -> QVGA, the qrscan reliability improves greatly
  2. If I kept camera image resolution at VGA but up the scan width / height to a higher resolution, i.e. 440, the qrscan reliability seems to also improve

My hypothesis is that the smaller scan resolution (compared to the higher camera resolution) requires the camera to be zoomed further out and the higher contrast of black around the QR code is causing the details of the QR code to get washed out.

This is somewhat visible from the S3 Pro screen - I also tried setting camera_sensor->set_contrast(camera_sensor, -1|-2) but that didn't seem to help much as reliably as either of the above, unfortunately.

Unclear if this is a S3 + Camera resolution VGA issue in general or simply due to the IQ of the OV5640 camera module.

@JamieDriver
Copy link
Collaborator

Yes, there are plenty of camera modules around - we have concentrated on GC0308 as that's the one we found to be the most reliable of the ones we tried, and the one we chose to use in our production Jade units.
It may be that some tweaks can be made for other cameras to adjust contrast, brightness/exposure etc.
See also #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants