The current implementation works fine when a single mean in required, but it did not function when a per_subpixel mean was required. A per-sub pixel mean is required for hot pixel identification and correction. This version is generalized and should work for all mosaic patterns.
How this approach works:
Calculate the per-subpixel sum along rows.
Starting with an row x col sized texture, the output is a MPW x col texture.
Sum the per-subpixel along columns.
Starting with the MPW x col image the result is a MPW^2 length buffer
If needed, sum to single value, going from MPW^2 values to a single value.
The current implementation works fine when a single mean in required, but it did not function when a per_subpixel mean was required. A per-sub pixel mean is required for hot pixel identification and correction. This version is generalized and should work for all mosaic patterns.
How this approach works:
Both Bayer and XTrans images are affected by this, I tested both. Image results are identical before and after this PR