使用捕获创建一个网络摄像头阵列

时间:2012-04-13 14:59:57

标签: c# arrays webcam emgucv

我尝试使用捕获类制作一个网络摄像头阵列,但它没有构建。 我不知道怎么做。我有搜索和搜索,什么也没看到。该代码的目的是从2个网络摄像头实时拍摄视频帧并使用EMGUcv实时缝合它我猜测可以在opencv中完成。如果您有任何其他选择我愿意探索它们

    public partial class StitchingMainForm : Form
   {
       //declaring global variables
       Capture[] cap= new Capture[2];//takes images from cameras as image frames
       private bool captureInProgress;

      public StitchingMainForm()
      {
         InitializeComponent();
      }

      private void selectImagesButton_Click(object sender, EventArgs e)
      {
          Capture[] cap = new Capture[2];
         if (cap!= null)

         {
            sourceImageDataGridView.Rows.Clear();

            Image<Bgr, Byte>[] sourceImages = new Image<Bgr, byte>[cap.Length];

            for (int i = 0; i < sourceImages.Length; i++)
            {
               sourceImages[i] = new Image<Bgr, byte>(cap.[i]);

               using (Image<Bgr, byte> thumbnail = sourceImages[i].Resize(200, 200, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC, true))
               {
                  DataGridViewRow row = sourceImageDataGridView.Rows[sourceImageDataGridView.Rows.Add()];
                  row.Cells["FileNameColumn"].Value = cap.[i];
                  row.Cells["ThumbnailColumn"].Value = thumbnail.ToBitmap();
                  row.Height = 200;
               }
            }

i want to display the captured frames on seperate rows and see the final image after stitching. 

 1. Cannot apply indexing with [] to an expression of type 'method group'
 2. (40,34): error CS1502: The best overloaded method match for              Emgu.CV.Image<Emgu.CV.Structure.Bgr,byte>.Image(byte[*,*,*])' has some invalid arguments
 3. (40,55): error CS1503: Argument 1: cannot convert from 'method group' to 'byte[*,*,*]'
 4. (45,55): error CS0021: Cannot apply indexing with [] to an expression of type   'method group'





Thanks

0 个答案:

没有答案