Capturing image and Viewing it using OpenCV

import cv2

capture = cv2.VideoCapture(0)
capture.set(3, 640)#widthcapture.set(4, 480)#height

if capture.isOpened():
    ret, frame = capture.read()
    cv2.imwrite('osman.jpg', frame)

load_image = cv2.imread('osman.jpg')

while True:
    cv2.imshow('window', load_image)
    if cv2.waitKey(1) == 27:
        break
capture.release()
cv2.destroyAllWindows()

Comments

Popular posts from this blog

How to Adding and Blending image in OpenCV.

How draw Line, Rectangle, Circle, Triangle, and write text in openCV.

Making Border on Image, splitting and merging Color Channels in opencv.