EMGUCV로 실시간 웹캠 스티치를하려고합니다. this setup on youtube과 비슷한 것입니다. 문제는 스티칭 된 비디오 전용 이미지를 얻지 못한다는 것입니다. EmguCV로 리얼 타임 웹캠 비디오 스티칭
이
내 코드 `public Form1()
{
InitializeComponent();
capture1 = new Emgu.CV.Capture(0);
this.capture1.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1920.0f);
this.capture1.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 1080.0f);
capture2 = new Emgu.CV.Capture(1);
this.capture2.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1920.0f);
this.capture2.SetCaptureProperty(Emgu.CV.CvEnum.CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 1080.0f);
}
private void button1_Click(object sender, EventArgs e)
{
#region if capture is not created, create it now
if (capture1 == null)
{
try
{
capture1 = new Emgu.CV.Capture(0);
capture2 = new Emgu.CV.Capture(1);
}
catch (NullReferenceException excpt)
{
MessageBox.Show(excpt.Message);
}
}
#endregion
if (capture1 != null)
{
if (captureInProgress)
{ //if camera is getting frames then stop the capture and set button Text
// "Start" for resuming capture
button1.Text = "Start!"; //
Application.Idle -= ProcessFrame;
}
else
{
//if camera is NOT getting frames then start the capture and set button
// Text to "Stop" for pausing capture
button1.Text = "Stop";
Application.Idle += ProcessFrame;
}
captureInProgress = !captureInProgress;
}
}
private void ProcessFrame(object sender, EventArgs arg)
{
Image<Bgr, Byte> ImageFrame = capture1.QueryFrame();
camimageBox.Image = ImageFrame; //line 2
Image<Bgr, Byte> ImageFrame2 = capture2.QueryFrame();
imageBox1.Image = ImageFrame2;
}
private void ReleaseData()
{
if (capture1 != null)
capture1.Dispose();
}
private void button2_Click(object sender, EventArgs e)
{
Image<Bgr, byte>[] frames2 = new Image<Bgr, byte>[2];
//List<Image<Bgr, Byte>> frames2 = new List<Image<Bgr, byte>>();
frames2[0] = capture1.QueryFrame();
frames2[1] = capture2.QueryFrame();
camimageBox.Image = frames2[0];
imageBox1.Image = frames2[1];
try
{
using (Stitcher stitcher = new Stitcher(true))
//using (Stitcher stitcher = new Stitcher(true))
{
Image<Bgr, Byte> result = stitcher.Stitch(frames2);
imageBox2.Image = result;
}
}
finally
{
foreach (Image<Bgr, Byte> img in frames2)
{
img.Dispose();
}
}
}
}
내가 엔비디아 NVS 450 GPU를 사용하고있다. 개별 카메라를 별도의 스트림으로 읽을 수 있습니다. EMGUCV를 사용하여 스트림을 결합하여 하나의 스트림 (가상 웹캠에 2 개의 웹캠을 더 생성)을 생성 할 수 있는지 궁금합니다.
나는 도움을 준 것에 대해 감사 할 것입니다. 내 영어를 마음 먹고 PLS!
안녕하세요 OscylO 감사합니다. 늦은 답변 죄송합니다. 나는 다른 것들로 매우 바쁩니다. 나는 당신이 쓴 것을 확인하고 그것이 좋자 마자 피드백을 줄 것이다. – user1462296