OPENCV READ IMAGE AND VIDEO

A GATEWAY TO ROBOTIC VISION

AUTHORS:ABHISHEK KUMAR ANNAMRAJU,AKASH DEEP SINGH,ADHESH SHRIVASTAVA

Hi Friends,

Lets look into a way of opening image/video/camera with opencv

Reading an image:-

1)Create a new  c++ file (eg-open_image.cpp )

2)Code(copy the code in the file):-

Click once somewhere on the code and press ctrl+A to select whole code.You may not see the whole code so its better to copy the code and paste it in your favourite text editor and then go through it.

3)Compiling and Executing:-
Open a terminal and change the directory to where the file is present and type

a)chmod +x FILENAME.cpp

Note:FILENAME is the name given to the file,use the one you used

b)g++ -ggdb `pkg-config --cflags opencv` -o `basename FILENAME.cpp .cpp` FILENAME.cpp `pkg-config --libs opencv`
c)./FILENAME

Reading a video/camera input:-

1)Create a new  c++ file (eg-open_image.cpp )

2)Code(copy the code in the file):-

 #include <highgui.h> CvCapture* capture = NULL; int main( int argc, char** argv )…

View original post 150 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s