Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

opencv dilate

import cv2
import numpy as np
 
img = cv2.imread('input.png', 0)

# The first parameter is the original image, kernel is the matrix with
# which image is convolved and third parameter is the number
# of iterations and will determine how much you want to dilate the image.
kernel = np.ones((5,5), np.uint8)
img_dilation = cv2.dilate(img, kernel, iterations=1)
 
cv2.imshow('Input', img)
cv2.imshow('Dilation', img_dilation)
 
cv2.waitKey(0)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #opencv #dilate
ADD COMMENT
Topic
Name
3+9 =