You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

color_detection.py 593 B

1234567891011121314151617
  1. # -- coding: UTF-8
  2. import cv2
  3. import os
  4. import hyperlpr.colourDetection as hc
  5. import hyperlpr.config as hconfig
  6. filepath = hconfig.configuration["colorTest"]["colorPath"]
  7. for filename in os.listdir(filepath):
  8. if filename.endswith(".jpg") or filename.endswith(".png") or filename.endswith(".bmp"):
  9. fileFullPath = os.path.join(filepath,filename)
  10. img = cv2.imread(fileFullPath.encode('utf-8'))
  11. color,rgb = hc.judge_plate_color(img)
  12. if color != None:
  13. print filename,"->",color,"->",rgb
  14. else:
  15. print filename,"->","unknown->",rgb