title: How to fast change image brightness with python + OpenCV?
body: <p>I have a sequence of images. I need to average brightness of these images.</p>
  
  <p><strong>First example</strong> (very slow):</p>
  
  <pre><code>img = cv2.imread('test.jpg') #load rgb image
  hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) #convert it to hsv
  
  for x in range(0, len(hsv)):
      for y in range(0, len(hsv[0])):
          hsv[x, y][2] += value
  
  img = cv2.cvtColor(hsv, cv2.COLOR_HSV2BGR)
  cv2.imwrite("image_processed.jpg", img)
  </code></pre>
  
  <p><strong>Second example</strong> (quickly)</p>
  
  <pre><code>hsv += value
  </code></pre>
  
  <p>This example very fast but it changes all values HSV (I need to change only V (brightness))</p>