惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
P
Palo Alto Networks Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
AWS News Blog
AWS News Blog
Project Zero
Project Zero
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
MongoDB | Blog
MongoDB | Blog
aimingoo的专栏
aimingoo的专栏
K
Kaspersky official blog
Jina AI
Jina AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
IT之家
IT之家
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog

OpenCV

目标检测,计算出旋转速度和加速度,有人精通吗?急 - V2EX opencv 图像动态融合问题 - V2EX 请问一个关于 OpenCV 手眼标定(cv::calibrateHandEye)获取相机安装参数的问题 - V2EX [求助]C++ 用到 OpenCV 库 怎么静态编译呢? - V2EX opencv 去除视频中移动的文字 - V2EX 请教一个 opencv 算法,图片中检测圆形对象 - V2EX 用 C++调用 OpenCV 的 matchTemplate 反而比 Python 更慢 - V2EX mov 视频的图片如何转换? - V2EX 大家有用过类似 PS Content-Aware Fill 抠图的库或源码吗(不限语言) - V2EX nii 文件用 opencv 转换为 mp4 视频画面失真,求教 - V2EX [求助] 如何确定点在曲线中的位置 - V2EX 哇 期待很久的 计算机视觉 - V2EX
Opencv 遇到一个很奇怪的问题, mac 上获取摄像头图片,必须需要 sleep 一下, 0.1 都可以,但是不给就是黑图,代码如下,有没有大佬指点一下 - V2EX
Jinkeup · 2024-04-15 · via OpenCV

Jinkeup

 

Jinkeup · 2024 年 4 月 15 日 · 2376 次点击

这是一个创建于 790 天前的主题,其中的信息可能已经有所发展或是发生改变。

def capture_photo(): # 打开摄像头 cap = cv2.VideoCapture(0)

# 检查摄像头是否打开成功
if not cap.isOpened():
    raise Exception("Failed to open camera")
# 图片为黑,必须 sleep 一下!!!
sleep(0.1)
# 读取一帧图像
ret, frame = cap.read()

# 检查图像是否读取成功
if not ret:
    raise Exception("Failed to capture frame")

# 释放摄像头
cap.release()

# 保存图像到当前目录
cv2.imwrite("captured_photo.jpg", frame)

return "Photo captured successfully"
kyonn

1

kyonn      2024 年 4 月 17 日 via Android

不休眠多读几帧试下,看下是第几帧图像正常了