﻿{"id":883,"date":"2012-06-17T17:43:43","date_gmt":"2012-06-17T09:43:43","guid":{"rendered":"http:\/\/nick.workao.org\/?p=883"},"modified":"2012-06-17T18:14:39","modified_gmt":"2012-06-17T10:14:39","slug":"install-opencv-2-4-on-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/nick.txtcc.com\/index.php\/linux\/883","title":{"rendered":"Install OpenCV 2.4 on Ubuntu 12.04"},"content":{"rendered":"<p>If you\u2019re going to process live streams from cameras or videos, the most important library needed for OpenCV is ffmpeg. You can find a good tutorial on how to compile and install <a title=\"Go to https:\/\/ffmpeg.org\/trac\/ffmpeg\/wiki\/UbuntuCompilationGuide\" href=\"https:\/\/ffmpeg.org\/trac\/ffmpeg\/wiki\/UbuntuCompilationGuide\">ffmpeg on Ubuntu here<\/a>.\nYou need to follow those steps, the only difference necessary is to add<\/p>\n<pre>--enable-shared\u00a0--enable-pic<\/pre>\n<p>to all configurations. For example this is the configuration needed for ffmpeg:<\/p>\n<pre>.\/configure\u00a0--enable-gpl\u00a0--enable-libfaac\u00a0--enable-libmp3lame\u00a0--enable-libopencore-amrnb\u00a0\n\u00a0\u00a0\u00a0\u00a0--enable-libopencore-amrwb\u00a0--enable-libtheora\u00a0--enable-libvorbis\u00a0--enable-libvpx\u00a0\n\u00a0\u00a0\u00a0\u00a0--enable-nonfree\u00a0--enable-version3\u00a0--enable-x11grab\u00a0--enable-shared\u00a0--enable-pic<\/pre>\n<p>If you forget to do so it\u2019s likely you get this error when compiling ffmpeg:<\/p>\n<pre>undefined\u00a0reference\u00a0to\u00a0`x264_encoder_open_124'<\/pre>\n<p>Once ffmpeg is installed you\u2019re ready to compile OpenCV. There is a short introduction in the official documentation on <a title=\"Go to http:\/\/opencv.itseez.com\/doc\/tutorials\/introduction\/linux_install\/linux_install.html\" href=\"http:\/\/opencv.itseez.com\/doc\/tutorials\/introduction\/linux_install\/linux_install.html\">how to compile and install OpenCV<\/a>.<\/p>\n<h1>Installation in Linux<\/h1>\n<p>These steps have been tested for Ubuntu 10.04 but should work with other distros.<\/p>\n<div id=\"required-packages\">\n<h2>Required packages<\/h2>\n<blockquote>\n<div>\n<ul>\n    <li>GCC 4.4.x or later. This can be installed with\n<div>\n<div>\n<pre>sudo apt-get install build-essential<\/pre>\n<\/div>\n<\/div><\/li>\n    <li>CMake 2.6 or higher<\/li>\n    <li>Subversion (SVN) client<\/li>\n    <li>GTK+2.x or higher, including headers (libgtk2.0-dev)<\/li>\n    <li>pkgconfig<\/li>\n    <li>Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)<\/li>\n    <li>ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev<\/li>\n    <li>[optional] libdc1394 2.x<\/li>\n    <li>[optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev.<\/li>\n<\/ul>\n<\/div><\/blockquote>\nAll the libraries above can be installed via Terminal or by using Synaptic Manager\n\n<\/div>","protected":false},"excerpt":{"rendered":"<p>If you\u2019re going to process live streams from cameras or videos, the most important library needed fo&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-883","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=883"}],"version-history":[{"count":3,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/883\/revisions"}],"predecessor-version":[{"id":900,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/883\/revisions\/900"}],"wp:attachment":[{"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}