我做的,我已经发现我的号牌从车辆ANI在尼泊尔车牌检测项目倾斜号牌,但结果是号牌的噪声图像。
我想知道如何划分每个字符出来的,因此它可以检测部分被发送。 我想这样做,但它只是分段的人物从第二行。
def segment(image):
H = 100.
height, width, depth = image.shape
imgScale = H/height
newX,newY = image.shape[1]*imgScale, image.shape[0]*imgScale
image = cv2.resize(image,(int(newX),int(newY)))
cv2.imshow("Show by CV2",image)
cv2.waitKey(0)
cv2.imwrite("resizeimg.jpg",image)
idx =0
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
_,thresh = cv2.threshold(gray,127,255,cv2.THRESH_TOZERO)
cv2.imshow("thresh",thresh)
cv2.waitKey(0)
# gray=cv2.cvtColor(plate,cv2.COLOR_BW2GRAY)
_,contours,_ = cv2.findContours(thresh,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
for cnt in contours:
idx += 1
x,y,w,h = cv2.boundingRect(cnt)
roi = image[y:y+h,x:x+w]
if(w > 10 and h > 10):
cv2.imwrite(str(idx) + '.jpg', roi)