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
---------------------------------------------------------------------------------------