Here is a sample code to read and show an image after converting it into grey scale. Program reads a picture file called boy.jpg in the current folder and displays it. After 1 second it will change to grey scale. Use this command to compile the program. g++ first.cpp `pkg-config --cflags opencv` `pkg-config --libs opencv` where first.cpp is the file name.
A personal blog having my hobby projects.