add color detection

This commit is contained in:
Marcus Universe
2017-11-01 18:13:58 +08:00
parent b5f8305cc3
commit 4e28874afe
4 changed files with 124 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
# -- coding: UTF-8
import cv2
import os
import hyperlpr.colourDetection as hc
import hyperlpr.config as hconfig
filepath = hconfig.configuration["colorTest"]["colorPath"]
for filename in os.listdir(filepath):
if filename.endswith(".jpg") or filename.endswith(".png") or filename.endswith(".bmp"):
fileFullPath = os.path.join(filepath,filename)
img = cv2.imread(fileFullPath.encode('utf-8'))
color,rgb = hc.judge_plate_color(img)
if color != None:
print filename,"->",color,"->",rgb
else:
print filename,"->","unknown->",rgb