Sunday, 12 January 2014

Not-so-spontaneous installing of OpenCV

Spontaneous Projects is a chronicle of all of my projects, a reference for me, and a way to prevent others from making the same mistakes. 

I think I've finally succeeded, it still needs some testing with other code, because I don't know how the integrated test programs function, but I think I managed it.

For the first section of this little saga check the older post here.

For the most part I followed these directions from murga-linux

Preparation


First, download and install Lucid Puppy (5.2.8 works)
Then, you need to download the devx file.

Then we need a few PET files, some of the ones in the linked post cause issues, with crashing xwin, or crashing the console somehow. On top of that they don't seem to be needed, it's possible that they are now rolled into the distro or the devx package.

DO NOT get new gtk+ files, they cause the xwin problem, and are not needed.

Download these from http://distro.ibiblio.org/puppylinux/pet_packages-4/
  • ffmpeg-20080731-i486.pet
  • ffmpeg_DEV-20080731-i486.pet
  • libjpeg-6b.pet
  • libpng-1.2.22-patched1-pup4.pet
  • libtiff-3.7.4.pet
  • fontconfig-2.6.0-prescott.pet
  • fontconfig_DEV-2.6.0-prescott.pet
  • x264-20080731-2245-i486.pet 
as well as

Now we add the devx sfs using SFS on-the-fly (Menu>Setup>Setup Puppy)

Back up your save file here, with wireless, a browser, the devx package and everything else needed for basic functionality.

Then install the PET's, just click run, or save and run them later. 

I reboot every now and then, because the xwin issues didn't manifest till the reboot, but given that I 
tracked them to xlib it shouldn't be an issue.

Installing


make the directory where you want OpenCV (</...OpenCV>)

#cd </...OpenCV>
#svn co http://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/trunk .

#cd </...OpenCV>trunk/opencv
#mkdir release
#cd release

#cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..

#make
#make install

#ldconfig -v
#export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
#cd </...OpenCV>/trunk/opencv
#export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

These tests didn't run from terminal, I think they are actually in a different directory. You can find them manually though

#cd </...OpenCV>/opencv/trunk/release/bin
#./cxcoretest
#./cvtest -d </...OpenCV>/trunk/opencv/tests/cv/testdata/cv



I had no failures on the cxcore test, But the cv one had some, likely due to lack of inputs - it also had a segementation fault, so hopefully that isn't problematic.

Update: 13/1/14
I've compiled the samples, so it looks like it's all working as expected.
To run the samples, navigate to

</...OpenCV>/trunk/opencv/sample/c

and open a terminal. For LuPu you need to specify that you wish to use shell, so enter

sh build_all.sh

./edge
./motempl (if you have a webcam)
./ <any other program>
Use Esc to exit any of the samples

motempl in action, from what I can gather it identifies regions that have changed between frames

A little more movement in this one

And lots of movement as I move my hand and wave it about

No comments:

Post a Comment