Last active
December 17, 2015 18:39
-
-
Save ochilab/5655208 to your computer and use it in GitHub Desktop.
OpenCVSharpをインストールしたときに動作確認のために試すコード。公式サイトのコードをそのまま引用し、Matの処理だけ追記してます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This code is quoted from the following URL | |
//http://schima.hatenablog.com/entry/2013/12/15/110513 | |
using (var img = new IplImage(@"C:\OpenCv\Lena.png")) { | |
//Matが使えないケースがたまにあるので、最初に確認しておきましょう | |
Mat mat = new Mat(img); | |
Cv2.ImShow("mat",mat); | |
Cv.SetImageROI(img, new CvRect(200, 200, 180, 200)); | |
Cv.Not(img, img); | |
Cv.ResetImageROI(img); | |
using (new CvWindow(img)) { | |
Cv.WaitKey(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment