0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

OpenCVの初めてのプログラム

Last updated at Posted at 2020-11-02

##OpenCVの使い方

  1. 前回紹介した記事では、DebugとReleaseを決めてしまっているので次のコードを追加させるとうまくいくと思います。opencv_world430d.libの数字はダウンロードしたバージョンに変更してください。
#if _DEBUG
#pragma comment(lib,"opencv_world430d.lib")
#else
#pragma comment(lib,"opencv_world430.lib")
#endif;

2.とりあえずは次の2つをインクルードさせましょう。

#include<opencv2/opencv.hpp>
#include <iostream>

##超シンプル画像を表示させるだけのプログラム

パスは人によって違うので、随時更新しましょう。この段階で動かなければ設定が違うかも、、
ここのコードの説明は次回します。

#include <opencv2/opencv.hpp>
#include<iostream>

#if _DEBUG
#pragma comment(lib,"opencv_world430d.lib")
#else
#pragma comment(lib,"opencv_world430.lib")
#endif

using namespace cv;	

int main() {


	Mat img = imread("C:\\opencv\\sources\\samples\\data\\lena.jpg");

	imshow("View", img);

	waitKey();

	return 0;


}
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?