资讯中心

【信息科学与工程学】【审计学】第二篇 招标投标中的审计模型02

📅 2026/10/18 5:22:41
【信息科学与工程学】【审计学】第二篇 招标投标中的审计模型02
29. 视频搜索算法(video_search.py)# video_search.py import cv2 import numpy as np import imagehash from PIL import Image from typing import List, Dict, Optional from concurrent.futures import ThreadPoolExecutor from .utils import logger class VideoSearchEngine: """ 视频搜索:关键帧提取、感知哈希比对、场景切换检测、字幕OCR。 """ def __init__(self, frame_interval: int = 30, hash_size: int = 8): self.frame_interval = frame_interval self.hash_size = hash_size def extract_keyframes(self, video_path: str) - List[np.ndarray]: """每隔固定间隔提取帧,或基于场景变化检测提取关键帧""" frames = [] cap = cv2.VideoCapture(video_path) fps = cap.get(cv2.CAP_PROP_FPS) total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) try: pr

看完文章,想为自己的企业也做一次专业网站诊断?

尧图顾问免费为您评估现有网站,并给出建站/改版建议与报价方案。

免费获取方案