【发布时间】:2017-10-07 10:00:56
【问题描述】:
对于射线照相扫描,我已经能够获取轮廓。
我有兴趣找到中心轴。我怎么能在python中做到这一点?
这是我的轮廓代码:
import cv2
img = cv2.imread("A.png")
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(img,60,200)
contours, hierarchy = cv2.findContours(edges, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
hierarchy = hierarchy[0]
cv2.drawContours(img, contours, -1, (255,0,0), 3)
cv2.imshow('img',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
【问题讨论】:
-
提供您的输入图像,以便其他人可以尝试。还要定义如何放置这些线。
-
@Piglet 我刚刚添加了 X 射线。谢谢,
-
@Headcrab 可以用 Python 获取代码吗?
标签: python opencv image-processing opencv-contour x-ray