给定直方图图像中的最大Y值,我知道最大值的位置X

时间:2018-11-06 22:46:29

标签: numpy scipy

我使用argmax()函数从图像的直方图中找到了两半的最大值的位置,但是如何找到这些点的最大Y值。这是我用来找到max-Y的X位置的代码段

histogram = np.sum(binary_warped[binary_warped.shape[0]/2:,:], axis=0)
half_width = np.int(histogram.shape[0]/2)
leftx = np.argmax(histogram[:half_width])
rightx = np.argmax(histogram[half_width:]) + half_width

The image I am working with

0 个答案:

没有答案