OpenCV视频未显示全尺寸
我的问题是 opencv运行,并显示我的视频的原始大小(似乎OpenCV缩小了视频略微缩小),从而影响了我感兴趣的区域。
OpENCV如何显示我的视频的确切尺寸?以下是我的代码和视频原始大小的差异以及OpenCV显示的内容。
代码:
import cv2
cap = cv2.VideoCapture("video_link")
while True:
ret, frame = cap.read()
if not ret:
break
cv2.imshow("frame", frame)
key = cv2.waitKey(1)
if key == 27:
break
cap.release()
cv2.destroyWindow()
原始大小:
openCV视频输出大小:
My problem is opencv runs and show my video not in its original size (seems OpenCV shrinks the video little bit), effecting my region of interest.
How can OpenCV show the exact orginal size of my video? Below is my code and the difference of the video original size and what OpenCV display.
Code:
import cv2
cap = cv2.VideoCapture("video_link")
while True:
ret, frame = cap.read()
if not ret:
break
cv2.imshow("frame", frame)
key = cv2.waitKey(1)
if key == 27:
break
cap.release()
cv2.destroyWindow()
Original size:
OpenCV Video output size:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下,祝你好运。手动输入相机提要的高度和宽度。(编辑:dShow仅在获胜中起作用,如果您有其他东西,请使用其他解决方案)
try this, good luck. Manually enter the height, and width of the camera feed.(edit: Dshow works only in WIN, if you have something else, use different solution)