Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created September 30, 2016 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochilab/858d616b1a18e38f7a9263391a3559cb to your computer and use it in GitHub Desktop.
Save ochilab/858d616b1a18e38f7a9263391a3559cb to your computer and use it in GitHub Desktop.
OpenCVSharp3対応のはじめの動作確認
/*
* 以下、OpenCVSharp3対応です
*/
//画像ファイル読み込み
Mat img = new Mat(@"C:\Users\ochi\Documents\temp\test.png");
Mat img2 = img.Clone();
Mat img3 = img.Clone();
//トリミング(ROI)
img3 = img3[new OpenCvSharp.Rect(200, 200, 180, 200)];
//表示
Cv2.ImShow("img", img);
Cv2.ImShow("img3", img3);
//反転
Cv2.BitwiseNot(img2, img2);
Cv2.ImShow("img2", img2);
Cv2.WaitKey();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment