0

私はプロジェクトに取り組んでおり、その一部は Emgu.cv を使用して画像をステッチしています。ユーザーに画像のインポートを求める。ユーザーが「スティッチング」ボタンを押すと、pictureBox を使用して画像をスティッチして 1 つの画像として表示する必要がありますが、代わりにエラーが発生しました。

エラー画像

このチュートリアルに従って、C# の代わりに Vb を試してみます: http://www.youtube.com/watch?v=Lk37LR50viw しかし、プロジェクトはビルドされません。

ボタンの c# コード:

        Stitcher x = new Stitcher(false);

        Image<Bgr, Byte> result = x.Stitch(images);
        imageBox.Image = result.ToBitmap();

画像は次のとおりです。

    Image<Bgr, Byte>[] images = new Image<Bgr, Byte>[9];

インポートされたすべての画像が保存されていること:

        private void importbuofd_FileOk(object sender, CancelEventArgs e)
    {

        switch (x)
        {
            case 1: pictureBox1.ImageLocation = importbuofd.FileName; x = x + 1; images[0] = new Image<Bgr, Byte>(new Bitmap(pictureBox1.Image)); count++; break;
            case 2:  pictureBox2.ImageLocation = importbuofd.FileName; x = x + 1; images[1] = new Image<Bgr, Byte>(new Bitmap(pictureBox2.Image)); count++; break;
            case 3: pictureBox3.ImageLocation = importbuofd.FileName; x = x + 1; images[2] = new Image<Bgr, Byte>(new Bitmap(pictureBox3.Image)); count++; break;
            case 4: pictureBox4.ImageLocation = importbuofd.FileName; x = x + 1; images[3] = new Image<Bgr, Byte>(new Bitmap(pictureBox4.Image)); count++; break;
            case 5: pictureBox5.ImageLocation = importbuofd.FileName; x = x + 1; images[4] = new Image<Bgr, Byte>(new Bitmap(pictureBox5.Image)); count++; break;
            case 6: pictureBox6.ImageLocation = importbuofd.FileName; x = x + 1; images[5] = new Image<Bgr, Byte>(new Bitmap(pictureBox6.Image)); count++; break;
            case 7: pictureBox7.ImageLocation = importbuofd.FileName; x = x + 1; images[6] = new Image<Bgr, Byte>(new Bitmap(pictureBox7.Image)); count++; break;
            case 8:pictureBox8.ImageLocation = importbuofd.FileName; x = x + 1; images[7] = new Image<Bgr, Byte>(new Bitmap(pictureBox8.Image)); count++; break;
            case 9: pictureBox9.ImageLocation = importbuofd.FileName; x = x + 1; images[8] = new Image<Bgr, Byte>(new Bitmap(pictureBox9.Image)); count++; break;
            default: MessageBox.Show("Sorry, This is the maximum number You can import"); break;

        }
    }

何をすればよいでしょうか?!

4

1 に答える 1

0

これを試して:

Image<Bgr, Byte> cam1 = _capture1.QueryFrame();
Image<Bgr, Byte> cam2 = _capture2.QueryFrame();

Image<Bgr, Byte> convert1 = new Image<Bgr, byte>(Change_Im_Size(cam1.ToBitmap(), 270, 190));
Image<Bgr, Byte> convert2 = new Image<Bgr, byte>(Change_Im_Size(cam2.ToBitmap(), 270, 190));

pictureBox1.Image = cam1.ToBitmap();
pictureBox2.Image = cam2.ToBitmap();

Image<Bgr, Byte>[] frameArray = new Image<Bgr, Byte>[2];

frameArray[0] = convert1;
frameArray[1] = convert2;

using (Stitcher stitcher = new Stitcher(false))
{
    try
    {
        Image<Bgr, Byte> result = stitcher.Stitch(frameArray);
        pictureBox3.Image = result.ToBitmap();
    }
    catch { }
}
于 2013-06-19T16:54:45.453 に答える