From 7654512ae243163fa84a873036e47d8cbf24d24b Mon Sep 17 00:00:00 2001 From: YuzukiTsuru Date: Tue, 13 Dec 2022 15:54:03 +0800 Subject: [PATCH] add opencv-python support --- Software/BSP/openwrt/package/lizard/opencv/Makefile | 11 +++++++---- .../BSP/openwrt/target/v851s/v851s-lizard/defconfig | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Software/BSP/openwrt/package/lizard/opencv/Makefile b/Software/BSP/openwrt/package/lizard/opencv/Makefile index 60e88406..73245711 100644 --- a/Software/BSP/openwrt/package/lizard/opencv/Makefile +++ b/Software/BSP/openwrt/package/lizard/opencv/Makefile @@ -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 += \ @@ -52,7 +52,6 @@ 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 \ @@ -60,13 +59,17 @@ CMAKE_OPTIONS += \ -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)) \ No newline at end of file diff --git a/Software/BSP/openwrt/target/v851s/v851s-lizard/defconfig b/Software/BSP/openwrt/target/v851s/v851s-lizard/defconfig index 60fa55c6..aeaa3a47 100644 --- a/Software/BSP/openwrt/target/v851s/v851s-lizard/defconfig +++ b/Software/BSP/openwrt/target/v851s/v851s-lizard/defconfig @@ -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