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

Poor image quality (rolling 2024-02-12) #2901

Closed
Slider0007 opened this issue Feb 13, 2024 · 20 comments
Closed

Poor image quality (rolling 2024-02-12) #2901

Slider0007 opened this issue Feb 13, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@Slider0007
Copy link
Collaborator

Slider0007 commented Feb 13, 2024

The Problem

User are reporting poor image quality (too dark, blurry) since rolling of 2024-02-12.

#2857 (comment)
#2857 (comment)

I assume it's related to #2885

Version

Rolling Commit: 141aea7

Logfile

n.a.

Expected Behavior

No response

Screenshots

No response

Additional Context

No response

@Slider0007 Slider0007 added the bug Something isn't working label Feb 13, 2024
@Slider0007 Slider0007 changed the title Poor image quality since rolling 2024-02-12 Poor image quality (rolling 2024-02-12) Feb 13, 2024
@caco3
Copy link
Collaborator

caco3 commented Feb 13, 2024

This is really odd!
I just did a screenshot of v15.6.0 and the 141aea7.
As you can see below, on my setup, there is a slight difference in the color, but its not more blury:

Left side: v15.6.0, right side: 141aea7

grafik

grafik

@jasaw
Copy link
Contributor

jasaw commented Feb 13, 2024

The default sharpness value that we use may cause the blurry image because sharpness is not documented on the ov2640 datasheet. Other than that, the other parameters should have their defaults set correctly.

@caco3
Copy link
Collaborator

caco3 commented Feb 13, 2024

@FrankCGN01 and @warnmat
The mentioned PR added some new configuration for the camera. Maybe the default parameters are not identical to what we had before. Could you play with the parameters and see if you can get to what you had before? I especially would look on the "sharpness" (expert parameter).

@jasaw
Copy link
Contributor

jasaw commented Feb 13, 2024

Try playing with the "auto exposure control 2" as well. The old code does not set a known value, so it is left to the ov2640 default.

@caco3
Copy link
Collaborator

caco3 commented Feb 13, 2024

The default sharpness value that we use may cause the blurry image because sharpness is not documented on the ov2640 datasheet. Other than that, the other parameters should have their defaults set correctly.

Thanks for the clarification.
I seem to get comparable results (to 15.6.0) with sharpness=0 (left side) and sharpness=1 (right side):
grafik

Could it be that it depends on the camera? You mentioned that you only checked the datasheet for the ov2640.

@Slider0007 I think it would be useful if we could report the camera info (type), but I couldn't find yet a way to get this information.
According to the defines, we disable support for most cameras and only support 3 types (whereas BF20A6 looks odd):

#
# Camera configuration
#
# CONFIG_OV7670_SUPPORT is not set
# CONFIG_OV7725_SUPPORT is not set
# CONFIG_NT99141_SUPPORT is not set
CONFIG_OV2640_SUPPORT=y
# CONFIG_OV3660_SUPPORT is not set
# CONFIG_OV5640_SUPPORT is not set
# CONFIG_GC2145_SUPPORT is not set
# CONFIG_GC032A_SUPPORT is not set
# CONFIG_GC0308_SUPPORT is not set
# CONFIG_BF3005_SUPPORT is not set
CONFIG_BF20A6_SUPPORT=y
# CONFIG_SC101IOT_SUPPORT is not set
CONFIG_SC030IOT_SUPPORT=y
# CONFIG_SC031GS_SUPPORT is not set

@caco3
Copy link
Collaborator

caco3 commented Feb 13, 2024

https://jomjol.github.io/AI-on-the-edge-device-docs/Hardware-Compatibility also just mentions the OV2640, so there is a high chance that we all just use that one.

@jasaw
Copy link
Contributor

jasaw commented Feb 13, 2024

Oh, this reminds me, in the old code, there was a a workaround that writes to undocumented registers in the ov2640. It doesn't care which camera is attached. I changed the behaviour to only do the undocumented workaround if ov2640 is attached. This workaround is for brightness control.

@warnmat
Copy link

warnmat commented Feb 14, 2024

@FrankCGN01 and @warnmat The mentioned PR added some new configuration for the camera. Maybe the default parameters are not identical to what we had before. Could you play with the parameters and see if you can get to what you had before? I especially would look on the "sharpness" (expert parameter).

I do still have the one installed called:
Development-Branch: HEAD (Commit: 246d128+)

