Can't install CentOS 7 opencv 2.4

Added by J C about 5 years ago

I'm trying to install on CentOS 7 with opencv 2.4. I get errors in the AMC-detect.cc
AMC-detect.cc:574:51: error: ‘FILLED’ is not a member of ‘cv’
and
AMC-detect.cc:603:82: error: ‘LINE_AA’ is not a member of ‘cv’

I see that in the AMC-detect.cc there are definitions of opencv 2, 2.1, 2.3, and 3, but not 2.4.

Is this just not compatible with opencv 2.4?


Replies (3)

RE: Can't install CentOS 7 opencv 2.4 - Added by Alexis Bienvenüe about 5 years ago

Maybe there is a problem with 2.4.
You can try to remove all cv::LINE_AA last arguments of line, and also cv:FILLED. For example,

cv::line(illustr, coins_int[i], coins_int[(i+1)%4], BLEU, 1, cv::LINE_AA);

becomes

cv::line(illustr, coins_int[i], coins_int[(i+1)%4], BLEU, 1);

RE: Can't install CentOS 7 opencv 2.4 - Added by J C about 5 years ago

It works! Here's a list of things I had to do for others who want a CentOS 7 install.

Had to install:
cairo-devel
poppler-glib-devel
pango-devel
gtk3-devel

If you're having issues, check the Makefile and make sure you get proper outputs from all the pkg-config commands, otherwise your libraries aren't going to link properly and things are going to die.

E.g.: 'pkg-config --cflags --libs cairo pangocairo poppler-glib'

After that I got a bunch of errors from pdfformfields.c: loop initial declarations are only allowed in C99 mode.
I tried setting CFLAGS=-std=c99 in the Makefile, but it still failed.

Changed the offending lines from:
for (int i = 1; i < argc; i++)
to
int i;
for (i = 1; i < argc; i++)

Allowed it to compile and install.

At this point the executable fails with:
/bin/auto-multiple-choice: line 25: use: command not found
/bin/auto-multiple-choice: line 26: use: command not found
/bin/auto-multiple-choice: line 28: =/MODSDIR/: No such file or directory
/bin/auto-multiple-choice: line 29: {LC_NUMERIC}=C: command not found
/bin/auto-multiple-choice: line 31: sub: command not found
/bin/auto-multiple-choice: line 32: syntax error near unexpected token `$action'
/bin/auto-multiple-choice: line 32: ` my ($action)=@_;'

You must edit the #! /PERLPATH/ on line 1 of the auto-multiple-choice executable.
In my case: #! /bin/perl

and

$mods_dir="/MODSDIR/";

In my case:
$mods_dir="/usr/lib/AMC";

Then I played whack-a-mole on missing perl modules:
perl-Gtk3
perl-XML-Simple
perl-Archive-Tar
perl-Locale-Codes
perl-Module-Load
perl-Module-Load-Conditional
perl-gettext
perl-XML-Writer
perl-Archive-Zip
perl-DBI
perl-Text-CSV
ImageMagick-perl

RE: Can't install CentOS 7 opencv 2.4 - Added by J C about 5 years ago

Alexis Bienvenüe wrote:

Maybe there is a problem with 2.4.
You can try to remove all cv::LINE_AA last arguments of line, and also cv:FILLED. For example,

cv::line(illustr, coins_int[i], coins_int[(i+1)%4], BLEU, 1, cv::LINE_AA);

becomes

cv::line(illustr, coins_int[i], coins_int[(i+1)%4], BLEU, 1);

This works to clear the errors listed in the original post.

(1-3/3)