Code Monkey home page Code Monkey logo

image_color_correction's Introduction

White-Balance with Color Cards

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

Image Inputs

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).

image

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

image

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

image

3.) As result you get the Final color optimized Output Image based on the reference Histogram Colors

image

Python command

Output File

python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg

Special output File width

python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg --width 1280

with output Preview

python color_correction.py --reference raw.jpg --input test.jpg --view

with an output Preview and file output

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

image_color_correction's People

Contributors

dazzafact avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

image_color_correction's Issues

How to Mass Process More Photos at Once?

hi sir
your model is so amazing!
but i have many photos to process

can you add batch processing function?
I am a beginner and will not change the code
thanks

Is the Panton color card required?

I have my own color card, not a Panton one.

And they do not have Aruco markers at the corners.

Could i use my color card by cropping the card only and input as refCard (instead of finding card automatically using aruco)

Or could i copy the corner makers and put at my color card's corners. Would the aruco find my card?

Thank for your efforts. Best wishes.

Could not find color with width 100px

  • cloned your repo
  • installed requirements (had to change opencv-contrib-python==4.6.0 to opencv-contrib-python==4.6.0.66), using python3.8.13
  • python color_correction.py --reference raw.jpg --input test.jpg --out output.jpg --width 1280
  • output:
[INFO] loading images...
[INFO] Finding color matching cards width 100px
[INFO] Could not find color with width 100px. Try width:500px
[WARNING] Could not find color matching cards in both images. Try a highter/better Resolution
  • same output/ error given with no width specified

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.