我想找一束不同图像的激光.
Example image:
The Original one:
我找到了不同的方法,但不知何故,它似乎不工作. 我现在还使用了一个阈值:
logicM = image > Threshold
plt.figure()
plt.imshow(logicM, cmap='gray')
plt.axis('image')
plt.title(laserColor + ' band intensity over ' + str(Threshold))
来识别这条线.现在我想用一条虚线标记横梁.然后绘制高度(即像素)上的强度.如何做到这一点呢?我就是想不通.
我发现了这个: Vertical curved line detection with OpenCV 并且 Draw a curve line going through the blobs in OpenCV C++
两者都不起作用.
编辑:理论公式可以在这里找到,但有没有简单的OpenCV解决方案?: https://mv.in.tum.de/_media/members/steger/publications/1996/icpr-96-steger.pdf个
EDIT2: 我试着这样做,以获得等高线之间的值.
# Sort the contour points by their y-value
contour_points_by_row = {}
for contour in contours:
print(contour)
for point in contour:
x, y = point[0] # Zugriff auf die x- und y-Koordinaten
if y in contour_points_by_row:
contour_points_by_row[y].append(x)
else:
contour_points_by_row[y] = [x]
但是数组太短了.更多的 idea ?