March 2018
Beginner to intermediate
306 pages
9h 54m
English
Follow these steps:
import cv2import numpy as npimport matplotlib.pyplot as plt
image = cv2.imread('../data/Lena.png', 0)_, binary = cv2.threshold(image, -1, 1, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
eroded = cv2.morphologyEx(binary, cv2.MORPH_ERODE, (3, 3), iterations=10)dilated = cv2.morphologyEx(binary, cv2.MORPH_DILATE, (3, 3), iterations=10)
opened = cv2.morphologyEx(binary, cv2.MORPH_OPEN, cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5)), iterations=5)closed ...
Read now
Unlock full access