本文整理汇总了Python中Camera.Camera.release方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.release方法的具体用法?Python Camera.release怎么用?Python Camera.release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera.Camera
的用法示例。
在下文中一共展示了Camera.release方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: put_scan
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import release [as 别名]
def put_scan():
global stepper
objString = ""
stepperThread = threading.Thread(target=stepper.goTop).start() #Start the upwards movement
scanning = True
cam = Camera(captureWidth, captureHeight, 120) #Up to 120 images will be held in the cache before discarding images from the cache
#Start image computation threads
threading.Thread(target=processThread, args=(transformationMatrix, laserThreshold, cam)).start()
threading.Thread(target=processThread, args=(transformationMatrix, laserThreshold, cam)).start()
st = time.time()
while stepperThread.is_alive(): time.sleep(1) #Wait for the scan to finish
scanning = False #Kill the threads
f = open("test.obj", "w")
f.write(objString)
f.close()
cam.release()
示例2: process
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import release [as 别名]
img = cv2.warpPerspective(img, transformationMatrix, (720,720), flags=cv2.INTER_LANCZOS4)
objString += process(img, sliceNr)
s = StepperDriver()
print("Resetting axis...")
s.goUp()
s.goBottom() #Reset the axis
try:
raw_input("Press Enter to start the scanning process")
objString = ""
threading.Thread(target=StepperDriver.goTop) #Move to the top while we scan
scanning = True
cam = Camera(captureWidth, captureHeight, 120) #Up to 120 images will be held in the cache before discarding images from the cache
#Start image computation threads
threading.Thread(target=processThread, args=(transformationMatrix, laserThreshold, cam)).start()
threading.Thread(target=processThread, args=(transformationMatrix, laserThreshold, cam)).start()
st = time.time()
while time.time()-st < 40: time.sleep(1) #Wait for the scan to finish
scanning = False #Kill the threads
f = open("test.obj", "w")
f.write(objString)
f.close()
cam.release()
except KeyboardInterrupt:
try: cam.release()
except: pass
示例3: Camera
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import release [as 别名]
from __future__ import print_function
import time, numpy, sys
from Camera import Camera
import cv2
import cv2.cv as cv
captureWidth = 1280 #Width of camera picture
captureHeight = 720 #Height of camera picture
cam = Camera(captureWidth, captureHeight, BUFFERSIZE=1000)
raw_input("Press Enter to abort")
cam.release()