Setup of OpenCV 2.4.9

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Setup of OpenCV 2.4.9

eldk
Hello,

I've check and modify an old script to build and install OpenCV-2.4.9:

http://askubuntu.com/questions/346264/does-the-version-of-opencv-shipped-with-12-04-support-v4l2

The modify script for openCV 2.4.9 on ubuntu 12.04 :

1 - create an empty folder in you home directory
2 - create the script in the empty folder and make it executable
3 - launch it with ./nameofscript.sh


#####Begin of script
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o
"$arch" == "i586" ]; then
flag=1
else
flag=0
fi
echo "Installing OpenCV 2.4.9"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -y remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get -y install libopencv-dev
sudo apt-get -y install build-essential checkinstall cmake pkg-config
yasm
sudo apt-get -y install libtiff4-dev libjpeg-dev libjasper-dev
sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev
libdc1394-22-dev libxine-dev libgstreamer0.10-dev
libgstreamer-plugins-base0.10-dev libv4l-dev
sudo apt-get -y install python-dev python-numpy
sudo apt-get -y install libtbb-dev
sudo apt-get -y install libqt4-dev libgtk2.0-dev
sudo apt-get -y install libfaac-dev libmp3lame-dev libopencore-amrnb-dev
libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev
sudo apt-get -y install x264 v4l-utils ffmpeg
echo "Downloading OpenCV 2.4.9"
wget -O OpenCV-2.4.9.zip
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
echo "Installing OpenCV 2.4.9"
unzip OpenCV-2.4.9.zip
cd opencv-2.4.9
mkdir build
cd build
######
#uncomment next lines to let it do itself, for intel pentium M (no SSE3
#- you have to edit
#home/your_user/YourFolderforOpenCV/OpenCV/opencv-2.4.9/CMakeLists.txt
#and put line 215 for SSE3 to OFF) # END OF COMMENT
#######
#cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local -D
WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D
INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON
-D WITH_QT=ON -D WITH_OPENGL=ON ..
#make -j4
#sudo make install
#sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
#sudo ldconfig
#echo "OpenCV 2.4.9 ready to be used"
#end of script
######

I have check it with TAR and repository digikam 4.1.0 : no trouble.
(except for SSE3, I work with a pentium M - see comments in script)

If you use kubuntu-backport, you will have to remove OpenCV 2.4.5
packages before compiling digikam 4.1.0.

If you want tu use internal libpgf, you have to uninstall libpgf package
too, before compiling digikam.

Greatings,

Eric







_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Setup of OpenCV 2.4.9

Gilles Caulier-4
2014-07-06 18:42 GMT+02:00 eric <[hidden email]>:

> Hello,
>
> I've check and modify an old script to build and install OpenCV-2.4.9:
>
> http://askubuntu.com/questions/346264/does-the-version-of-opencv-shipped-with-12-04-support-v4l2
>
> The modify script for openCV 2.4.9 on ubuntu 12.04 :
>
> 1 - create an empty folder in you home directory
> 2 - create the script in the empty folder and make it executable
> 3 - launch it with ./nameofscript.sh
>
>
> #####Begin of script
> arch=$(uname -m)
> if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o
> "$arch" == "i586" ]; then
> flag=1
> else
> flag=0
> fi
> echo "Installing OpenCV 2.4.9"
> mkdir OpenCV
> cd OpenCV
> echo "Removing any pre-installed ffmpeg and x264"
> sudo apt-get -y remove ffmpeg x264 libx264-dev
> echo "Installing Dependenices"
> sudo apt-get -y install libopencv-dev
> sudo apt-get -y install build-essential checkinstall cmake pkg-config
> yasm
> sudo apt-get -y install libtiff4-dev libjpeg-dev libjasper-dev
> sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev
> libdc1394-22-dev libxine-dev libgstreamer0.10-dev
> libgstreamer-plugins-base0.10-dev libv4l-dev
> sudo apt-get -y install python-dev python-numpy
> sudo apt-get -y install libtbb-dev
> sudo apt-get -y install libqt4-dev libgtk2.0-dev
> sudo apt-get -y install libfaac-dev libmp3lame-dev libopencore-amrnb-dev
> libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev
> sudo apt-get -y install x264 v4l-utils ffmpeg
> echo "Downloading OpenCV 2.4.9"
> wget -O OpenCV-2.4.9.zip
> http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
> echo "Installing OpenCV 2.4.9"
> unzip OpenCV-2.4.9.zip
> cd opencv-2.4.9
> mkdir build
> cd build
> ######
> #uncomment next lines to let it do itself, for intel pentium M (no SSE3
> #- you have to edit
> #home/your_user/YourFolderforOpenCV/OpenCV/opencv-2.4.9/CMakeLists.txt
> #and put line 215 for SSE3 to OFF) # END OF COMMENT
> #######
> #cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local -D
> WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D
> INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON
> -D WITH_QT=ON -D WITH_OPENGL=ON ..
> #make -j4
> #sudo make install
> #sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
> #sudo ldconfig
> #echo "OpenCV 2.4.9 ready to be used"
> #end of script
> ######
>
> I have check it with TAR and repository digikam 4.1.0 : no trouble.

