Hello. Brand new to perl but have been a PHP guy for many moons. I was led to perlmonks from someone on crunchbang linux forums and I hope someone can help. Yesterday I started getting into opencv for use with my linux box. After some struggling and making the whole thing a couple times, I finally got one of the tutorials to work in C++. But when I try to run a script from perl, it says this:

[Sat Jun 08 17:04:41 2013] [error] [client 192.168.1.1] /usr/bin/perl: + symbol lookup error: /usr/local/lib/perl/5.14.2/auto/Image/ObjectDet +ect/ObjectDetect.so: undefined symbol: cvLoad [Sat Jun 08 17:04:41 2013] [error] [client 192.168.1.1] Premature end +of script headers: open1.pl

I looked and /usr/local/lib/perl/5.14.2/auto/Image/ObjectDetect/OpbjectDetect.so is right there and is read/execute for everyone, plus I've tried running the perl script from cgi-bin and sudo from the command line. I echoed $PERL5LIB var to see what the path was and it was blank. I know perl is working because my other perl starting out tutorials work fine. I added /usr/include and /usr/include/opencv to the path but I don't think that makes a difference. Here is the little script that is supposed to find faces in a picture:

#! /usr/bin/perl use Image::ObjectDetect; my $cascade = 'haarcascade_frontalface_alt2.xml'; my $file = 'picture.jpg'; my $detector = Image::ObjectDetect->new($cascade); @faces = $detector->detect($file); for my $face (@faces) { print $face->{x}, "\n"; print $face->{y}, "\n"; print $face->{width}, "\n"; print $face->{height}, "\n"; }

Easy right? I hope someone can help. I would rather use perl than c++ and skip that whole compilation step.


In reply to How to link to OpenCV goodies for PERL5 by freddythunder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.