Splitting a 3D numpy Array and plotting one of them. - Raspberry Pi Forums
hi,
operate on numpy array. using code : can yuv numpy array, has dimensions 256 256 3. assume number 3 individual y, u , v channels.
question is, how 1 of these channels, left 256 256 1 array, corresponding y, u or v channel?
thank help,
cheers,
david
operate on numpy array. using code :
code: select all
import picamera import picamera.array import cv2 pil import image import numpy import pil arrayy = none # inherit piyuvanalysis class myanalysisclass(picamera.array.pirgbanalysis): def analyse(self, array): #print ('here') #if set print array, array updated values printed. global arrayy #the global command makes variable available in namespace of whole program (i think) arrayy = array picamera.picamera() camera: picamera.array.pirgbanalysis(camera) output: camera.resolution = (256, 256) camera.framerate = 30 output = myanalysisclass(camera) # output not file, myanalysisclass class, written above. camera.start_recording(output, format='rgb') camera.wait_recording(5) camera.stop_recording()
question is, how 1 of these channels, left 256 256 1 array, corresponding y, u or v channel?
thank help,
cheers,
david
code: select all
y = yuv[0:256,0:256,0] u = yuv[0:256,0:256,1] v = yuv[0:256,0:256,2]
raspberrypi
Comments
Post a Comment