本文整理匯總了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()