2017年10月2日月曜日

表示画像を縮小してみる(Resize)

こんな感じで...

            using (var img = new IplImage(@"C:\Users\hogehohe\Pictures\hoge.png"))  // 画像を読み込み
            {
                CvSize size = new CvSize(img.Width / 2, img.Height / 2);
                IplImage img2 = new IplImage(size,img.Depth, img.NChannels);    // サイズ違いのimgを作成
                Cv.Resize(img, img2);           // リサイズ
                using (new CvWindow(img2))      // ウィンドウを作成して画像を表示
                {
                    Cv.WaitKey();
                }
            }


0 件のコメント:

コメントを投稿