Linear_Color_Correction_Matrix icon indicating copy to clipboard operation
Linear_Color_Correction_Matrix copied to clipboard

Basic algorithm for color correction

Usually, color correction is included in image preprocessing of camera devices. Normally this process will be done by the ISP(image signal processor) in the camera device. In this repo, the implementation of Color correction is more like a color calibration process in the beginning. We first take an image sample of colorchecker(24 color chart) which took by the our camera device. This camera device might have not tune the image quality yet(at least the color correction part), which means its ISP doesnt have suitable color correction matrix for this camera device.

The image have not been corrected might be like this:
alt text

After it generates the color correction matrix by function "LCC_CMC", its ISP can use this specific color correction matrix for color correction in the future.

The image had been corrected like this:
alt text

The "ReferenceColor.csv" file is the reference color value we want to refer and the "LCC_CMC.csv" file is the color correction matrix.
There is "ROISelection" function for taking the color value of original condition. The ROI cropping order should be "from top to the bottom, from left to the right.". It will collect 24 color values of your colorchecker image sample.

The ROI cropping process:
alt text

If you dont like the color performance of your own camera, you can use this algorithm to correct the color either.