OpenCV
OpenCV
OpenCV (Open Source Computer Vision Library)[1] is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.
OpenCV in HPC
Request a GPU node
srun --x11 -p gpufermi --gres=gpu:1 -N 1 -c 2 --time=1:00:00 --pty /bin/bash
Load a module
module load opencv
Running OpenCV binaries:
output:
Usage: opencv_createsamples
[-info <collection_file_name>]
[-img <image_file_name>]
...
Compiling and Running
Copy the OPENCV tutorial [2] directory from /usr/local/doc and cd to OPENCV
cp -r /usr/local/doc/OPENCV .
cd OPENCV
You will find the C++ source file " DisplayImage.cpp" and image file " graph.png"
Compile
g++ -o DisplayImage DisplayImage.cpp $(pkg-config --cflags --libs opencv)
If you want to compile using cmake, you need the "CMakeLists.txt" which is also included in OPENCV directory. Issue the following commands:
cmake .
make
Run
./DisplayImage graph.png
You will see the Vertex Cover Graph displayed.
References:
[1] OpenCV Home
[2] OpenCV Tutorial
opencv_createsamples