我想在下图中(通过使用 Python):
1.) 找到骨骼的轮廓(只有侧面可以)
2.) 识别并绘制所有轮廓。
它可能看起来像这样:
更好的轮廓甚至是好的。我不完全确定如何解决这个问题,
图像的梯度为:
我想在下图中(通过使用 Python):
1.) 找到骨骼的轮廓(只有侧面可以)
2.) 识别并绘制所有轮廓。
它可能看起来像这样:
更好的轮廓甚至是好的。我不完全确定如何解决这个问题,
图像的梯度为:
解决这个问题的初始方法是使用精确的边缘检测,使用正确的阈值,然后找到轮廓。
import cv2
# Load the image
img = cv2.imread("/home/tribta/Desktop/feet.png")
# Find the contours
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(img,60,200)
im2, contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
hierarchy = hierarchy[0] # get the actual inner list of hierarchy descriptions
# For each contour, find the bounding rectangle and draw it
cv2.drawContours(img, contours, -1, (0,255,0), 3)
# Finally show the image
cv2.imshow('img',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
然后你可以添加一些生物医学处理标准来区分不同的轮廓并验证它是否真的是骨头。