Error
#31
Replies: 1 comment
Hey, |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
import cv2 as cv
import numpy as np 3
image = cv.imread("butterfly.jpg", 1)
if image is None:
print('Could not open or find the image: ')
exit(0)
try:
bright = int(input('* Enter the brightness value [0-255]: '))
except ValueError:
print('Error, not a number')
new_image = np.zeros(image.shape, image.dtype)
for y in range (image.shape [0]):
for x in range(image.shape[1]):
for z in range(image.shape [2]):
newval image[y,x,z] + bright =
if newVal > 255:
newVal = 255
new_image[y,x,z] = newVal
cv.imshow(Original Image', image)
cv.imshow("Brightness Image', new_image)
cv.waitKey()
All reactions