Merge pull request #3974 from StevenPuttemans:fix_RGB_naming_master
This commit is contained in:
@@ -35,13 +35,13 @@ Point pt = Point(10, 8);
|
||||
|
||||
- Represents a 4-element vector. The type Scalar is widely used in OpenCV for passing pixel
|
||||
values.
|
||||
- In this tutorial, we will use it extensively to represent RGB color values (3 parameters). It is
|
||||
- In this tutorial, we will use it extensively to represent BGR color values (3 parameters). It is
|
||||
not necessary to define the last argument if it is not going to be used.
|
||||
- Let's see an example, if we are asked for a color argument and we give:
|
||||
@code{.cpp}
|
||||
Scalar( a, b, c )
|
||||
@endcode
|
||||
We would be defining a RGB color such as: *Red = c*, *Green = b* and *Blue = a*
|
||||
We would be defining a BGR color such as: *Blue = a*, *Green = b* and *Red = c*
|
||||
|
||||
Code
|
||||
----
|
||||
|
@@ -122,8 +122,8 @@ Explanation
|
||||
*image.size()* and *image.type()*
|
||||
|
||||
-# Now, to perform the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ we will access to each
|
||||
pixel in image. Since we are operating with RGB images, we will have three values per pixel (R,
|
||||
G and B), so we will also access them separately. Here is the piece of code:
|
||||
pixel in image. Since we are operating with BGR images, we will have three values per pixel (B,
|
||||
G and R), so we will also access them separately. Here is the piece of code:
|
||||
@code{.cpp}
|
||||
for( int y = 0; y < image.rows; y++ ) {
|
||||
for( int x = 0; x < image.cols; x++ ) {
|
||||
|
@@ -57,7 +57,7 @@ the samples directory of OpenCV at the cpp tutorial code for the core section. I
|
||||
how_to_scan_images imageName.jpg intValueToReduce [G]
|
||||
@endcode
|
||||
The final argument is optional. If given the image will be loaded in gray scale format, otherwise
|
||||
the RGB color way is used. The first thing is to calculate the lookup table.
|
||||
the BGR color space is used. The first thing is to calculate the lookup table.
|
||||
|
||||
@snippet how_to_scan_images.cpp dividewith
|
||||
|
||||
@@ -88,7 +88,7 @@ case of a gray scale image we have something like:
|
||||

|
||||
|
||||
For multichannel images the columns contain as many sub columns as the number of channels. For
|
||||
example in case of an RGB color system:
|
||||
example in case of an BGR color system:
|
||||
|
||||

|
||||
|
||||
|
@@ -101,7 +101,7 @@ possible to use the old functions and in the end just transform the result to a
|
||||
|
||||
@snippet interoperability_with_OpenCV_1.cpp new
|
||||
|
||||
Because, we want to mess around with the images luma component we first convert from the default RGB
|
||||
Because, we want to mess around with the images luma component we first convert from the default BGR
|
||||
to the YUV color space and then split the result up into separate planes. Here the program splits:
|
||||
in the first example it processes each plane using one of the three major image scanning algorithms
|
||||
in OpenCV (C [] operator, iterator, individual element access). In a second variant we add to the
|
||||
|
@@ -118,8 +118,8 @@ added.
|
||||
|
||||
There are, however, many other color systems each with their own advantages:
|
||||
|
||||
- RGB is the most common as our eyes use something similar, our display systems also compose
|
||||
colors using these.
|
||||
- RGB is the most common as our eyes use something similar, however keep in mind that OpenCV standard display
|
||||
system composes colors using the BGR color space (a switch of the red and blue channel).
|
||||
- The HSV and HLS decompose colors into their hue, saturation and value/luminance components,
|
||||
which is a more natural way for us to describe colors. You might, for example, dismiss the last
|
||||
component, making your algorithm less sensible to the light conditions of the input image.
|
||||
|
Reference in New Issue
Block a user