Posts

Showing posts from June, 2019

Capturing image and Viewing it using OpenCV

import cv2 capture = cv2.VideoCapture( 0 ) capture.set( 3 , 640 ) #width capture.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()

Learn opencv in Bangla_1(What is opencv and how to install opencv)

Image

Capturing Video via webcam

import cv2 capture = cv2.VideoCapture('road_car_view.mp4') while True:     ret,frame = capture.read()         color_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)         cv2.imshow('window',color_frame)         if cv2.waitKey(1) & 0xFF == ord('q'):         break capture.release() cv2.destroyAllWindows()