我尝试使用捕获类制作一组网络摄像头,但它没有构建。我不确定如何做到这一点。我有搜索和搜索,但什么也没看到。代码的目的是从 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