本文整理汇总了Python中Filter.select_method方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.select_method方法的具体用法?Python Filter.select_method怎么用?Python Filter.select_method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter.select_method方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadmovies
# 需要导入模块: import Filter [as 别名]
# 或者: from Filter import select_method [as 别名]
def loadmovies(path):
os.chdir(path)
for file in glob.glob("*.mp4"):
vidcap = cv2.VideoCapture(file)
count = 0;
values = []
while success:
success,image = vidcap.read()
cv2.imshow('Direct Video', image)
frame_color = Filter.select_method(args.method)(frame)[:3]
values.append(frame_color)
count += 1
print (count)
# head, tail = os.path.split("/tmp/d/a.dat")
videopackage = (file,values)
json.dumps(videopackage)
json.dump(videopackage,f)
return
示例2: tqdm
# 需要导入模块: import Filter [as 别名]
# 或者: from Filter import select_method [as 别名]
# For each Frame
for i in tqdm(range(final_width)):
# Let's warp
cap.set(cv2.CAP_PROP_POS_FRAMES, (i+args.timestamp)*warp)
ret, frame = cap.read()
# If this is an empty frame aka. last one
if not ret:
break
# Crop the frame
frame = frame[y1:y2, x1:x2]
cv2.imshow('Direct Video', frame)
# Get color
frame_color = Filter.select_method(args.method)(frame)[:3]
sample_image[:, :] = frame_color
cv2.imshow('Current Dominant Color', sample_image)
# Fill final image
final_image[:, i] = frame_color
# Force quit
if cv2.waitKey(10) & 0xFF == ord('q'):
break
cv2.imwrite('color_img.jpg', final_image)
cap.release()