> How do I get that working on the beagleboard? What about the OpenCV
> libraries and the API? Do I need to translate the code or can I keep
> using functions like cvCaptureFromCam(0) ?
The following thread might be helpful for you:
On Tue, Jul 28, 2009 at 2:20 PM, djlewis<djl...@tcworks.net> wrote:
>
> I believe opencv is now available for opkg install.
> To compile applications for it try...
>
> Building openCV applications on BeagleBoard
>
> assumptions:
> 1) Already have Angstrom 2.6.29 running by following:
> http://elinux.org/BeagleBoardBeginners
>
> 2) ffmpeg is already installed
>
> begin:
>
> 1) run opkg update ( gets latest list of packages )
>
> 2) if you haven't already -
> opkg install task-native-sdk cpp gccmakedep
>
> 3) add python packages with 'opkg install'
> python-distutils, python-compile, python-compiler, python-devel
>
> 4)opkg install ffmpeg-dev
>
> 5) opkg install opencv
> ----------------------------------------------------------------
>
> I modified a script to compile source programs and named it
> compile.sh
>
> use: ./compile.sh source destination
> eg: ./compile capture.c capture
>
> #!/bin/sh
> export LD_LIBRARY_PATH=/usr/local/lib
> echo `pkg-config --cflags opencv`
> echo `pkg-config --libs opencv`
> gcc `pkg-config --cflags opencv` -g -o $2 $1 `pkg-config --libs
> opencv`
> ----------------------------------------------------------------
>
> sample capture.c: opens webcam, saves three files in same folder,
> no arguments needed.
>
> // Capture.c
> //
> // Example showing how to connect to a webcam and capture
> // video frames
> #include </usr/include/opencv/cv.h>
> #include </usr/include/opencv/highgui.h>
> #include </usr/include/opencv/cxcore.h>
> #include "stdio.h"
> #include "string.h"
>
> int main(int argc, char ** argv)
> {
> CvCapture * pCapture = 0;
> IplImage * pVideoFrame = 0;
> int i;
> char filename[50];
>
> //returns the number of available cameras in the system
> // int ncams = cvcamGetCamerasCount( );
> // fprintf(stderr, "Number of cameras: %d\n", ncams);
>
> // Initialize video capture
> // pCapture = cvCaptureFromCAM( CV_CAP_ANY );
> pCapture = cvCaptureFromCAM( -1 );
> if( !pCapture )
> {
> fprintf(stderr, "failed to initialize video capture\n");
> return -1;
> }
>
> // Capture three video frames and write them as files
> for(i=0; i<3; i++)
> {
> pVideoFrame = cvQueryFrame( pCapture );
> if( !pVideoFrame )
> {
> fprintf(stderr, "failed to get a video frame\n");
> }
>
> // Write the captured video frame as an image file
> sprintf(filename, "VideoFrame%d.jpg", i+1);
> if( !cvSaveImage(filename, pVideoFrame) )
> {
> fprintf(stderr, "failed to write image file %s\n", filename);
> }
>
> // IMPORTANT: Don't release or modify the image returned
> // from cvQueryFrame() !
> }
>
> // Terminate video capture and free capture resources
> cvReleaseCapture( &pCapture );
>
> return 0;
> }
> ----------------------------------------------------------
> Launch app with:
>
> export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
>
> (launch on console command line with)
> LD_PRELOAD=/usr/lib/libv4/v4l1compat.so ./capture
>
> or
>
> LD_PRELOAD=/usr/lib/libv4/v4lconvert.so ./capture
>
> one of these two should work for your webcam.
>
> I hope this helps,
> Don Lewis
>
> ---------------------------------------------------------------------------------------
> On Jul 27, 8:10 am, chitresh <saraswat.chitr...@gmail.com> wrote:
>> I am having some problem regarding using opencv library on beagle
>> board. I already booted the beagle board and working on Angstrom
>> environment, I want to use opencv libraries for my project
>> specification and My problem descriptions are:
>>
>> 1. Which complier / cross compiler will be needed for opencv.
>>
>> 2. From where we ll get that complier and steps to install it.
>>
>> 3. I am using "OpenCV_1.0" version on windows, Is their any other
>> version needed for beagle board(Angstrom).
>>
>> 4. Please specify the steps to install / compile the opencv on
>> angstrom.
>>
>> Please specify the steps to run a example program over this.
>>
>> If you are using any other open embedded environment instead of
>> angstrom please tell me the all this steps on that.
HTH,
Andrey.
> Thanks so much....you have no idea how much that helped me out!!
I am glad that it was helpful for you.
> Just one stupid question -- it's not imperative to install the python
> packages right...I mean I have no intention of using any python
> scripts, so I can just skip that step right.
I am not sure. My guess is that Python might be necessary for some GUI
staff. I would suggest to try without Python and see if it works as
you need.
Regards,
Andrey.
>
> I install opencv on BB by "opkg install opencv", but there is no /usr/
> local/lib generated,
No package will create a /usr/local, since that is reserved for local
installs, not system installs like packages.
> and no /usr/lib/libv4/v4l1compat.so
isn't that part of the libv4l package?
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Beagle Board" group.
> To post to this group, send email to discu...@beagleboard.org.
> To unsubscribe from this group, send email to unsub...@beagleboard.org
> For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
As mentioned before in an opencv thread: you need to install the
development packages (e.g. opencv-samples-dev) if you want the headers
as well.
regards,
Koen
Koen,
I got the following msg when running "opkg install opencv-samples-
dev":
root@beagleboard:~# opkg install opencv-samples-dev
Installing opencv-samples-dev (1.0.0+cvs20081115-r2.1) to root...
Downloading
http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv7a/base/opencv-samples-dev_1.0.0+cvs20081115-r2.1_armv7a.ipk
libcxcore-dev: unsatisfied recommendation for python-dev
libtiff-dev: unsatisfied recommendation for libgcc-dev
libglib-2.0-dev: unsatisfied recommendation for gobject-2.0-dev
libglib-2.0-dev: unsatisfied recommendation for gmodule-2.0-dev
libglib-2.0-dev: unsatisfied recommendation for libgcc-dev
......
......
but still no "opencv" folder generated. what's the problem then?
>
> Yes, I installed the python-dev, but still got problem when compiling
> the Capture.c:
>
> root@beagleboard:~# gcc 'pkg-config --cflags opencv' -g -o Capture
> Capture.c 'pkg-config --libs opencv'
> gcc: pkg-config --cflags opencv: No such file or directory
> gcc: pkg-config --libs opencv: No such file or directory
You're using straight quotes instead of backticks, try $(pkg-config --
cflags opencv) to avoid all the quote/tick/etc problems
regards,
Koen