im = cv2.imread('t3.jpg', cv2.IMREAD_COLOR)
plt.imshow(im)
retval, im2 = cv2.threshold(im, 115, 255, cv2.THRESH_BINARY_INV)
plt.imshow(im2)
im3 = del_mis_pt_by_threshold(im2) )
plt.imshow(im3)
im4 = cv2.dilate(im3, (2, 2), iterations=1)
plt.imshow(im4)
# save figure
plt.savefig('del_mix_pt.png')
x_split_start,x_split_end = catch_axis_start_and_end(im4,axis='x')
舉例來說,11,12,13...27,63,64...95,129,130...,可以看出來,11~27 是一個數字,63~95 是一個數字,這樣就切出數字了
如上圖之後, y 軸的切法也一樣
img1 = my_plt_fun(x_split_start,x_split_end,0)
plt.imshow(img1)
for i in range(len(x_split_start)):
my_plt_fun(x_split_start,x_split_end,i)