- improved PiCameraPipeline (added names for procs, better thread mgmt)

- added VideoSource to piCameraPipeline



git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@330 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-10-22 07:50:06 +00:00
parent 7412e813bc
commit 4bf4c483a4
4 changed files with 108 additions and 81 deletions
+6 -6
View File
@@ -10,8 +10,8 @@ if ("__main__" == __name__):
# Unit test with to threaded processors
class MyRgbProcess1(RgbProcess):
def __init__(self, resolution=(320, 240, 3), numEntries=2, next=None):
super(MyRgbProcess1, self).__init__(resolution, numEntries, next)
def __init__(self, name, resolution=(320, 240, 3), numEntries=2, next=None):
super(MyRgbProcess1, self).__init__(name, resolution, numEntries, next)
def process(self):
data = self.read(1.0)
@@ -26,8 +26,8 @@ if ("__main__" == __name__):
self.next.write(cv2.cvtColor(gray_blurred,cv2.COLOR_GRAY2BGR))
class MyRgbProcess2(RgbProcess):
def __init__(self, resolution=(320, 240, 3), numEntries=2, next=None):
super(MyRgbProcess2, self).__init__(resolution, numEntries, next)
def __init__(self, name, resolution=(320, 240, 3), numEntries=2, next=None):
super(MyRgbProcess2, self).__init__(name, resolution, numEntries, next)
def process(self):
data = self.read(1.0)
@@ -44,8 +44,8 @@ if ("__main__" == __name__):
camera.resolution = (320, 240)
camera.framerate = 60
frameDim = (camera.resolution[0], camera.resolution[1], 3)
myProcessor2 = MyRgbProcess2((240, 320, 3), 4)
myProcessor1 = MyRgbProcess1((240, 320, 3), 4, myProcessor2)
myProcessor2 = MyRgbProcess2('Process 2', (240, 320, 3), 4)
myProcessor1 = MyRgbProcess1('Process 1', (240, 320, 3), 4, myProcessor2)
myRgbProcessorAdapter = RgbProcessorAdapter(frameDim)
myRgbProcessorAdapter.processorAdd(myProcessor1)
camera.start_recording(myRgbProcessorAdapter, format="bgr")