콘솔프로젝트로 레니영상 로딩하기

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenCvSharp;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            readImage1();

            readImage2();
        }

        private static void readImage2()
        {
            using (var src = new Mat(@"c:\lena512.jpg", ImreadModes.Unchanged))
            {
                using (var window = new Window("Lena_Original", image: src, flags: WindowMode.AutoSize))
                {
                    Cv2.WaitKey();
                }
            }
        }

        private static void readImage1()
        {
            using (var src = new Mat(@"c:\lena512.jpg", ImreadModes.GrayScale))
            {
                using (var window = new Window("Lena_Gray", image: src, flags: WindowMode.AutoSize))
                {
                    Cv2.WaitKey();
                }
            }
        }
    }
}

댓글

이 블로그의 인기 게시물

Draw Circle on PictureBox when Button Click - Winform

2D FFT of Gray Image by AForge