A python function to correct image White-Balance using Color Cards, detecting with CV2 Aruco. Base Idea: https://pyimagesearch.com/2021/02/15/automatic-color-correction-with-opencv-and-python/
You just need an already optimized color input image and another image which is not color optimized. Both images with Color Card, using ArUCo Marker (you can glue them on the Corners of every imageCard to for detecting)
python color_correction.py --reference ref.jpg --input test.jpg --out output.jpg
First you need a color optimized Image as Reference using a Color Card with Aruco Markers (or follow the Link to purchase the Panton Color Card).
1.) A ReferenceImage used as the basis for all further image processes. The colors of this Card image should be optimized to your liking.
--reference ref.jpg
2.) you have to choose a none color optimized Image with the a Color card, to detect the Color Difference between both images
--input test.jpg
3.) As result you get the Final color optimized Output Image based on the reference Histogram Colors
python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg
python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg --width 1280
python color_correction.py --reference raw.jpg --input test.jpg --view
python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg --view
Blog: https://pyimagesearch.com/2021/02/15/automatic-color-correction-with-opencv-and-python/
Stackoverflow: https://stackoverflow.com/questions/70233645/color-correction-using-opencv-and-color-cards/73566972#73566972