# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 15:39:59 2019
https://docs.opencv.org/3.4.1/d9/d61/tutorial_py_morphological_ops.html
@author: te122613
"""

import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt

img = cv.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
dilation = cv.dilate(img,kernel,iterations = 1)

# plot settings
plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(dilation),plt.title('dilation')
plt.xticks([]), plt.yticks([])
# show plots
plt.show()
3ea9198d304702c83dc7ad33f543bb7634bed173
<mask token>

<mask token>
plt.subplot(121), plt.imshow(img), plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122), plt.imshow(dilation), plt.title('dilation')
plt.xticks([]), plt.yticks([])
plt.show()

<mask token>
img = cv.imread('j.png', 0)
kernel = np.ones((5, 5), np.uint8)
dilation = cv.dilate(img, kernel, iterations=1)
plt.subplot(121), plt.imshow(img), plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122), plt.imshow(dilation), plt.title('dilation')
plt.xticks([]), plt.yticks([])
plt.show()

<mask token>
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
img = cv.imread('j.png', 0)
kernel = np.ones((5, 5), np.uint8)
dilation = cv.dilate(img, kernel, iterations=1)
plt.subplot(121), plt.imshow(img), plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122), plt.imshow(dilation), plt.title('dilation')
plt.xticks([]), plt.yticks([])
plt.show()

# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 15:39:59 2019
https://docs.opencv.org/3.4.1/d9/d61/tutorial_py_morphological_ops.html
@author: te122613
"""

import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt

img = cv.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
dilation = cv.dilate(img,kernel,iterations = 1)

# plot settings
plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(dilation),plt.title('dilation')
plt.xticks([]), plt.yticks([])
# show plots
plt.show()