本文整理汇总了Python中VideoCapture.Device.displayCaptureFilterProperties方法的典型用法代码示例。如果您正苦于以下问题:Python Device.displayCaptureFilterProperties方法的具体用法?Python Device.displayCaptureFilterProperties怎么用?Python Device.displayCaptureFilterProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoCapture.Device
的用法示例。
在下文中一共展示了Device.displayCaptureFilterProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import displayCaptureFilterProperties [as 别名]
snapshots_persisted = False
monitor = True
while monitor:
camshot = ImageEnhance.Brightness(cam.getImage()).enhance(brightness)
camshot = ImageEnhance.Contrast(camshot).enhance(contrast)
for event in pygame.event.get():
if event.type == pygame.QUIT: monitor = False
elif event.type == pygame.KEYUP:
if event.key == pygame.K_1: brightness -= .1
if event.key == pygame.K_2: brightness += .1
if event.key == pygame.K_3: contrast -= .1
if event.key == pygame.K_4: contrast += .1
if event.key == pygame.K_q: cam.displayCapturePinProperties()
if event.key == pygame.K_w: cam.displayCaptureFilterProperties()
if event.key == pygame.K_ESCAPE: pygame.event.post(pygame.event.Event(QUIT,))
if event.key == pygame.K_s:
output_filename = current_directory + ".mp4"
command_line = "ffmpeg.exe -r " + str(frames_per_second) + \
" -i " + os.path.join(current_directory, "%03d.jpg ") + \
output_filename
print("Exporting video...")
print("\t" + command_line)
subprocess.call(command_line)
print("Video exported to " + os.path.join(os.getcwd(), output_filename))
current_directory = str(time.time())
snapshots_persisted = True
shots = 0
current_capture_time = time.time()
示例2: str
# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import displayCaptureFilterProperties [as 别名]
#camera
camshot = ImageEnhance.Brightness(cam.getImage()).enhance(brightness)
camshot = ImageEnhance.Contrast(camshot).enhance(contrast)
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
keyinput = pygame.key.get_pressed() # returns the status of every key pressed - tuple
if keyinput[K_b]: brightness -= .1
if keyinput[K_n]: brightness += .1
if keyinput[K_c]: contrast -= .1
if keyinput[K_v]: contrast += .1
if keyinput[K_q]: cam.displayCapturePinProperties()
if keyinput[K_e]: cam.displayCaptureFilterProperties()
if keyinput[K_t]:
filename = str(time.time()) + ".jpg"
cam.saveSnapshot(filename, quality=80, timestamp=0)
shots += 1
if event.type == KEYDOWN:
# memorizing/recalling positions
for i in range(0,10):
if event.key == ord(str(i)):
if pygame.key.get_mods() & KMOD_CTRL: # CTRL+X remmebers position
print 'CTRL+',str(i),' pressed, microscope positioned remembered'
示例3: Device
# 需要导入模块: from VideoCapture import Device [as 别名]
# 或者: from VideoCapture.Device import displayCaptureFilterProperties [as 别名]
# -*- coding: utf-8 -*-
'''
Created on 2014-3-15
@author: GroundMelon
'''
from VideoCapture import Device
import cv2
import numpy as np
import time
if __name__ =='__main__':
# test two methods
cam = Device(devnum=0)
cam.displayCaptureFilterProperties()
cam.displayCapturePinProperties()
a=time.clock()
im_pil = cam.getImage().convert('RGB')
for i in range(1):
s = im_pil.tostring()
cvimg = np.ndarray(shape = (im_pil.size[1],im_pil.size[0],3), dtype = np.uint8, buffer = s)
cvimg = cvimg[:,:,::-1]#.copy()
#cv2.imshow('',cvimg)
#cv2.waitKey(100)
print('DxShow-mmap:%s'%(str((time.clock()-a)/1000.0)))
for i in range(1000):
im_pil = cam.getImage().convert('RGB')
cvimg = np.array(im_pil)
cvimg = cvimg[:,:,::-1]