[英]Image segmentation in python (opencv) - Insect wing
import cv2 as cv
from matplotlib import pyplot as plt
# Load image in grayscale
img = cv.imread('coins.png',0)
# threshold the image
thresh = cv.threshold(img,0,255,cv.THRESH_BINARY_INV+cv.THRESH_OTSU)[1]
# display the image
plt.imshow(thresh, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.