When you said, no trouble do you tried to use all options from Face Management ?

Because a wrong setup of OpenCV can introduce crashes here. I just
experienced a lots this situation with Windows installer, where i
reduced OpenCV to minimal setup.

In fact after to lost few days with this library, i can said that
OpenCV is a big puzzle with a bad architecture. A wrong option can
have a weird effect at run-time.

So, packagers, please TAKE A CARE.

I currently try to identify which OpenCV component is mandatory to run
face management algorithms safety. It's long and fastidious : OpenCV
has around 30 components optional at compilation time. It's really a
mess.

Gilles Caulier
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Setup of OpenCV 2.4.9

eldk
Hello,

I haven't check facemanagement yet, I was meaning : I should install
digikam 4.1.0 (And just finish with 4.2.0) without warnings on openCV.

I will check facemanagement in next days and weeks.

I've done this because I'm currently working with Digikam 3.5.0 and
notice a huge use of database (mysql) as soon as I start digikam : a lot
of thread are permanents one (I optimise Mysql for other purpose). So
yesterday I decide to check if it was the same with more recent version
of digikam and have the alert message on OpenCV version when build
digikam.

Greatings,

Eric


> > I have check it with TAR and repository digikam 4.1.0 : no trouble.
>
> When you said, no trouble do you tried to use all options from Face Management ?
>
> Because a wrong setup of OpenCV can introduce crashes here. I just
> experienced a lots this situation with Windows installer, where i
> reduced OpenCV to minimal setup.
>
> In fact after to lost few days with this library, i can said that
> OpenCV is a big puzzle with a bad architecture. A wrong option can
> have a weird effect at run-time.
>
> So, packagers, please TAKE A CARE.
>
> I currently try to identify which OpenCV component is mandatory to run
> face management algorithms safety. It's long and fastidious : OpenCV
> has around 30 components optional at compilation time. It's really a
> mess.
>
> Gilles Caulier
> _______________________________________________
> Digikam-users mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-users


_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Setup of OpenCV 2.4.9

Remco Viëtor
In reply to this post by Gilles Caulier-4
On Sunday 06 July 2014 19:06:13 Gilles Caulier wrote:

> When you said, no trouble do you tried to use all options from Face
Management ?

>
> Because a wrong setup of OpenCV can introduce crashes here. I just
> experienced a lots this situation with Windows installer, where i
> reduced OpenCV to minimal setup.
>
> In fact after to lost few days with this library, i can said that
> OpenCV is a big puzzle with a bad architecture. A wrong option can
> have a weird effect at run-time.
>
> So, packagers, please TAKE A CARE.
>
> I currently try to identify which OpenCV component is mandatory to run
> face management algorithms safety. It's long and fastidious : OpenCV
> has around 30 components optional at compilation time. It's really a
> mess.
>
> Gilles Caulier
> _______________________________________________
> Digikam-users mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-users

In that case, is it possible to completely eliminate the dependency on
OpenCV (and losing the face management algorithms, of course)?

For me personally, the face recognition is not important, so if I can get a
more stable Digikam without it, that would be nice.

Remco
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users
Reply | Threaded
Open this post in threaded view
|

Re: Setup of OpenCV 2.4.9

Gilles Caulier-4
2014-07-06 20:22 GMT+02:00 Remco Viëtor <[hidden email]>:
> On Sunday 06 July 2014 19:06:13 Gilles Caulier wrote:
>
>> When you said, no trouble do you tried to use all options from Face
> Management ?
>>
>> Because a wrong setup of OpenCV can introduce crashes here. I just
>> experienced a lots this situation with Windows installer, where i
>> reduced OpenCV to minimal setup.

no. It's too complicated i think. I know that an entry exist in
bugzilla about this topic, but MArcel (other lead digiKam developer)
is not favorable to drop Face Management feature using optional
compilation.

After all, as it's said, if there are crashes, there are only located
to Face Management tool. Do use it...

But as i said previouly, now i know the source of the problem.

- It's a packaging problem.
- It's an UPSTREAM dysfunction fully relevant of OpenCV library.

See my story in this bugzilla comment :

https://bugs.kde.org/show_bug.cgi?id=336650#c3

This problem must be urgently reported to OpenCV team, and problem
must be fixed...

I also fixed a lots of code into libkface to obtain a more robust Face
management background interface for KDE. libkface is the shared lib
used by digiKam to play with face management and all OpenCV API are
called in this library.

So, i can said that future will be really more stable about Face Management...

Gilles Caulier
_______________________________________________
Digikam-users mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-users