[OpenCV Practice 15-4] 이미지 컨투어 feature (Image Contour - feature 3)
import cv2 import numpy as np import matplotlib.pyplot as plt Contours Feature img = cv2.imread('cropped.jpg') img_copy = img.copy() img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) res, thr = cv2.threshold(img_gray, 127, 255, cv2.THRESH_BINARY) contours, _ = cv2.findContours(thr, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) cnt = contours[1] cv2.drawContours(img_copy, [cnt], -1, (0, 255, 0), 2) plt...
데이터 분석 & 시각화/OpenCV
2020. 12. 23. 17:59
최근댓글