-
[ Introduction to OpenCV ] Load and Display an ImageComputer Vision 2020. 7. 25. 17:01
Load and Display an Image — OpenCV 2.4.13.7 documentation
In OpenCV 2 we have multiple modules. Each one takes care of a different area or approach towards image processing. You could already observe this in the structure of the user guide of these tutorials itself. Before you use any of them you first need to in
docs.opencv.org

#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int main() { Mat img; img = imread("chemnitz.jpg",IMREAD_COLOR); if(!img.data){ cout<<"Could not open or find the image"<<endl; return -1; } imshow("Chemnitz", img); waitKey(0); return 0; }- core section,
: 여기서는 라이브러리의 basic building bloack 이 정의된다.
- highgui module,
: 이것은 input, output operation의 function 이 저장되어있다.
- Mat img;
: 로드된 이미지의 데이터를 저장할 Mat 객체 만들기
- imread ( 이미지 이름, 이미지 형식 )
: 지정된 이미지를 형식에 맞추어 로드하기.
-imshow ( Open CV 창 이름, 작업에 사용할 이미지 지정 )
: Open CV 창의 내용을 새 이미지로 업데이트 한다.
- waitKey( key )
: 사용자가 키를 누를 때 까지 창이 표시된다. 0 은 영원히 기다린다.
'Computer Vision' 카테고리의 다른 글
[The Core Functionality] Mask Operations on Matices (0) 2020.07.25 [The Core Functionality] How to scan Images, Lookup tables with Open CV (0) 2020.07.25 [Introduction to OpenCV] Load, Modify, and Save an Image (0) 2020.07.25 [The Core Functionality] Mat - The Basic Image Container (0) 2020.07.25 X code 에서 Open CV 환경 만들기. (1) 2020.07.25