Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
#import opencv library
import cv2
import numpy

frame = cv2.imread('dove.png')

if frame is None:
    print('Error loading image')
    exit()

frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

for j in range(0, frame.shape[0]):
    for i in range(0, frame.shape[1]):
        g = frame[j, i]
        frame[j, i] = 255

cv2.imshow('frame', frame)
cv2.waitKey(0)