本文整理汇总了Python中SimpleCV.Display.done方法的典型用法代码示例。如果您正苦于以下问题:Python Display.done方法的具体用法?Python Display.done怎么用?Python Display.done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Display
的用法示例。
在下文中一共展示了Display.done方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_img
# 需要导入模块: from SimpleCV import Display [as 别名]
# 或者: from SimpleCV.Display import done [as 别名]
def show_img(img):
display = Display()
img.show()
# Wait for user to close the window or break out of it.
while display.isNotDone():
try:
pass
except KeyboardInterrupt:
display.done = True
if display.mouseRight:
display.done = True
display.quit()
示例2: Kinect
# 需要导入模块: from SimpleCV import Display [as 别名]
# 或者: from SimpleCV.Display import done [as 别名]
from time import sleep
kinect = Kinect()
display = Display((640, 480))
pdepth = kinect.getDepth().invert()
ds = MOGSegmentation(history = 500, nMixtures = 5, backgroundRatio = 0.1, noiseSigma = 5, learningRate = 0.3)
ds.addImage(pdepth)
while not display.isDone():
depth = kinect.getDepth()
ds.addImage(depth)
df = ds.getSegmentedImage(False)
"""
if df is not None:
print "diffed"
blobs = df.dilate(3).findBlobs()
if blobs is not None:
df.dl().polygon(blobs[-1].mConvexHull, color = Color.RED)
"""
df.save(display)
if display.mouseLeft:
display.done = True
del kinect
#pg.quit()