Answers for "compile and run c++ program with opencv"

C++
1

how to compile opencv c++ in ubuntu

1 #!/bin/bash
   2 echo "compiling $1"
   3 if [[ $1 == *.c ]]
   4 then
   5     gcc -ggdb `pkg-config --cflags opencv` -o `basename $1 .c` $1 `pkg-config --libs opencv`;
   6 elif [[ $1 == *.cpp ]]
   7 then
   8     g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
   9 else
  10     echo "Please compile only .c or .cpp files"
  11 fi
  12 echo "Output file => ${1%.*}"
Posted by: Guest on May-14-2020
0

opencv compile c++

pkg-config --cflags --libs /path/to/opencv.pc
//to compile opencv code samples
Posted by: Guest on March-30-2020

Code answers related to "compile and run c++ program with opencv"

Browse Popular Code Answers by Language