我对图像处理和目标检测非常陌生。我想提取/识别下图中牙齿的位置和尺寸:
以下是我迄今为止使用OpenCV所做的尝试:
import cv2
import numpy as np
planets = cv2.imread('model.png', 0)
canny = cv2.Canny(planets, 70, 150)
circles = cv2.HoughCircles(canny,cv2.HOUGH_GRADIENT,1,40, param1=10,param2=16,minRadius=10,maxRadius=80)
circles = np.uint16(np.around(circles))
for i in circles[0,:]:
# draw the outer circle
cv2.circle(planets,(i[0],i[1]),i[2],(255,0,0),2)
# draw the center of the circle
cv2.circle(planets,(i[0],i[1]),2,(255,0,0),3)
cv2.imshow("HoughCirlces", planets)
cv2.waitKey()
cv2.destroyAllWindows()
我不知道接下来该怎么办。我想确认一下所有的牙齿。我该怎么做?你知道吗
我真的很感激任何帮助。。你知道吗
请注意,齿的结构或多或少是一条抛物线(上下颠倒)。如果你能以某种方式猜出抛物线形状来定义这些斑点(牙齿)的质心,那么你的问题就可以简化到合理的程度。我画了一条穿过牙齿中心的红线。你知道吗
我建议你按以下方式处理:
structure_centroid
。请看:How to center the nonzero values within 2D numpy array?。你知道吗structure_centroid
的位置为中心。我已经展示了这样的极片(三角形半透明)卡通形象。完全覆盖360度。请看:^{centroid_path
。你知道吗centroid_path
的圆运行消除/选择算法。使用阈值距离删除异常值。你知道吗这应该给你一个很好的近似的牙齿与圆。你知道吗
我希望这有帮助。你知道吗
相关问题 更多 >
编程相关推荐