Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 170 - 2615_KEC
P. 170

    Output

                      Program 6: To lighten a portion of the image.

                          Program6.py

                       File  Edit  Format    Run   Options   Window    Help

                       import cv2
                       # Read the image
                       image = cv2.imread("Flower.jpg")
                       # Lighten a rectangular portion directly
                       image[100:300, 150:350] = cv2.add(image[100:300, 150:350], 50)
                       # Display the result
                       cv2.imshow("Lightened Image", image)

                          Output

                      168   Premium Edition-VIII

| 165 166 167 168 169 170 171 172 173 174 175 |