![]() In this case, we default gamma=1.0, but you should supply whatever value is necessary to obtain a decent looking corrected image. A second (optional) value is our gamma value. This method requires a single parameter, image, which is the image we want to apply gamma correction to. ![]() We define our adjust_gamma function on Line 7. Lines 2-5 simply import our necessary packages, nothing special here. # apply gamma correction using the lookup table Table = np.array().astype("uint8") # build a lookup table mapping the pixel values to Open up a new file, name it adjust_gamma.py, and we’ll get started: # import the necessary packages Now that we understand what gamma correction is, let’s use OpenCV and Python to implement it. Figure 1: Our original image (left) Gamma correction with G 1 (right), this time the output image is much lighter than the original.
0 Comments
Leave a Reply. |