Sorry to say but I have very less experience with Github at all. How can I get the version you call 141aea7? I do click on the link and get the code displayed but how do I get something downloadable to install it on my device. Sorry for this maybe stupid question but this github stuff is a bit overwelming for me atm.
Currently I do not have any of the expert parameters you named above :-(.

@friedpa
Copy link

friedpa commented Feb 14, 2024

Go to Actions in the main ribbonband - Click on the Titel of, in your case: Revert "Implemented late analog / digital transition (#2778)" #347
You will find the three different versions of the SW. If you use OTA then use: AI-on-the-edge-device__update__rolling_(141aea7)

@warnmat
Copy link

warnmat commented Feb 14, 2024

Thanks for helping me out.
I have installed the version and the picture quality is back to where it was before. I do now have the additional adjustment possibilities but they are all greyed out and not accessible what might be because of my camera used.
I will check and rpovide an update after some iterations.

@caco3
Copy link
Collaborator

caco3 commented Feb 14, 2024

they are all greyed out and not accessible

You first have to click on "Create new reference"!

the picture quality is back to where it was before

What does this mean?
Is it back to as good as with v15.6.0?

@warnmat
Copy link

warnmat commented Feb 14, 2024

After the change to the new version the picture quality was back to 15.6 image quality before the change to the first DEV version to fix the inadequate count was done.
Now I have generated a new reference image and I´m able to use the new features and with those I was able to get a good image when the system is running. Not that clear as some of the other posted pictures but for me this one is good enough now.
The only adjustment I need to find is were to adjust the date. It tells me it is 1970/01/02... :-)
Many thanks for the quick support!

@friedpa
Copy link

friedpa commented Feb 14, 2024

If your ISP cannot reach the NTP Server look in your Firewall if you block the access, or if your router provides a NTP functionality then insert your Gateway IP. You hae to enable Expert View to see that field right at the bottom.

@FrankCGN01
Copy link

@FrankCGN01 and @warnmat The mentioned PR added some new configuration for the camera. Maybe the default parameters are not identical to what we had before. Could you play with the parameters and see if you can get to what you had before? I especially would look on the "sharpness" (expert parameter).

@caco3 After I selected "Auto-exposure Control 2" in the expert parameters, I got an image with the same quality as in version 15.6. Together with the sharpness even a little better than before.

@SybexX
Copy link
Collaborator

SybexX commented Feb 16, 2024

I had the camera parameters output to me before they were changed through config.ini:

I (4137) ov2640: Set PLL: clk_2x: 0, clk_div: 0, pclk_auto: 0, pclk_div: 8
I (4137) cam_hal: cam config ok
I (4217) MAIN: Camera scale: 0
I (4227) MAIN: Camera binning: 0
I (4227) MAIN: Camera quality: 12
I (4237) MAIN: Camera brightness: 0
I (4247) MAIN: Camera contrast: 0
I (4257) MAIN: Camera saturation: 0
I (4257) MAIN: Camera sharpness: 0
I (4267) MAIN: Camera denoise: 0
I (4277) MAIN: Camera special_effect: 0
I (4277) MAIN: Camera wb_mode: 0
I (4287) MAIN: Camera awb: 1
I (4297) MAIN: Camera awb_gain: 1
I (4477) MAIN: Camera aec: 1
I (4537) MAIN: Camera aec2: 0
I (4547) MAIN: Camera ae_level: 0
I (4557) MAIN: Camera aec_value: 168
I (4567) MAIN: Camera agc: 1
I (4567) MAIN: Camera agc_gain: 0
I (4577) MAIN: Camera gainceiling: 0
I (4587) MAIN: Camera bpc: 0
I (4597) MAIN: Camera wpc: 1
I (4597) MAIN: Camera raw_gma: 1
I (4607) MAIN: Camera lenc: 1
I (4617) MAIN: Camera hmirror: 0
I (4627) MAIN: Camera vflip: 0
I (4627) MAIN: Camera dcw: 1
I (4637) MAIN: Camera colorbar: 0
I (6647) MAIN: Camera info: PID: 0x26, VER: 0x42, MIDL: 0x7f, MIDH: 0xa2

this corresponds to these settings:

CamEinstellungen

@Duese123
Copy link

Had the same error on 15.7. Never bekamen rallye sharp and with good saturation. Went back to 15.4 and problem solved. On New 15.7 Image is dark and very unsharp

@caco3
Copy link
Collaborator

caco3 commented Feb 19, 2024

Had the same error on 15.7. Never bekamen rallye sharp and with good saturation. Went back to 15.4 and problem solved. On New 15.7 Image is dark and very unsharp

Did you also play with the expert parameters? You could try to enable the auto exposure algorithm and also adjust the exposure parameters.

@caco3
Copy link
Collaborator

caco3 commented Aug 26, 2024

There was not much happening regarding this issue. Also, if it would be a real regression, more people would have complained.
IMO we can close it, what do you think @SybexX

@SybexX
Copy link
Collaborator

SybexX commented Aug 26, 2024

@caco3 At the beginning the camera's default settings weren't set quite right, but now they should be fine in the current rolling and you can close it.

@caco3
Copy link
Collaborator

caco3 commented Aug 26, 2024

I agree
I just had to restore my devices due to a failed test (the ESP IDF update :) ). The restore used the latest release and I was surprised that the alignment image just was grey. Even when I took it out and checked the live stream, it was almost gray. But then I updated to rolling all was good again. So I agree, on 15.7.0 some thing was bad but you fixed them right afterwards IIRC.

@caco3 caco3 closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants