Skip to content

Commit c419552

Browse files
committed
Add images for tutorials on morphological operations to avoid possible confusion.
1 parent 4e7f288 commit c419552

File tree

6 files changed

+27
-1
lines changed

6 files changed

+27
-1
lines changed

doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Dilation
5353

5454
The background (bright) dilates around the black regions of the letter.
5555

56+
To better grasp the idea and avoid possible confusion, in this another example we have inverted the original image such as the object in white is now the letter. We have performed two dilatations with a rectangular structuring element of size :math:`3x3`.
57+
58+
.. image:: images/Morphology_1_Tutorial_Theory_Dilatation_2.png
59+
:alt: Left image: original image inverted, right image: resulting dilatation
60+
:align: center
61+
62+
The dilatation makes the object in white bigger.
63+
5664
Erosion
5765
^^^^^^^^
5866

@@ -66,6 +74,13 @@ Erosion
6674
:alt: Erosion result - Theory example
6775
:align: center
6876

77+
In the same manner, the corresponding image resulting of the erosion operation on the inverted original image (two erosions with a rectangular structuring element of size :math:`3x3`.
78+
79+
.. image:: images/Morphology_1_Tutorial_Theory_Erosion_2.png
80+
:alt: Left image: original image inverted, right image: resulting erosion
81+
:align: center
82+
83+
The erosion makes the object in white smaller.
6984

7085
Code
7186
======
1.52 KB
Loading
1.5 KB
Loading
1.35 KB
Loading
1.31 KB
Loading

doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In the previous tutorial we covered two basic Morphology operations:
3131
* Erosion
3232
* Dilation.
3333

34-
Based on these two we can effectuate more sophisticated transformations to our images. Here we discuss briefly 05 operations offered by OpenCV:
34+
Based on these two we can effectuate more sophisticated transformations to our images. Here we discuss briefly 5 operations offered by OpenCV:
3535

3636
Opening
3737
---------
@@ -50,6 +50,12 @@ Opening
5050
:alt: Opening
5151
:align: center
5252

53+
For the sake of clarity, we have performed the opening operation (:math:`7x7` rectangular structuring element) on the same original image but inverted such as the object in white is now the letter.
54+
55+
.. image:: images/Morphology_2_Tutorial_Theory_Opening_2.png
56+
:alt: Left image: original image inverted, right image: resulting opening
57+
:align: center
58+
5359
Closing
5460
---------
5561

@@ -65,6 +71,11 @@ Closing
6571
:alt: Closing example
6672
:align: center
6773

74+
On the inverted image, we have performed the closing operation (:math:`7x7` rectangular structuring element):
75+
76+
.. image:: images/Morphology_2_Tutorial_Theory_Closing_2.png
77+
:alt: Left image: original image inverted, right image: resulting closing
78+
:align: center
6879

6980
Morphological Gradient
7081
------------------------

0 commit comments

Comments
 (0)