How do I increase the contrast of an image in Python OpenCV
<p>I am new to Python OpenCV. I have read some documents and answers <a href="https://stackoverflow.com/questions/19363293/whats-the-fastest-way-to-increase-color-image-contrast-with-opencv-in-python-c">here</a> but I am unable to figure out what the following code means:</p>

<pre><code>if (self.array_alpha is None):
    self.array_alpha = np.array([1.25])
    self.array_beta = np.array([-100.0])

# add a beta value to every pixel 
cv2.add(new_img, self.array_beta, new_img)                    

# multiply every pixel value by alpha
cv2.multiply(new_img, self.array_alpha, new_img)  
</code></pre>

<p>I have come to know that <code>Basically, every pixel can be transformed as X = aY + b where a and b are scalars.</code>. Basically, I have understood this. However, I did not understand the code and how to increase contrast with this.</p>

<p>Till now, I have managed to simply read the image using <code>img = cv2.imread('image.jpg',0)</code></p>

<p>Thanks for your help</p>