728x90
import cv2
#이미지 표면을 0침식을 시킴
imageName = 'data/images/truth.png'
image = cv2.imread(imageName, cv2.IMREAD_COLOR)
dilationSize = 5 #얼마나 깎을 것인가?
element = cv2.getStructuringElement(cv2.MORPH_RECT,
(2*dilationSize+1, 2*dilationSize+1))
# (dilationSize,dilationSize))
imageEroded = cv2.erode(image, element)
cv2.imshow('original', image)
cv2.imshow('Eroded', imageEroded)
cv2.waitKey(0)
cv2.destroyALLWindow()
728x90
'OpenCV' 카테고리의 다른 글
rotate / warpAffine/ getAffine 이미지 돌리기 (0) | 2021.04.20 |
---|---|
opening, closing (0) | 2021.04.20 |
dilate 이미지 확장 (0) | 2021.04.20 |
Threshold 흐린걸 진하게 (0) | 2021.04.20 |
OpenCV 2 Video read/write (0) | 2021.04.18 |