diff --git a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown index 444e0c4f87..947bd6fc2b 100644 --- a/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown +++ b/doc/tutorials/imgproc/erosion_dilatation/erosion_dilatation.markdown @@ -44,6 +44,14 @@ Morphological Operations The background (bright) dilates around the black regions of the letter. +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 `3x3`. + +![Left image: original image inverted, right image: resulting dilatation](images/Morphology_1_Tutorial_Theory_Dilatation_2.png) + +The dilatation makes the object in white bigger. + ### Erosion - This operation is the sister of dilation. What this does is to compute a local minimum over the @@ -56,6 +64,13 @@ The background (bright) dilates around the black regions of the letter. ![](images/Morphology_1_Tutorial_Theory_Erosion.png) +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 `3x3`): + +![Left image: original image inverted, right image: resulting erosion](images/Morphology_1_Tutorial_Theory_Erosion_2.png) + +The erosion makes the object in white smaller. + Code ---- diff --git a/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Dilatation_2.png b/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Dilatation_2.png new file mode 100644 index 0000000000..bdca7c6233 Binary files /dev/null and b/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Dilatation_2.png differ diff --git a/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Erosion_2.png b/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Erosion_2.png new file mode 100644 index 0000000000..5e666eef36 Binary files /dev/null and b/doc/tutorials/imgproc/erosion_dilatation/images/Morphology_1_Tutorial_Theory_Erosion_2.png differ diff --git a/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Closing_2.png b/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Closing_2.png new file mode 100644 index 0000000000..57b790583f Binary files /dev/null and b/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Closing_2.png differ diff --git a/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Opening_2.png b/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Opening_2.png new file mode 100644 index 0000000000..973e13a2d2 Binary files /dev/null and b/doc/tutorials/imgproc/opening_closing_hats/images/Morphology_2_Tutorial_Theory_Opening_2.png differ diff --git a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown index be32508afa..c941413e50 100644 --- a/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown +++ b/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.markdown @@ -24,7 +24,7 @@ In the previous tutorial we covered two basic Morphology operations: - Dilation. Based on these two we can effectuate more sophisticated transformations to our images. Here we -discuss briefly 05 operations offered by OpenCV: +discuss briefly 5 operations offered by OpenCV: ### Opening @@ -40,6 +40,11 @@ discuss briefly 05 operations offered by OpenCV: ![](images/Morphology_2_Tutorial_Theory_Opening.png) +For the sake of clarity, we have performed the opening operation (`7x7` rectangular structuring element) +on the same original image but inverted such as the object in white is now the letter. + +![Left image: original image inverted, right image: resulting opening](images/Morphology_2_Tutorial_Theory_Opening_2.png) + ### Closing - It is obtained by the dilation of an image followed by an erosion. @@ -50,6 +55,10 @@ discuss briefly 05 operations offered by OpenCV: ![](images/Morphology_2_Tutorial_Theory_Closing.png) +On the inverted image, we have performed the closing operation (`7x7` rectangular structuring element): + +![Left image: original image inverted, right image: resulting closing](images/Morphology_2_Tutorial_Theory_Closing_2.png) + ### Morphological Gradient - It is the difference between the dilation and the erosion of an image.