當前位置: 首頁>>代碼示例>>Python>>正文


Python Filter.select_method方法代碼示例

本文整理匯總了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
開發者ID:BrandonSlaght,項目名稱:barcode-scanner,代碼行數:20,代碼來源:barcode-scanner.py

示例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()
開發者ID:Lord-Nazdar,項目名稱:MovieBarcode,代碼行數:32,代碼來源:VideoMood.py


注:本文中的Filter.select_method方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。