以高分辨率捕获网络摄像头中的图片,而使用DirectShow.Net在较低的位置预览 [英] Capturing pictures from webcam at high resolution while previewing at a lower one using DirectShow.Net

查看:295
本文介绍了以高分辨率捕获网络摄像头中的图片,而使用DirectShow.Net在较低的位置预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用DirectShow.Net流媒体到我的C#(4.0)应用程序读取QR码。它每隔0.5秒进行一次快照,以查看是否可以找到任何QR码并对其进行解码。这在我的dev电脑上工作伟大的任何分辨率,我可以得到我的网络摄像头,但是当我在目标机器(松下CF-U1 Toughbook - 英特尔Atom处理器)上尝试它真的开始下降,当我去一个更高的分辨率



我使用DirectShow.Net DxSnap示例(命名空间快照)中的Capture类。我正在传递给它一个Picturebox来绘制预览。我很确定这是什么是bogging down系统(猜测视频卡只是不是由任务)。我需要预览绘制(所以用户可以看到他们正在尝试扫描),但它不一定是与采取寻找QR码的图片相同的分辨率。由于此程序是为低屏幕分辨率的设备,预览框最大在320 x 240(我根据相机上选择的分辨率调整宽高比)。

所以我想我想要的是以下任何一种:


  1. 从同一个网络摄像头,一个在低分辨率
    预览和一个高分辨率捕获


  2. 等同于这一点, (再一次使用来自DirectShow.Net项目的DxSnap示例中的Capture类)



  3. DirectShow.Net以外的东西用于这种东西(它必须与从Windows XP到


感谢您的帮助。

解决方案


  1. 您可以使用SmartTee或InfiniteTee拆分流,但我不知道如何在拆分后更改分辨率

  2. 不知道如何执行此操作。

  3. 您可以使用SampleGrabber捕获图像并手动将它们放入图片框中。

  4. 如果你想要XP和更高版本,你需要使用DirectShow。

我的应用程序当前正在以不同于分辨率的分辨率捕获图像。视频被用户看到。我这样做是因为我使用的网络摄像头(Logitech C920)具有Capture引脚和Still引脚,它们具有不同的视频格式列表。我能够独立地获得每个引脚的分辨率设置,并更改我需要的。我的应用程序只关心Still引脚的分辨率,所以我改变,而捕获引脚始终保持在640 x 480。我相信SmartTee应该做类似的事情,而不需要一个Still pin,但我不是一个DirectShow大师,所以有人需要填写这个信息。


I am using DirectShow.Net to stream a webcam to my C# (4.0) app for reading QR codes. It is taking a snapshot every .5 seconds to see if it can find any QR codes and decode them. This works great on my dev computer at any resolution I can get my webcam to, but when I try it on a target machine (Panasonic CF-U1 Toughbook - Intel Atom processor) it really starts to bog down when I go to a higher resolutions than 800x600 on the webcam.

I am using the Capture class from the DirectShow.Net DxSnap sample (namespace Snapshot). I am passing in to it a Picturebox to draw the preview on. I am pretty sure this is what is bogging down the system (guessing the video card just isn't up to the task). I need to have the preview drawn (so the users can see what they are trying to scan), but it doesn't have to be at the same resolution as the picture that gets taken to look for a QR code. Since this program is made for devices with low screen resolutions the preview box maxes out at 320 x 240 (I do adjust the aspect ratio in accordance with the resolution selected on the camera).

So I guess what I'm looking for is any of the following:

  1. A way to have two streams going from the same webcam, one at low res for preview and one at high res for capture

  2. Something that equates to that, maybe reducing the resolution right before it gets written to the picture box (once again, using the Capture class from the DxSnap sample from the DirectShow.Net project)

  3. A way to keep the picture box from being refreshed so much

  4. Something other than DirectShow.Net to use for this kind of thing (it has to work with everything from Windows XP to Windows 8 in the desktop space).

Thanks for your help.

解决方案

  1. You can split the stream using a SmartTee or InfiniteTee, but I'm not sure how to change the resolution after you've split it.
  2. Not sure how to do this.
  3. You could capture the images and manually place them into the picture box using a SampleGrabber. Then, you have complete control of when the frames are shown in the picture box.
  4. If you want XP and up, you'll need to use DirectShow. MediaFoundation (the modern alternative) is only Vista and up.

My application is currently capturing images at a different resolution than the resolution of the video being seen by the user. I'm doing this because the webcam I'm using (Logitech C920) has both a Capture pin and a Still pin, which have different listings of video formats. I'm able to get the set of resolutions for each pin independently, and change the one I need to. My application is only concerned with the Still pin's resolution, so I change that while the Capture pin remains at 640 x 480 at all times. I believe the SmartTee is supposed to do something similar to this without the need of a Still pin, but I'm not a DirectShow guru, so someone else would need to fill you in with that information.

这篇关于以高分辨率捕获网络摄像头中的图片,而使用DirectShow.Net在较低的位置预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