Skip to content

Instantly share code, notes, and snippets.

@byBretema
Last active February 9, 2017 15:36
Show Gist options
  • Save byBretema/80286f05b58503ffff6d to your computer and use it in GitHub Desktop.
Save byBretema/80286f05b58503ffff6d to your computer and use it in GitHub Desktop.
Quick compile your OpenCV (in C/C++) project.
#!/usr/bin/env bash
# -*- encoding: utf-8 -*-
gcc *.c -o cv_bin `pkg-config --libs --cflags opencv` -ldl -lm;
shift; ./cv_bin $*;

A smooth way to compile openCV C-based code.

Call example:

bash gcv.sh a_cv_main_file.c img1 img2 vid1

You can rename "gcv.sh" to "gcv" add it to the path and use like native compiler:

gcv a_cv_main_file.c img1 img2 vid1

To do it:

mv gcv.sh gcv
cp gcv /usr/bin
# Enjoy !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment