Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: How to install latest openCV from source in openSuse 64

  1. #1

    Default How to install latest openCV from source in openSuse 64

    Hi,

    I'm a new user of openSuse, I think that it is a great distribution. I'm an old Ubuntu user and I have to learn many things about the difference between them. When I was in Ubuntu I found a very useful script to build openCV from source. The script is the following:

    Code:
    version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9])+' | cut -c2-)"
    echo "Installing OpenCV" $version
    mkdir OpenCV
    cd OpenCV
    echo "Removing any pre-installed ffmpeg and x264"
    sudo apt-get -qq remove ffmpeg x264 libx264-dev
    echo "Installing Dependenices"
    sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
    echo "Downloading OpenCV" $version
    wget -O OpenCV-$version.tar.gz http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$version/opencv-"$version".tar.gz/download
    echo "Installing OpenCV" $version
    tar -xvf OpenCV-$version.tar.gz
    cd opencv-$version
    mkdir build
    cd build
    cmake -D CMAKE_BUILD_TYPE=RELEASE -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 -j2
    sudo make install
    sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
    sudo ldconfig
    echo "OpenCV" $version "ready to be used"
    I can reuse all the part except the following:

    Code:
    echo "Removing any pre-installed ffmpeg and x264"
    sudo apt-get remove ffmpeg x264 libx264-dev
    echo "Installing Dependencies"
    sudo apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
    Can you provide me the corresponding command package in openSuse?

    Code:
    echo "Removing any pre-installed ffmpeg and x264"
    sudo zypper remove ffmpeg x264 libx264-dev
    echo "Installing Dependencies"
    sudo zypper install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
    Thank you very much
    Best Regards

  2. #2

    Default Re: How to install latest openCV from source in openSuse 64

    3 points.

    1. You do know you can simply install opencv using YaST's Software Manager since it's located in the OSS repo (which is
    enabled by default). Or you can use zypper:

    Code:
    sh-4.2$ su -c "zypper in opencv"
    2. Unlike Ubuntu, openSUSE is not obssessed by `sudo': if you going to run a script that installs software, you shouldn't
    need to begin any line with `sudo' because you can simply run your installation script in openSUSE thus...

    Code:
    sh-4.2$ su -c "sh yourscript.sh"
    .... obviating the need for `sudos' inside your script.

    3. The default package installations for Ubuntu and openSUSE differ and by switching defaults, you can't assume that the
    dependency are going to fulfilled identically between the distributions. If you really want to install from source, you
    should read the dependencies of opencv that should be listed on the SourceForge site. But I really think it's a lot
    easier to install with dependencies auto-installed using YaST or zypper (see Point 1).


  3. #3

    Default Re: How to install latest openCV from source in openSuse 64

    Quote Originally Posted by flymail View Post
    3 points.

    1. You do know you can simply install opencv using YaST's Software Manager since it's located in the OSS repo (which is
    enabled by default). Or you can use zypper:

    Code:
    sh-4.2$ su -c "zypper in opencv"
    2. Unlike Ubuntu, openSUSE is not obssessed by `sudo': if you going to run a script that installs software, you shouldn't
    need to begin any line with `sudo' because you can simply run your installation script in openSUSE thus...

    Code:
    sh-4.2$ su -c "sh yourscript.sh"
    .... obviating the need for `sudos' inside your script.

    3. The default package installations for Ubuntu and openSUSE differ and by switching defaults, you can't assume that the
    dependency are going to fulfilled identically between the distributions. If you really want to install from source, you
    should read the dependencies of opencv that should be listed on the SourceForge site. But I really think it's a lot
    easier to install with dependencies auto-installed using YaST or zypper (see Point 1).
    Thank you for your reply. I'm interested about installing openCV from source since I want to add custom codecs and custom compiling options. I'm trying to achieve this in all major distributions. I started with Debian, Ubuntu and Mint and Fedora. Now I want to do this with openSuse.

    Code:
    echo "Removing any pre-installed ffmpeg and x264"
    su -c "zypper remove ffmpeg x264 libx264-dev"
    echo "Installing Dependencies"
    su -c "zypper install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg"
    What I need is a way to locate the corresponding packages in openSUSE. For instance in Ubuntu the command to find a package is apt-cache search name while in Fedora is yum list *name*.
    How can I do this in openSuse?

    Thank you

  4. #4

    Default Re: How to install latest openCV from source in openSuse 64

    On 2014-01-24, erotavlas <erotavlas@no-mx.forums.opensuse.org> wrote:
    > What I need is a way to locate the corresponding packages in openSUSE.
    > For instance in Ubuntu the command to find a package is apt-cache search
    > name while in Fedora is yum list *name*.
    > How can I do this in openSuse?
    >
    > Thank you


    Code:
    sh-4-2$ su -c "zypper se *name*"

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,775

    Default Re: How to install latest openCV from source in openSuse 64

    Quote Originally Posted by erotavlas View Post
    What I need is a way to locate the corresponding packages in openSUSE. For instance in Ubuntu the command to find a package is apt-cache search name while in Fedora is yum list *name*.
    How can I do this in openSuse?

    Thank you
    I assume your starting point is
    Code:
    man zypper
    Henk van Velden

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to install latest openCV from source in openSuse 64

    On 2014-01-24 11:46, erotavlas wrote:

    > Thank you for your reply. I'm interested about installing openCV from
    > source since I want to add custom codecs and custom compiling options.
    > I'm trying to achieve this in all major distributions. I started with
    > Debian, Ubuntu and Mint and Fedora. Now I want to do this with openSuse.


    You could consider then the open buildservice. You get an account, and
    build there your package for several distributions. Caveat: those codecs
    have to be entirely legal (on the USA, I think).

    >
    >
    > Code:
    > --------------------
    >
    > echo "Removing any pre-installed ffmpeg and x264"
    > su -c "zypper remove ffmpeg x264 libx264-dev"
    > echo "Installing Dependencies"
    > su -c "zypper install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg"
    >
    >
    > --------------------


    Calling "su" or "sudo" often inside a script causes it to be requesting
    the root password every time. This is highly inconvenient. Normally I
    would expect to run such a script simply by root directly.

    After all, it is the administrator who does maintenance tasks, not the
    users.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  7. #7

    Default Re: How to install latest openCV from source in openSuse 64

    Ok with the command zypper se *name* I have found the majority of the libraries. The following libraries are not present in the repositories. Some of them are not open and in the other distributions I added non-free repositories to get them.
    Code:
    pkgconfig ffmpeg x264 libavformat libavfilter libavdevice libavcodec tbb libfaac libmp3lame libamrnb libopencore-amrnb0 libopencore-amr-devel libxvidcore-devel
    What are the repository in case of openSUSE?

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,775

    Default Re: How to install latest openCV from source in openSuse 64

    This being in the Multimedia forums, did you read the stickies at the top og the threads in this forum?
    Henk van Velden

  9. #9

    Default Re: How to install latest openCV from source in openSuse 64

    Quote Originally Posted by erotavlas View Post
    Ok with the command zypper se *name* I have found the majority of the libraries. The following libraries are not present in the repositories. Some of them are not open and in the other distributions I added non-free repositories to get them.
    Code:
    pkgconfig ffmpeg x264 libavformat libavfilter libavdevice libavcodec tbb libfaac libmp3lame libamrnb libopencore-amrnb0 libopencore-amr-devel libxvidcore-devel
    What are the repository in case of openSUSE?
    "pkgconfig" is called "pkg-config" in openSUSE (part of the standard repo of course).

    The rest is available in the Packman repo, _the_ standard repo for Multimedia on openSUSE:
    http://packman.links2linux.de/

    PS: I overlooked "tbb", sorry. No idea what that would be though, and therefore I don't know where to get it either.
    PPS: Well, it's available here:
    http://software.opensuse.org/package/tbb
    But I guess you would need libtbb2 and tbb-devel, since tbb seems to be only the name of the src rpm.
    http://software.opensuse.org/package/libtbb2
    Anyway, I would suggest to use that repo for tbb:
    http://download.opensuse.org/reposit...raries:/c_c++/

  10. #10

    Default Re: How to install latest openCV from source in openSuse 64

    Hmmm. 3 more points.

    1. See hcvv's comments.
    2. Be grateful to wolfi323 for his searching for you.
    3. Familiarise yourself with http://software.opensuse.org/search?...=openSUSE:13.1


Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •