Rewrite the raw data to the correct whitebalance for ov5640

The "raw" pixels from the ov5640 are 8 bit raw and the whitebalance is done by adjusting the R/G/B gains in the analog part of the chip.

DNG raw expects the raw data to not be whitebalanced and have the R/G/B gains for what the camera decided was "camera neutral" stored in metadata. The way to fix this would be to scale up the 8 bit data to 16 bit channels and then multiply the color channels with the inverse of the analog gain in the sensor and then write the gains as metadata in the DNG file.

This way photo processing apps can show the right white balance, but more importantly: without the correct whitebalance the second set of colormatrices in the dng can't be used since they are interpolated based on the whitebalance metadata. The current DNGS are single-illuminant calibrated for D65 light and look way worse when photos are made indoor.

Assigned to
1 year, 10 months ago
1 year, 24 days ago
No labels applied.