From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v5 07/13] package/opencv: add python support
Date: Sun, 7 Jun 2015 14:22:16 +0200 [thread overview]
Message-ID: <20150607122216.GH3545@free.fr> (raw)
In-Reply-To: <1433672799-21387-8-git-send-email-s.martin49@gmail.com>
Samuel, All,
On 2015-06-07 12:26 +0200, Samuel Martin spake thusly:
> opencv_python module needs python-numpy because it uses some numpy
> headers in this wrapper.
>
> From its 2.4 release, OpenCV offers python bindings, but they required
> most of the OpenCV modules to be enabled.
>
> Since OpenCV-3.0.0, python bindings have been reworked:
> - it now supports both python2 and python3
> - only built modules supporting wrapped in python will be included in
> the bindings.
>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> changes v4->v5:
> - rebase
> - update commit log
> - fix python-numpy selection
> - add python3 support
>
> changes v3->v4:
> - rebase
> - rename _OPT -> _OPTS
> - remove python/numpy patch (merged upstream since opencv bump)
>
> changes v2->v3:
> - rebase
> - add fetch uri in the opencv's patch (Yann)
> - move pyhton module knob under the multi-line if block about python deps
> (Yann)
>
> changes v1->v2:
> - rebase
> - use patch merged upstream
> ---
> package/opencv/Config.in | 12 +++++++++++-
> package/opencv/opencv.mk | 33 +++++++++++++++++++++++++++++++--
> 2 files changed, 42 insertions(+), 3 deletions(-)
>
> diff --git a/package/opencv/Config.in b/package/opencv/Config.in
> index 4866780..db950f4 100644
> --- a/package/opencv/Config.in
> +++ b/package/opencv/Config.in
> @@ -83,7 +83,17 @@ config BR2_PACKAGE_OPENCV_LIB_PHOTO
> help
> Include opencv_photo module into the OpenCV build.
>
> -comment "opencv_python module requires numpy which is not yet available."
> +config BR2_PACKAGE_OPENCV_LIB_PYTHON
> + bool "python"
> + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
> + depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \
> + || BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \
> + || BR2_sh || BR2_x86_64 # python-numpy
> + depends on !BR2_TOOLCHAIN_USES_UCLIBC || BR2_i386 || BR2_x86_64 # python-numpy
> + select BR2_PACKAGE_PYTHON_NUMPY
> + help
> + Include opencv_python module into the OpenCV build.
> + No python example is installed.
>
> config BR2_PACKAGE_OPENCV_LIB_SHAPE
> bool "shape (shape descriptors and matchers)"
> diff --git a/package/opencv/opencv.mk b/package/opencv/opencv.mk
> index 07bc893..aa972dc 100644
> --- a/package/opencv/opencv.mk
> +++ b/package/opencv/opencv.mk
> @@ -64,8 +64,6 @@ OPENCV_CONF_OPTS += \
> -DBUILD_opencv_ml=$(if $(BR2_PACKAGE_OPENCV_LIB_ML),ON,OFF) \
> -DBUILD_opencv_objdetect=$(if $(BR2_PACKAGE_OPENCV_LIB_OBJDETECT),ON,OFF) \
> -DBUILD_opencv_photo=$(if $(BR2_PACKAGE_OPENCV_LIB_PHOTO),ON,OFF) \
> - -DBUILD_opencv_python2=OFF \
> - -DBUILD_opencv_python3=OFF \
> -DBUILD_opencv_shape=$(if $(BR2_PACKAGE_OPENCV_LIB_SHAPE),ON,OFF) \
> -DBUILD_opencv_stitching=$(if $(BR2_PACKAGE_OPENCV_LIB_STITCHING),ON,OFF) \
> -DBUILD_opencv_superres=$(if $(BR2_PACKAGE_OPENCV_LIB_SUPERRES),ON,OFF) \
> @@ -270,6 +268,37 @@ else
> OPENCV_CONF_OPTS += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
> endif
>
> +ifeq ($(BR2_PACKAGE_OPENCV_LIB_PYTHON),y)
> +ifeq ($(BR2_PACKAGE_PYTHON),y)
> +OPENCV_CONF_OPTS += \
> + -DBUILD_opencv_python2=ON \
> + -DBUILD_opencv_python3=OFF \
> + -DPYTHON2_EXECUTABLE=$(HOST_DIR)/usr/bin/python2 \
> + -DPYTHON2_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
> + -DPYTHON2_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so \
> + -DPYTHON2_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/numpy/core/include \
> + -DPYTHON2_PACKAGES_PATH=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
> + -DPYTHON2_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
> +OPENCV_DEPENDENCIES += python
> +else
> +OPENCV_CONF_OPTS += \
> + -DBUILD_opencv_python2=OFF \
> + -DBUILD_opencv_python3=ON \
> + -DPYTHON3_EXECUTABLE=$(HOST_DIR)/usr/bin/python3 \
> + -DPYTHON3_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m \
> + -DPYTHON3_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)m.so \
> + -DPYTHON3_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy/core/include \
> + -DPYTHON3_PACKAGES_PATH=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + -DPYTHON3_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
> +OPENCV_DEPENDENCIES += python3
> +endif
> +OPENCV_DEPENDENCIES += python-numpy
> +else
> +OPENCV_CONF_OPTS += \
> + -DBUILD_opencv_python2=OFF \
> + -DBUILD_opencv_python3=OFF
> +endif
> +
> # Installation hooks:
> define OPENCV_CLEAN_INSTALL_DOC
> $(RM) -fr $(TARGET_DIR)/usr/share/OpenCV/doc
> --
> 2.4.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2015-06-07 12:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-07 10:26 [Buildroot] [PATCH v5 00/13] OpenCV bump Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 01/13] package/opencv: cleanup spaces at ends of line Samuel Martin
2015-06-07 11:31 ` Yann E. MORIN
2015-06-09 20:45 ` Thomas Petazzoni
2015-06-07 10:26 ` [Buildroot] [PATCH v5 02/13] package/opencv: alphabetically sorted each _CONF_OPTS group Samuel Martin
2015-06-07 11:35 ` Yann E. MORIN
2015-06-07 11:49 ` Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 03/13] package/opencv: bump to version 3.0 Samuel Martin
2015-06-07 12:03 ` Yann E. MORIN
2015-06-14 14:05 ` Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 04/13] package/opencv: define modules inter-dependencies Samuel Martin
2015-06-07 12:11 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 05/13] package/opencv: reword modules' prompt and help text Samuel Martin
2015-06-07 12:12 ` Yann E. MORIN
2015-06-09 20:46 ` Thomas Petazzoni
2015-06-07 10:26 ` [Buildroot] [PATCH v5 06/13] package/opencv: add qt5 support Samuel Martin
2015-06-07 12:16 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 07/13] package/opencv: add python support Samuel Martin
2015-06-07 12:22 ` Yann E. MORIN [this message]
2015-06-07 10:26 ` [Buildroot] [PATCH v5 08/13] package/opencv: add gstreamer-1.x support Samuel Martin
2015-06-07 12:34 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 09/13] package/opencv: add opengl support Samuel Martin
2015-06-07 12:41 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 10/13] package/opencv: add openmp support Samuel Martin
2015-06-07 12:43 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 11/13] package/opencv: add gtk3 support Samuel Martin
2015-06-07 13:00 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 12/13] package/vlc: add opencv support Samuel Martin
2015-06-07 13:14 ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 13/13] package/gstreamer1/gst1-plugins-bad: disable opencv plugin with opencv-3 Samuel Martin
2015-06-07 13:18 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150607122216.GH3545@free.fr \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.