mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #3974 from StevenPuttemans:fix_RGB_naming_master
This commit is contained in:
@@ -69,7 +69,7 @@ Explanation
|
||||
-# Most of the stuff shown is known by you (if you have any doubt, please refer to the tutorials in
|
||||
previous sections). Let's check the general structure of the program:
|
||||
|
||||
- Load an image (can be RGB or grayscale)
|
||||
- Load an image (can be BGR or grayscale)
|
||||
- Create two windows (one for dilation output, the other for erosion)
|
||||
- Create a set of 02 Trackbars for each operation:
|
||||
- The first trackbar "Element" returns either **erosion_elem** or **dilation_elem**
|
||||
|
||||
@@ -53,7 +53,7 @@ Explanation
|
||||
-----------
|
||||
|
||||
-# Declare variables such as the matrices to store the base image and the two other images to
|
||||
compare ( RGB and HSV )
|
||||
compare ( BGR and HSV )
|
||||
@code{.cpp}
|
||||
Mat src_base, hsv_base;
|
||||
Mat src_test1, hsv_test1;
|
||||
|
||||
@@ -21,7 +21,7 @@ Morphology is a set of image processing operations that process images based on
|
||||
|
||||
Two of the most basic morphological operations are dilation and erosion. Dilation adds pixels to the boundaries of the object in an image, while erosion does exactly the opposite. The amount of pixels added or removed, respectively depends on the size and shape of the structuring element used to process the image. In general the rules followed from these two operations have as follows:
|
||||
|
||||
- __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, rgb, etc).
|
||||
- __Dilation__: The value of the output pixel is the <b><em>maximum</em></b> value of all the pixels that fall within the structuring element's size and shape. For example in a binary image, if any of the pixels of the input image falling within the range of the kernel is set to the value 1, the corresponding pixel of the output image will be set to 1 as well. The latter applies to any type of image (e.g. grayscale, bgr, etc).
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -104,13 +104,13 @@ Explanation
|
||||
-----------
|
||||
|
||||
-# Let's check the general structure of the program:
|
||||
- Load an image. If it is RGB we convert it to Grayscale. For this, remember that we can use
|
||||
- Load an image. If it is BGR we convert it to Grayscale. For this, remember that we can use
|
||||
the function @ref cv::cvtColor :
|
||||
@code{.cpp}
|
||||
src = imread( argv[1], 1 );
|
||||
|
||||
/// Convert the image to Gray
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
@endcode
|
||||
- Create a window to display the result
|
||||
@code{.cpp}
|
||||
|
||||
Reference in New Issue
Block a user