Playing a video from file with color BGR, RGB, GRAY, HSV in OpenCV

import cv2

capture = cv2.VideoCapture('video_1.mp4')


while True:
    ret, frame = capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    HSV = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
    RGB = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

    cv2.imshow('Normal plus BGR', frame)
    cv2.imshow('Gray', gray)
    cv2.imshow('HSV', HSV)
    cv2.imshow('RGB', RGB)


    if cv2.waitKey(1) == 27:
        break
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.