本文整理汇总了Python中SimpleCV.Image.meanColor方法的典型用法代码示例。如果您正苦于以下问题:Python Image.meanColor方法的具体用法?Python Image.meanColor怎么用?Python Image.meanColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleCV.Image
的用法示例。
在下文中一共展示了Image.meanColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: take_background
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import meanColor [as 别名]
def take_background():
log("take_background()")
# get background snapshot
if DEBUG:
img = Image(TEMP_FOLDER_PATH + STATIC_BACKGROUND_NAME)
else:
img = capture_camera_image()
# get mean_color
mean_color = img.meanColor()
# save it
db = db_open()
db_backgrounds_write(db, db_background(date_created=datetime.now(), mean_color=mean_color))
db_close(db)
示例2: VirtualCamera
# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import meanColor [as 别名]
from __future__ import print_function
from SimpleCV import Image, Color, VirtualCamera, Display
import SimpleCV as scv
# # video = VirtualCamera('', 'video')
# display = Display()
# while display.isNotDone():
# img = video.getImage()
# try:
# dist = img - img.colorDistance(Color.RED)
# dist.show()
# except KeyboardInterrupt:
# display.done = True
# if display.mouseRight:
# display.done = True
# display.quit()
img = Image('img/curb.JPG')
img = img.crop(0, 2*img.height/3, img.width, 5*img.height/6)
print(img.meanColor())
# img = img.binarize()
# img.findBlobs().draw()
# ls = img.findLines()
# for l in ls:
# l.draw()
# img.findBlobs().draw()
# img = img.colorDistance(Color.RED)
img.save('img/curb_processed.jpg')