130 likes | 138 Views
This introduction provides information on the tools, compilers, languages, and libraries used in visual information processing, including OpenCV and CImg. It also covers platforms such as Windows, Linux, and Mac OS.
E N D
CS455/555Introduction to Visual Information Processing TA: Huiyuan Yang Office Hour: Tuesday and Friday 10:00am-11:00am
tools Edit tools Compiler language • C++ • Java • Python • Matlab • VS • Vim • Sublime • VS • g++ Library OpenCV CImg etc Platform Windows Linux Mac OS
load Image • save Image • edit Image
OpenCV • OpenCV (Open Source Computer Vision Library) is a cross-platform computer vision library. • Windows, Linux, MacOS, IOS and Android • C++, Python, Java interfaces. https://opencv.org
Compile with OpenCV on Linux • g++ -o binary main.cpp\ • -I/usr/local/include/opencv2 \ • -L/usr/local/lib/ \ • -lopencv_core \ • -lopencv_imgproc \ • -lopencv_highgui
Load and save image using OpenCV • { • … • Mat image; • image =imread( img_filename, 1 ); • Mat gray_image; • cvtColor( image, gray_image, CV_BGR2GRAY ); • imwrite( "../../images/Gray_Image.jpg", gray_image ); • … • }
CImg • The Cimg library is a small and open-source c++ toolkit for image processing. • Works on different operating systems. • Light-weight(only 15Mb) http://cimg.eu
Compile Cimg on Linux: g++ -o out *.cpp–o2 –L/*/X11/lib –lX11 -lm –lpthread Compile Cimg on Macos: g++ -o out *.cpp–o2 –l/*/X11/include –L/*/X11/lib –lX11 -lm –lpthread
Load and save image using CImg • { • … • CImg<unsigned char> image("lena.jpg"); • image.blur(2.5); • // more operations. • image.save(save_filename) • … • }
Demo for Visual Studio Programming To use Cimg on Visual Studio: Download the latest version of Cimg and Unzip it; Open VS, and build a new Win32 Console application Add include directories: project -> properties -> VC++ directories ->included directories -> path_to_Cimg. Open a C++ file, and add include “CImg.h” Implement your own code now…