KronTalk

Chronos => Chronos User Discussion => Topic started by: lwaters on December 02, 2020, 05:56:12 AM

Title: Custom Color Matrix
Post by: lwaters on December 02, 2020, 05:56:12 AM
Hi!
  I am looking for any kind of information regarding the custom color matrix. I can't seem to find anything online about it at all and the manual just says you need to be a master white balancer to use it without any other kind of info about it... I felt like I was pretty well versed in white balancing but it appears not!
Thank you!
Laura
Title: Re: Custom Color Matrix
Post by: CS223 on December 08, 2020, 05:17:52 AM
I've tinkered with the settings to see what effect they had but didn’t learn much from messing with them. I assume you have a grey color balance reference. If not they are cheap on Amazon I use this one  https://www.amazon.com/dp/B00HT9MA1W/ref=cm_sw_r_cp_api_glc_fabc_4X3ZFbGKQJM09?_encoding=UTF8&psc=1

 In regards to color balancing as a pro, you need a video waveform monitor & vector scope plus a set of ‘chip charts’ Grayscale & color. Your shoot these under your lighting. For the grayscale you look at the waveform monitor and minimize the chrominance on the steps using color adjustments. For color balance you look at the color chart and adjust your color balance & luminance so that the vectors hit all of their boxes. At least that’s how it is done in the days of NTSC broadcast TV. Not sure in the digital world these days.
Title: Re: Custom Color Matrix
Post by: Nikon1 on January 03, 2021, 01:51:07 AM
I now finally read the Manual for the First time, and on page 84 there is this link referenced:
 https://en.wikipedia.org/wiki/Standard_illuminant
Title: Re: Custom Color Matrix
Post by: ExlerElektronik on January 20, 2021, 02:17:44 AM
I'm not a specialist as well, but I did some routines to read out and process the raw images in LabVIEW. If you just display the RGB values as is, you will get an image pretty bad colors for two reasons:

1) The raw images have no gamma correction built in
2) Without applying the color matrix an R pixel will also pick up some green and blue component, the same is true for G and B pixels. I think this is due to the fact the filters on the bayer pattern sensor have to be relatively broadband.

Using the color matrix I have been able to convert from the rawRGB values to sRGB used for display (after interpolation from bayer pattern to full resolution) using the following equation:

sRGB  = ColorMatrix x rawRGB

with sRGB and rawRGB being a column vector of (R,G,B) respectively, and ColorMatrix being the 3x3 matrix as shown in the camera (defaults shown in image attached). Warning: after appling the ColorMatrix you might/will get pixels with R, G or B out of allowed ranges, so you have to clip them to 0/max. I'm not sure, but this might also be related to the limited color space using sRGB.

Afterwards I applied gamma curve and had to strip down R,G,B to 8 bit for display. Finally this has shown the image close to the camera's screen and MP4 playback, so it looks like I guessed well how to process.
Title: Re: Custom Color Matrix
Post by: ExlerElektronik on February 09, 2021, 12:53:39 AM
I did some more work decoding all except MP4 Chronos file formats in Octave (should run with Matlab, but not tested). Within these files you will see all the processing to be done from RAW data to final display. If you are interested in the color matrix processing, see the helping function processColor.m


Helper functions for above

Notes:
•   The code does not have much error checking, so runtime errors are likely if called with invalid parameters or files
•   DNG provides most information required for post processing. For other formats results may vary depending on the lighting conditions, you might have to modify defaults especially for the RAW files.

You migth also be interested in this great article:
https://www.odelama.com/photo/Developing-a-RAW-Photo-by-hand/ (https://www.odelama.com/photo/Developing-a-RAW-Photo-by-hand/)