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.
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.
/ image_raw
.Run the tool
rosrun cam_lecture color_rectify_tool.py
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.
Link to ROS course table of contents
Recommended Posts