简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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