[PYTHON] ROS Lecture 119 Correct the color of the camera image

environment

This article works in the following environment.

item value
CPU Core i5-8250U
Ubuntu 18.04
ROS Melodic
OpenCV 3.2.0

For installation, refer to ROS Course 02 Installation. Also, the program in this article has been uploaded to github. See ROS Course 11 git repository.

Overview

In a previous article, I made an example of detecting an object by hue, but this assumes that the camera has acquired the correct color. However, the colors that can be obtained with the camera will change depending on the performance of the camera and the lighting conditions. Therefore, here is a simple method for color proofing of the camera (and environment). As a general rule, take a picture of an object of "reference color" with a camera, investigate what kind of color it looks like, and find the gain value of each color (red, green, blue). This time, we will use a color checker as the "reference color". A decent one (X-rite ColorChecker Classic) is good, but decent I ordered something similar on Aliexpress because it's expensive. The color checker contains data about colors and how they should appear in RGB.

Source code

color_rectify_tool.py

Run

Run the tool


rosrun cam_lecture color_rectify_tool.py

cam_rectify2.gif

After execution, the result is as follows. Gian is large = It means that the image is stronger than the original color. Red is weak and blue is strong. This is a typical fluorescent lighting trend.

cam_recrify_result.png

comment

reference

Link to table of contents page

Link to ROS course table of contents

Recommended Posts

ROS Lecture 119 Correct the color of the camera image
I tried to correct the keystone of the image
Is the probability of precipitation correct?
A method of converting the style of an image while preserving the color
Display the image of the camera connected to the personal computer on the GUI.
Extract the color of the object in the image with Mask R-CNN and K-Means clustering
Extract dominant color of image by k-means clustering
Color page judgment of scanned image with python
Change the color of Fabric errors and warnings
Image processing? The story of starting Python for
I tried using the image filter of OpenCV
[Small story] Download the image of Ghibli immediately
[Python + OpenCV] Whiten the transparent part of the image
Image of closure
Extract the table of image files with OneDrive & Python
[Note] Correct the orientation of the liquid crystal of M5Stick V
Let's apply the brand image color to the matplotlib colormap!
[Touch Designer] Change the appearance color of Button COMP
I tried to detect the iris from the camera image
The background color of the QWidget subclass cannot be set
Get the image of "Suzu Hirose" by Google image search.
[Python] Summary of how to specify the color of the figure