- use online color classification

- show camera settings



git-svn-id: http://moon:8086/svn/software/trunk/projects/opencv@318 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-09-18 16:06:42 +00:00
parent b7e833bbc4
commit 92082e5e5e
2 changed files with 66 additions and 12 deletions
+23 -1
View File
@@ -11,6 +11,27 @@ class PiVideoStream:
self.camera = PiCamera()
self.camera.resolution = resolution
self.camera.framerate = framerate
self.camera.exposure_mode = 'auto'
awb_gains = self.camera.awb_gains
print ("sensor_mode : " + str(self.camera.sensor_mode))
print ("resolution : " + str(self.camera.resolution))
print ("framerate : " + str(self.camera.framerate))
print ("awb_mode : " + str(self.camera.awb_mode))
print ("awb_gains : " + str((float(awb_gains[0]), float(awb_gains[1]))))
print ("analog_gain : " + str(float(self.camera.analog_gain)))
print ("digital_gain : " + str(float(self.camera.digital_gain)))
print ("iso : " + str(self.camera.iso))
print ("brightness : " + str(self.camera.brightness))
print ("contrast : " + str(self.camera.contrast))
print ("saturation : " + str(self.camera.saturation))
print ("exposure_mode : " + str(self.camera.exposure_mode))
print ("exposure_speed: " + str(self.camera.exposure_speed))
print ("shutter_speed : " + str(self.camera.shutter_speed))
print ("meter_mode : " + str(self.camera.meter_mode))
print ("image_effect : " + str(self.camera.image_effect))
print ("sharpness : " + str(self.camera.sharpness))
self.rawCapture = PiRGBArray(self.camera, size=resolution)
self.stream = self.camera.capture_continuous(self.rawCapture,
format="bgr", use_video_port=True)
@@ -22,6 +43,7 @@ class PiVideoStream:
self.fps = None
self.thread = None
self.startup = True
def start(self):
# start the thread to read frames from the video stream
self.thread = Thread(target=self.update, args=())
@@ -39,7 +61,7 @@ class PiVideoStream:
self.frame = f.array
self.rawCapture.truncate(0)
self.fps.update()
# if the thread indicator variable is set, stop the thread
# and resource camera resources
if self.stopped: