Example #1
0
 public void PropertyWaveCorrectKind()
 {
     using (var stitcher = Stitcher.Create())
     {
         const WaveCorrectKind value = WaveCorrectKind.Vertical;
         stitcher.WaveCorrectKind = value;
         Assert.Equal(value, stitcher.WaveCorrectKind);
     }
 }
Example #2
0
 public void PropertyRegistrationResol()
 {
     using (var stitcher = Stitcher.Create())
     {
         const double value = 3.14159;
         stitcher.RegistrationResol = value;
         Assert.Equal(value, stitcher.RegistrationResol, 6);
     }
 }
Example #3
0
 public void PropertyPanoConfidenceThresh()
 {
     using (var stitcher = Stitcher.Create())
     {
         const double value = 3.14159;
         stitcher.PanoConfidenceThresh = value;
         Assert.Equal(value, stitcher.PanoConfidenceThresh, 6);
     }
 }
Example #4
0
 public void PropertyWaveCorrection()
 {
     using (var stitcher = Stitcher.Create())
     {
         const bool value = true;
         stitcher.WaveCorrection = value;
         Assert.Equal(value, stitcher.WaveCorrection);
     }
 }
Example #5
0
 public void PropertyRCompositingResol()
 {
     using (var stitcher = Stitcher.Create())
     {
         const double value = 3.14159;
         stitcher.CompositingResol = value;
         Assert.Equal(value, stitcher.CompositingResol, 6);
     }
 }
Example #6
0
        static void Main(string[] args)
        {
            Mat[] images   = SelectStitchingImages(10);
            Mat   pano     = new Mat();
            var   stitcher = Stitcher.Create(true);

            Console.Write("Stitching start...");
            var status = stitcher.Stitch(images, pano);

            Console.WriteLine(" finish (status:{0})", status);
            Window.ShowImages(pano);
            foreach (Mat image in images)
            {
                image.Dispose();
            }
            pano.ImWrite("dst.jpg");
        }
Example #7
0
        private static void Stitching(Mat[] images)
        {
            var stitcher = Stitcher.Create(false);

            Mat pano = new Mat();

            Console.Write("Stitching 処理開始...");
            var status = stitcher.Stitch(images, pano);

            Console.WriteLine(" 完了 {0}", status);

            pano.SaveImage(@"C:\temp\pano.png");
            Window.ShowImages(pano);

            foreach (Mat image in images)
            {
                image.Dispose();
            }
        }
        public void Run()
        {
            Mat[] images = SelectStitchingImages(200, 200, 12);

            using (var stitcher = Stitcher.Create(Stitcher.Mode.Panorama))
                using (var pano = new Mat())
                {
                    Console.Write("Stitching start...");
                    var status = stitcher.Stitch(images, pano);
                    Console.WriteLine(" finish (status:{0})", status);
                    Assert.Equal(Stitcher.Status.OK, status);

                    ShowImagesWhenDebugMode(pano);
                }

            foreach (Mat image in images)
            {
                image.Dispose();
            }
        }
        public void Run()
        {
            Mat[] images = SelectStitchingImages(200, 200, 10);

            using var stitcher = Stitcher.Create(Stitcher.Mode.Scans);
            using var pano     = new Mat();

            Console.Write("Stitching start...");
            // TODO: does not work??
            var status = stitcher.Stitch(images, pano);

            Console.WriteLine(" finish (status:{0})", status);

            Window.ShowImages(pano);

            foreach (var image in images)
            {
                image.Dispose();
            }
        }
Example #10
0
    /// <summary>
    /// 拼接
    /// </summary>
    void OnStitch()
    {
        IEnumerable <Mat> images = GenerateImages();

        using (var stitcher = Stitcher.Create(tryUseGpu))
            using (var panoMat = new Mat())
            {
                Debug.Log("Stitcher start...");
                var status = stitcher.Stitch(images, panoMat);
                if (status != Stitcher.Status.OK)
                {
                    Debug.Log("Can't stitch images, error code = " + (int)status);
                    return;
                }
                stitcher.Dispose(); //处理掉
                t2d = Utils.MatToTexture2D(panoMat);
            }

        Sprite sp = Sprite.Create(t2d, new UnityEngine.Rect(0, 0, t2d.width, t2d.height), Vector2.zero);

        m_dstImage.sprite         = sp;
        m_dstImage.preserveAspect = true;
    }
Example #11
0
        void stitch(String path)
        {
            Stitcher stitcher = Stitcher.Create(Stitcher.Mode.Scans);
            Mat      result   = new Mat();

            try
            {
                var status = stitcher.Stitch(images, result);
                if (status != Stitcher.Status.OK)
                {
                    MessageBox.Show("拼接失败");
                    return;
                }
                else
                {
                    String savepath = path + "/" + "stitch.jpg";
                    Cv2.ImWrite(savepath, result);
                    dealimage(savepath, path);
                }
            }catch (Exception e)
            {
                MessageBox.Show("拼接失败");
            }
        }