Home How to convert a video feed in open CV python to byte array
Reply: 0

How to convert a video feed in open CV python to byte array

tawhid abir
1#
tawhid abir Published in 2018-02-14 11:39:04Z
import cv2
import numpy as np

cap = cv2.VideoCapture(0)



while(1):
    _, frame = cap.read()
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

    lower_red = np.array([166, 84, 141])
    upper_red = np.array([186,255,255])

    mask = cv2.inRange(hsv, lower_red, upper_red)




    cv2.imshow('frame',frame)
    cv2.imshow('mask',mask)
    resized_image = cv2.resize(mask, (32, 32))



    cv2.imshow('resized_image',resized_image)

    key = cv2.waitKey(1) & 0xFF
    # if the 'q' key is pressed, stop the loop
    if key == ord("q"):
        break
cv2.destroyAllWindows()
cap.release()
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.32519 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO