V4L2: Apply software binning after frame stacking#2407
Open
cfuture81 wants to merge 1 commit into
Open
Conversation
The non-stacked mono path calls PrimaryCCD.binFrame() to apply software binning, but the stacked path (STACK_MEAN, STACK_ADDITIVE, STACK_TAKE_DARK) writes the full-resolution accumulated frame directly to the CCD buffer without ever calling binFrame(). This causes a stride mismatch when binning is enabled, resulting in horizontal striping artifacts in the output image. Add PrimaryCCD.binFrame() after the stacked frame is written to the output buffer, matching the behavior of the non-stacked path. Reported-by: User on indilib.org forum (IMX415 sensor, indi_v4l2_ccd v1.2)
Contributor
|
Thank you. Was this fix verified by the reporter after this patch? |
Contributor
Author
Hi. Not yet. I will post a update once confirmed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes horizontal striping artifacts when both software binning and frame stacking (Mean/Additive/Take Dark) are enabled simultaneously in the V4L2 driver.
Problem
The non-stacked mono capture path correctly calls
PrimaryCCD.binFrame()after writing frame data to the CCD buffer, applying the requested software binning. However, the stacked path writes the full-resolution accumulated frame directly to the buffer without callingbinFrame(). This causes a stride mismatch — the buffer contains full-resolution data but the frame metadata expects binned dimensions — resulting in horizontal striping artifacts.Fix
Add
PrimaryCCD.binFrame()after the stacked frame is written to the output buffer, matching the behavior of the non-stacked path. This applies to all stacking modes (STACK_MEAN, STACK_ADDITIVE, STACK_TAKE_DARK).Reported by
User on stellarmate discord forum using IMX415 sensor (3840x2160 native, 1920x1080 with 2x2 binning) with indi_v4l2_ccd v1.2. Binning and stacking work correctly individually but produce striped images when combined.