Skip to content

Commit

Permalink
add opencv-python support
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzukiTsuru committed Dec 13, 2022
1 parent b19404d commit 7654512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Software/BSP/openwrt/package/lizard/opencv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define Package/opencv
CATEGORY:=Libraries
TITLE:=OpenCV
URL:=https://opencv.org/
DEPENDS:=+libpthread +librt +libatomic +libstdcpp +zlib +libjpeg
DEPENDS:=+libpthread +librt +libatomic +libstdcpp +zlib +libjpeg +python3 +python3-numpy
endef

CMAKE_OPTIONS += \
Expand All @@ -52,21 +52,24 @@ CMAKE_OPTIONS += \
-DBUILD_opencv_superres:BOOL=OFF -DBUILD_opencv_ts:BOOL=OFF \
-DBUILD_opencv_highgui:BOOL=OFF \
-DBUILD_opencv_videostab:BOOL=OFF \
-DBUILD_opencv_python:BOOL=ON \
-DWITH_FFMPEG:BOOL=OFF \
-DWITH_GSTREAMER:BOOL=OFF \
-DWITH_LIBV4L:BOOL=OFF \
-DWITH_PNG:BOOL=OFF \
-DWITH_GTK:BOOL=OFF \
-DWITH_TIFF:BOOL=OFF \
-DCMAKE_VERBOSE:BOOL=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DPYTHON3_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python3.9 \
-DPYTHON3_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython3.9.so \
-DPYTHON3_NUMPY_INCLUDE_DIRS=$(TARGET_ROOTFS_DIR)/pypi/numpy-1.20.1/ipkg-install/usr/lib/python3.9/site-packages/numpy/core/include \
-DBUILD_OPENCV_PYTHON3:BOOL=ON

TARGET_LDFLAGS += -latomic

define Package/opencv/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencv* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,opencv))
2 changes: 1 addition & 1 deletion Software/BSP/openwrt/target/v851s/v851s-lizard/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3865,7 +3865,7 @@ CONFIG_PACKAGE_python3-ncurses=y
# CONFIG_PACKAGE_python3-networkx is not set
# CONFIG_PACKAGE_python3-newt is not set
CONFIG_PACKAGE_python3-numpy=y
# CONFIG_PACKAGE_python3-numpy-src is not set
CONFIG_PACKAGE_python3-numpy-src=y
# CONFIG_PACKAGE_python3-oauthlib is not set
# CONFIG_PACKAGE_python3-openpyxl is not set
CONFIG_PACKAGE_python3-openssl=y
Expand Down

0 comments on commit 7654512

Please sign in to comment.