title: How to recognize the color of a license plate？
body: <p>First you should to use this command to install hyperlpr:</p>
  <pre><code>pip install hyperlpr
  </code></pre>
  <p>Then I use this code to identify the license plate number.</p>
  <pre><code>from hyperlpr import *
  import cv2 #opencv3.X version
  import numpy as np
  from math import sqrt
  
  #BGR
  COLORS = [
      (230, 131, 1),  # blue
      (112, 249, 90),  # green
      (5, 189, 252),  # yellow
      (72, 61, 60),  # black
      (251, 253, 252) # white
  ]
  
  def closest_color(rgb):
      r, g, b = rgb
      color_diffs = []
      for color in COLORS:
          cr, cg, cb = color
          color_diff = sqrt(abs(r - cr)**2 + abs(g - cg)**2 + abs(b - cb)**2)
          color_diffs.append((color_diff, color))
      return min(color_diffs)[1]
  
  image_list = [r&quot;9.jpg&quot;,&quot;11.jpg&quot;]
  
  for name in image_list:
      image = cv2.imread(name)
      result_green = HyperLPR_plate_recognition(image)
      if result_green:
          number = result_green[0][0]
          confidence = result_green[0][1]
          left,top,right,bottom = result_green[0][2]
          rec = image[top:bottom,left:right]
          cv2.imshow(name,rec)
          cv2.waitKey(0)
          blue_mean = np.mean(image[:,:,0])#blue_mean
          green_mean = np.mean(image[:,:,1])#green_mean
          red_mean = np.mean(image[:,:,2])#red_mean
          print(blue_mean,green_mean,red_mean)
          index = COLORS.index(closest_color((red_mean, green_mean, blue_mean)))
          print(index)#black
  </code></pre>
  <p>Whether it is a green license plate or a yellow license plate, the result after using the np.mean is black,so how to recognize the color of a license plate？</p>
  <p><a href="https://i.stack.imgur.com/rq18m.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rq18m.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/UsMpP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UsMpP.png" alt="enter image description here" /></a></p>