赞
踩
#--coding: utf-8-- import cv2 as cv import numpy as np def channels_split(): capture = cv.VideoCapture('/home/pi/Desktop/白衣黑裤.mp4') while True: ret, frame = capture.read() b, g, r = cv.split(frame) cv.imshow('video', frame) cv.imshow('Red', r) c = cv.waitKey(40) if cv.waitKey(50) & 0xFF == ord('q'): break channels_split() cv.waitKey(0) cv.destoryAllWindows()
注意:合并的通道可以任意组合,且合成顺序与合成效果有关
#--coding: utf-8-- import cv2 as cv import numpy as np def channels_split(): capture = cv.VideoCapture('/home/pi/Desktop/白衣黑裤.mp4') while True: ret, frame = capture.read() b, g, r = cv.split(frame) src = cv.merge([b, b, r]) cv.imshow('video', frame) cv.imshow('complex', src) c = cv.waitKey(40) if cv.waitKey(50) & 0xFF == ord('q'): break channels_split() cv.waitKey(0) cv.destoryAllWindows()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。