Pixel Histogram
픽셀 히스토 그램을 이용하여, 영상 픽셀의 분포도 유추
Original
Input
Code
partial_img = binary[binary.shape[0]//2:,:] # select lower half of the image
hist = np.sum(partial_img, axis=0) # sum all pixels in each column
plt.plot(hist)
plt.show()
plt.clf()
Resolution
Figure out peak value
size = len(hist)
max_index_left = np.argmax(histogram[0:size//2])
max_index_right = np.argmax(histogram[size//2:]) + size//2
Leave a comment