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

Improve AGC #9

Open
bgottula opened this issue Jan 21, 2019 · 1 comment
Open

Improve AGC #9

bgottula opened this issue Jan 21, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bgottula
Copy link
Collaborator

A crude AGC was added to the capture software under #1 but it was not extensively tested. Known or suspected issues:

  • Slow initial adaptation when the gain/exposure time is far from where it needs to go (several seconds).
  • The mapping of agc_value to gain and exposure time settings needs to be further scrutinized.
    • Does the pixel value change linearly in response to a change in gain? What about exposure time?
    • Right now, the mapping minimizes gain to maximize SNR. But we may also want to keep the exposure time low to reduce motion blur induced by mount vibration and tracking jitter.
  • More thought should be applied to how the error term is derived and the set point.
  • With the lens cap on the AGC does not always crank the gain and exposure time all the way up to max, which means it must be detecting pixels with very high values. But I don't see any non-zero bars in the histogram display. (Unfortunately the histogram used for AGC is generated separately from the one shown in the preview thread, so there could be a bug in one or the other or both.)
@bgottula bgottula self-assigned this Jan 21, 2019
@bgottula bgottula added the enhancement New feature or request label Jan 21, 2019
@bgottula
Copy link
Collaborator Author

An idea tried on nix was to set the histogram threshold based on a number of allowed saturated pixels, rather than a percentile:

         // Calculate Nth percentile pixel value
-        constexpr float percentile = 1.0;
-        uint32_t integral_threshold = (uint32_t)((1.0 - percentile) * Frame::IMAGE_SIZE_BYTES);
+        constexpr float percentile = 0.999;
+       constexpr int max_saturated_pixels = 10;
+        //uint32_t integral_threshold = (uint32_t)((1.0 - percentile) * Frame::IMAGE_SIZE_BYTES);
+        uint32_t integral_threshold = max_saturated_pixels;

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

No branches or pull requests

1 participant