简体   繁体   English

python中的图像分割(opencv)——昆虫翅膀

[英]Image segmentation in python (opencv) - Insect wing

This is the kind of image that I have:这是我拥有的那种图像: 在此处输入图片说明

Another example:另一个例子: 在此处输入图片说明

now the ground truth:现在是基本事实: 在此处输入图片说明 在此处输入图片说明

I need a code to get the results similar to the ground truth algorithm, any idea and suggestion will help me because I don't even know where to start, thanks.我需要一个代码来获得类似于真实算法的结果,任何想法和建议都会对我有所帮助,因为我什至不知道从哪里开始,谢谢。

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()

refer this example参考这个例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM