opencv start up · installation read and display a image opencv start up dr. praveen sankaran...
TRANSCRIPT
InstallationRead and Display a Image
OpenCV Start UP
Dr. Praveen Sankaran
Department of ECE
NIT Calicut
January 29, 2013
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
Outline
1 InstallationOpenCVcmake
2 Read and Display a Image
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
OpenCV
There is nothing here that you couldn't have obtained from a bit ofan on-line search. But, as usual, I will pamper all of you with thesedetails.
Source: http://opencv.org/
Version does not really matter for us, since we will mostly belooking at very basic image processing functionalities.
Version 2.3 seems good enough (seems like a major changefrom 2.1 to 2.3).
Ubuntu 12.04 LTS recommended since it comes with OpenCV2.3 in the repositories.
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Outline
1 InstallationOpenCVcmake
2 Read and Display a Image
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Installation Synaptic - Ubuntu
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Installation OpenCV from Synaptic
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Installation OpenCV from Synaptic
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
From Terminal
sudo apt-get install libopencv-dev
will install 2.3 on 12.04LTS.
You will have to go back to synaptic and install some missinginstallations anyway.
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Check
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Outline
1 InstallationOpenCVcmake
2 Read and Display a Image
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
OpenCVcmake
Install
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
Read Image Program from OpenCV docs
#i n c l u d e <cv . h>#i n c l u d e <h i g h gu i . h>
u s i n g namespace cv ;
i n t main ( i n t argc , cha r ∗∗ a rgv ){
Mat image ;image = imread ( a rgv [ 1 ] , 1 ) ;
i f ( a rgc != 2 | | ! image . data ){
p r i n t f ( "No image data \n" ) ;r e t u r n −1;
}
namedWindow( " D i s p l a y Image " , CV_WINDOW_AUTOSIZE ) ;imshow ( " D i s p l a y Image " , image ) ;
waitKey ( 0 ) ;
r e t u r n 0 ;}
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
Working Folder at this Stage
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
CMakeLists.txt
p r o j e c t ( openCvDispa ly Image )f ind_package ( OpenCV REQUIRED )add_executab le ( d i sp Image d i sp Image )t a r g e t_ l i n k_ l i b r a r i e s ( openCvDispa ly Image$ {OpenCV_LIBS})
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
CMake
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
Make
Dr. Praveen Sankaran DIP Winter 2013
InstallationRead and Display a Image
Running
Dr. Praveen Sankaran DIP Winter 2013