赞
踩
- import numpy as np
- def FindImageBBox(img):
- v_sum = np.sum(img, axis=0)
- start_i = None
- end_i = None
- minimun_range = 10
- maximun_range = 20
- min_val = 10
- peek_ranges = []
- ser_val = 0
- # 从左往右扫描,遇到非零像素点就以此为字体的左边界
- for i, val in enumerate(v_sum):
- #定位第一个字体的起始位置
- if val > min_val and start_i is None:
- start_i = i
- ser_val = 0
- #继续扫描到字体,继续往右扫描
- elif val > min_val and st
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。