GithubHelp home page GithubHelp logo

Comments (4)

pataxis avatar pataxis commented on September 24, 2024 1

Hi @stephanschulz , thank you for reaching out to us with this suggestion. We will get back to you when we have had a look.

from acap-native-sdk-examples.

stephanschulz avatar stephanschulz commented on September 24, 2024

i tried the following:

add #include <opencv2/features2d.hpp>

edit the Dockerfile to include -D BUILD_LIST=core,imgproc,video,features2d,objdetect \ in lline 76 https://github.com/AxisCommunications/acap-native-sdk-examples/blob/master/using-opencv/Dockerfile#L76

But still get errors

 > [12/12] RUN . /opt/axis/acapsdk/environment-setup* && acap-build .:
#16 0.333 make
#16 0.335 mkdir -p ./lib
#16 0.342 cp /target-root/usr/lib/libopencv_core.so.4.5 /target-root/usr/lib/libopencv_core.so.4.5.1 /target-root/usr/lib/libopencv_core.so ./lib
#16 0.350 cp /target-root/usr/lib/libopencv_imgproc.so.4.5.1 /target-root/usr/lib/libopencv_imgproc.so /target-root/usr/lib/libopencv_imgproc.so.4.5 ./lib
#16 0.359 cp /target-root/usr/lib/libopencv_video.so /target-root/usr/lib/libopencv_video.so.4.5 /target-root/usr/lib/libopencv_video.so.4.5.1 ./lib
#16 0.367 arm-linux-gnueabihf-g++  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/axis/acapsdk/sysroots/armv7hf -L/opt/axis/acapsdk/sysroots/armv7hf/usr/lib example.cpp  -O2 -pipe -g -feliminate-unused-debug-types  -Os -pipe -std=c++11 -I/opt/axis/acapsdk/sysroots/armv7hf/usr/include/vdo -I/opt/axis/acapsdk/sysroots/armv7hf/usr/include/gio-unix-2.0 -I/opt/axis/acapsdk/sysroots/armv7hf/usr/include/glib-2.0 -I/opt/axis/acapsdk/sysroots/armv7hf/usr/lib/glib-2.0/include -I/target-root/usr/include/opencv4 -L./lib -Wl,--no-as-needed,-rpath,'$ORIGIN/lib' -lm -lopencv_video -lopencv_imgproc -lopencv_core -lpthread -lvdostream -lsystemd -lgio-2.0 -lgobject-2.0 -lglib-2.0 imgprovider.cpp -o opencv_app && arm-linux-gnueabihf-strip --strip-unneeded opencv_app
#16 1.925 /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: warning: libopencv_calib3d.so.4.5, needed by ./lib/libopencv_video.so, not found (try using -rpath or -rpath-link)
#16 1.925 /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /tmp/cclv1ky1.o: in function `main':
#16 1.925 /opt/app/example.cpp:101: undefined reference to `cv::SimpleBlobDetector::Params::Params()'
#16 1.925 /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /opt/app/example.cpp:136: undefined reference to `cv::SimpleBlobDetector::create(cv::SimpleBlobDetector::Params const&)'
#16 1.925 /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./lib/libopencv_video.so: undefined reference to `cv::estimateAffine2D(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int, double, unsigned int, double, unsigned int)'
#16 1.925 /usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: ./lib/libopencv_video.so: undefined reference to `cv::estimateAffinePartial2D(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int, double, unsigned int, double, unsigned int)'
#16 1.925 collect2: error: ld returned 1 exit status
#16 1.926 make: *** [Makefile:30: opencv_app] Error 1
#16 1.927 
#16 1.927 make failed. Please fix above errors, before you can create a package
------
executor failed running [/bin/bash -o pipefail -c . /opt/axis/acapsdk/environment-setup* && acap-build .]: exit code: 1
stephanschulz@Komputer using-opencv % 

from acap-native-sdk-examples.

Corallo avatar Corallo commented on September 24, 2024

Hello! To build Opencv with more libraries you can do the following:

First, add the libraries to the build in the docker file, line 76:
-D BUILD_LIST=core,imgproc,video,features2d,objdetect

then in the makefile Line 19, you add those shared libs (and their dependency)

SHLIBS += -lm -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_video -lopencv_imgproc -lopencv_core -lpthread

Then, you need to copy the .so files to the local lib directory, which means adding a new command in line 21 and line 34 to find and copy the right .so files.
To make this last step more simple, you could also copy all the opencv libs,

replacing line 21,22,23 with:
LIB_FILES = $(wildcard $(SDK_TARGET_LIBS)/libopencv_*.so*)
and
34,35,36 with:
cp $(LIB_FILES) $(SHLIB_DIR)

from acap-native-sdk-examples.

pataxis avatar pataxis commented on September 24, 2024

No updates after answer, closing issue.

from acap-native-sdk-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.