Edit:
WARNING: In this V1 table there is mistake in DngMatrix (cmat). It will still produce correct image, but not proper (temperature,tint). [2020/09/05].
Fitted Amba Color Calibration Matrices (V1): https://www.goprawn.com/forum/ambare...8654#post18654
I think I found where the most of color calibration, or correction, in
camera is done. It is using 3D LUT cube.
Sometimes when dumping RAW files ("t img -ituner save c:\ituner.txt"
or "t app test enc stillrawcap 0 1" if those are working) there are
funny "ituner_CC_3d.bin" file. Size is 17536.
Also unpacking FW (with Amba Extractor 4071) one gets files StillCc3
or VideoCc2, again 17536 bytes.
Such files contain 3D LUT. In 17536 byte files at offset 0x80 there is a
cube of 16x16x16 uint32 integers. Each integer packs RGB:
B=lowest 10bits, G=10..19bits, R=20..29bits. The remaining 2 bits are 0.
Each RGB is 10bits, scale=1023.
These 3D LUTs indeed serve color calibration of the raw sensor output.
This works similar to gamma LUT, just that it is cube and one uses
tri-linear interpolation.
In my understanding this is how it works:
1. raw sensor output
2. black/white/balance
3. de-bayer/dead pixels/CA/vignette/warp
4. gamma 1D LUT (see below)
5. 3D LUT
6. "smaller scale corrections"
I simulated up to 5. and the result is extremely similar to JPGs one gets from camera.
In open-source tools (dcraw...) 4-5 is done with 3x3 color matrix and then gamma.
In order to visualize 16x16x16 3D LUT I made 256x16 RGB image
(=re-ordered "pixels") and enlarged it:

Top is input color (just index position), while the bottom is output
color (those 16x16x16 RGB triplets). Any other color is interpolated.
Here is all 6 3D luts I found on FF8SE:

I ordered them by "strength". Or how much they differ from an identity
transform. Top is closest to identity and probably not used on
camera, while the bottom is strongest. I am not sure that FF8SE is
using all 6, first 3 look bit weak.
Zip file with all of luts I found: https://drive.google.com/file/d/1wf5...ew?usp=sharing
I also made
corresponding *.cube files that hopefully work.
More info about *.cube and 3d luts: https://wwwimages2.adobe.com/content...cation-1.0.pdf
I was curious how do 3D luts look on different cameras. A lot of it is THE SAME!
It seems that it groups by producer (sony, panasonic, ...) and probably some sub-categories ("newer", "older").
The biggest group seems to be "newer sony sensors":
- FF8SE = thieye_t5e = sj8pro = sj7star = gitup_f1
Some that are unique:
- xiaomi_yi-22l_23l
- yi_4k
- eken_h8pro (Sony IMX078)
- eken_v8s (Panasonic MN34110/MN34112)
- ezviz_s1c (Omnivision OV4685)
- ezviz_s5plus (Panasonic MN34120?)
About gamma: A12_CC_Reg.bin, size=18752, at offset 0x80 there are 512
uint32 integers. This is gamma 1d LUT and it is different from
standard sRGB gamma. I found this exact same gamma LUT even on xiaomi
yi. Seems to be the same on all ambas?
Possible applications:
- Change 3D Lut for better output.
- Better calibration of raw DNG files (and many cameras share same settings --> seem to me at least).
To be continued on how to use or misuse these 3D luts...
WARNING: In this V1 table there is mistake in DngMatrix (cmat). It will still produce correct image, but not proper (temperature,tint). [2020/09/05].
Fitted Amba Color Calibration Matrices (V1): https://www.goprawn.com/forum/ambare...8654#post18654
I think I found where the most of color calibration, or correction, in
camera is done. It is using 3D LUT cube.
Sometimes when dumping RAW files ("t img -ituner save c:\ituner.txt"
or "t app test enc stillrawcap 0 1" if those are working) there are
funny "ituner_CC_3d.bin" file. Size is 17536.
Also unpacking FW (with Amba Extractor 4071) one gets files StillCc3
or VideoCc2, again 17536 bytes.
Such files contain 3D LUT. In 17536 byte files at offset 0x80 there is a
cube of 16x16x16 uint32 integers. Each integer packs RGB:
B=lowest 10bits, G=10..19bits, R=20..29bits. The remaining 2 bits are 0.
Each RGB is 10bits, scale=1023.
These 3D LUTs indeed serve color calibration of the raw sensor output.
This works similar to gamma LUT, just that it is cube and one uses
tri-linear interpolation.
In my understanding this is how it works:
1. raw sensor output
2. black/white/balance
3. de-bayer/dead pixels/CA/vignette/warp
4. gamma 1D LUT (see below)
5. 3D LUT
6. "smaller scale corrections"
I simulated up to 5. and the result is extremely similar to JPGs one gets from camera.
In open-source tools (dcraw...) 4-5 is done with 3x3 color matrix and then gamma.
In order to visualize 16x16x16 3D LUT I made 256x16 RGB image
(=re-ordered "pixels") and enlarged it:
Top is input color (just index position), while the bottom is output
color (those 16x16x16 RGB triplets). Any other color is interpolated.
Here is all 6 3D luts I found on FF8SE:
I ordered them by "strength". Or how much they differ from an identity
transform. Top is closest to identity and probably not used on
camera, while the bottom is strongest. I am not sure that FF8SE is
using all 6, first 3 look bit weak.
Zip file with all of luts I found: https://drive.google.com/file/d/1wf5...ew?usp=sharing
I also made
corresponding *.cube files that hopefully work.
More info about *.cube and 3d luts: https://wwwimages2.adobe.com/content...cation-1.0.pdf
I was curious how do 3D luts look on different cameras. A lot of it is THE SAME!
It seems that it groups by producer (sony, panasonic, ...) and probably some sub-categories ("newer", "older").
The biggest group seems to be "newer sony sensors":
- FF8SE = thieye_t5e = sj8pro = sj7star = gitup_f1
Some that are unique:
- xiaomi_yi-22l_23l
- yi_4k
- eken_h8pro (Sony IMX078)
- eken_v8s (Panasonic MN34110/MN34112)
- ezviz_s1c (Omnivision OV4685)
- ezviz_s5plus (Panasonic MN34120?)
About gamma: A12_CC_Reg.bin, size=18752, at offset 0x80 there are 512
uint32 integers. This is gamma 1d LUT and it is different from
standard sRGB gamma. I found this exact same gamma LUT even on xiaomi
yi. Seems to be the same on all ambas?
Possible applications:
- Change 3D Lut for better output.
- Better calibration of raw DNG files (and many cameras share same settings --> seem to me at least).
To be continued on how to use or misuse these 3D luts...
Comment