Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Inline::CPP + OpenCV = problemsby bliako (Monsignor) |
on Nov 19, 2019 at 22:21 UTC ( [id://11108912]=perlquestion: print w/replies, xml ) | Need Help?? |
bliako has asked for the wisdom of the Perl Monks concerning the following question: Esteemed Monks, I wanted to experiment with calling OpenCV v4.1.2 C++-api functions from within Perl via Inline::CPP I have encountered a couple of problems, the last of which is insurmountable to me. The first problem is that OpenCV defines a seed(unsigned s) function in /usr/local/include/opencv4/opencv2/core.hpp which conflicts with Perl's seed macro. That can be overcome by adding #undef seed at the top of my CPP section (see https://github.com/Leont/libperl--/issues/5). Although it passes that, it's no good news at all. The second problem is that OpenCV uses internally the namespace cv (e.g. /usr/local/include/opencv4/opencv2/core/cvdef.h) which conflicts with Perl's struct cv in perl5/CORE/sv.h. Any ideas or is that the end of the road for my efforts? CPAN module Cv has not been updated since 2013 and is based on a very outdated OpenCV C-api (it includes #include <opencv/cv.h>) which no longer exists in version 3 or 4 of OpenCV. Just mentioning that that's not an option ... Here is a sample code
Many thanks, bliako Update: added corrected cv::imread to sample code
Back to
Seekers of Perl Wisdom
|
|