Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to link to OpenCV goodies for PERL5

by hbm (Hermit)
on Jun 09, 2013 at 13:49 UTC ( #1037932=note: print w/replies, xml ) Need Help??

in reply to How to link to OpenCV goodies for PERL5

I looked and /usr/local/lib/perl/5.14.2/auto/Image/ObjectDetect/ is right there and is read/execute for everyone

The trouble is, "cvLoad" is not defined, right?

/usr/bin/nm -n /usr/local/lib/perl/5.14.2/auto/Image/ObjectDetect/Obje |grep -i cvload

How did you install Image::ObjectDetect? Review the 'make' output for clues. If you didn't capture it, you can run 'Makefile.PL' and 'make' manually against the source. Also check the module's bug reports on CPAN.

And a suggestion for your printing:

print join "\n", $face->{x}, $face->{y}, $face->{width}, $face->{height};

Replies are listed 'Best First'.
Re^2: How to link to OpenCV goodies for PERL5
by freddythunder (Novice) on Jun 09, 2013 at 16:54 UTC

    I ran /usr/bin/nm and it reads that cvLoad and cvLoadImage are Undefined. That can't be good.

    I originally loaded opencv via the instructions at opencv and then later followed the instructions found here:

    I tried cpan Image::ObjectDetect again and it tells me that it is installed and up to date.

    I would try to make manually against the source, but I don't know where the source is. I found this to help me:

    When I google for more information I get this thread...

    Thanks for your help, I will change the printing if it ever works ;)

      When you install modules with CPAN, the source is first downloaded to your .cpan directory - should be in the home directory of whatever account you installed with.

      1. 'find' or 'locate' the source (under the author)
      2. Change to that directory
      3. /path/to/perl Makefile.PL
      4. make > make.log 2>&1

      Hopefully make.log will then get you closer to the root cause.

        Thank you for your help. I did what you said and here is what was outputted into make.log:

        freddythunder@tacofever:~/cpan/objdetectsrc$ more make.log cp lib/Image/ blib/lib/Image/ cp lib/Image/ObjectDetect.xs blib/lib/Image/ObjectDetect.xs /usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/shar +e/perl/5.14/ExtUtils/typemap ObjectDetect.xs > ObjectDetect.xsc && m +v ObjectDetect. xsc ObjectDetect.c cc -c -I/usr/local/include/opencv -I/usr/local/include -Isrc -I/usr +/local/include/opencv -I/usr/local/include -O2 -g -DVERSION=\"0.1 +2\" -DXS_VERSIO N=\"0.12\" -fPIC "-I/usr/lib/perl/5.14/CORE" ObjectDetect.c Running Mkbootstrap for Image::ObjectDetect () chmod 644 rm -f blib/arch/auto/Image/ObjectDetect/ cc -shared -L/usr/local/lib -fstack-protector ObjectDetect.o -o blib +/arch/auto/Image/ObjectDetect/ \ \ chmod 755 blib/arch/auto/Image/ObjectDetect/ cp blib/arch/auto/Image/ObjectDetect/ chmod 644 blib/arch/auto/Image/ObjectDetect/ Manifying blib/man3/Image::ObjectDetect.3pm

        I also had read somewhere about 'make test' which I remember the output of that happening before (but I don't remember at what point) but the test fails:

        freddythunder@tacofever:~/cpan/objdetectsrc$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00_compile.t .. 1/2 # Failed test 'use Image::ObjectDetect;' # at t/00_compile.t line 7. # Tried to use 'Image::ObjectDetect'. # Error: Can't load '/home/freddythunder/cpan/objdetectsrc/blib/a +rch/auto/Image/ObjectDetect/' for module Image::Object +Detect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Image/Ob +jectDetect/ undefined symbol: cvHaarDetectObjects at +/usr/lib/perl/5.14/ line 184. # at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetec line 19 # BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdet +ectsrc/blib/lib/Image/ line 19. # Compilation failed in require at (eval 4) line 2. # BEGIN failed--compilation aborted at (eval 4) line 2. # Failed test 'Image::ObjectDetect->can('xs_detect')' # at t/00_compile.t line 8. # Image::ObjectDetect->can('xs_detect') failed # Looks like you failed 2 tests of 2. t/00_compile.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/2 subtests t/01_detect.t ... Can't load '/home/freddythunder/cpan/objdetectsrc/bl +ib/arch/auto/Image/ObjectDetect/' for module Image::Ob +jectDetect: /home/freddythunder/cpan/objdetectsrc/blib/arch/auto/Imag +e/ObjectDetect/ undefined symbol: cvHaarDetectObjects + at /usr/lib/perl/5.14/ line 184. at /home/freddythunder/cpan/objdetectsrc/blib/lib/Image/ObjectDetect. +pm line 19 BEGIN failed--compilation aborted at /home/freddythunder/cpan/objdetec +tsrc/blib/lib/Image/ line 19. Compilation failed in require at t/01_detect.t line 5. BEGIN failed--compilation aborted at t/01_detect.t line 5. t/01_detect.t ... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- t/00_compile.t (Wstat: 512 Tests: 2 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 t/01_detect.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=2, Tests=2, 0 wallclock secs ( 0.09 usr 0.02 sys + 0.14 cusr + 0.04 csys = 0.29 CPU) Result: FAIL Failed 2/2 test programs. 2/2 subtests failed. make: *** [test_dynamic] Error 255

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1037932]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2021-09-27 14:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found