Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.44 KB

File metadata and controls

61 lines (47 loc) · 2.44 KB

🎨 Color Correction

Note: The "asdfghjkl" is just a placeholder due to some naming difficulties.

This package is designed to perform color correction on images using the Color Checker Classic 24 Patch card. It provides a robust solution for ensuring accurate color representation in your images.

Installation

pip install color-correction-asdfghjkl

Usage

# Step 1: Define the path to the input image
image_path = "asset/images/cc-19.png"

# Step 2: Load the input image
input_image = cv2.imread(image_path)

# Step 3: Initialize the color correction model with specified parameters
color_corrector = ColorCorrection(
    detection_model="yolov8",
    detection_conf_th=0.25,
    correction_model="least_squares",
    degree=2, # for polynomial correction model
    use_gpu=True,
)

# Step 4: Extract color patches from the input image
color_corrector.set_input_patches(image=input_image, debug=True)
color_corrector.fit()
corrected_image = color_corrector.predict(
    input_image=input_image,
    debug=True,
    debug_output_dir="zzz",
)

Sample output: Sample Output

📈 Benefits

  • Consistency: Ensure uniform color correction across multiple images.
  • Accuracy: Leverage the color correction matrix for precise color adjustments.
  • Flexibility: Adaptable for various image sets with different color profiles.

How it works

📚 References