element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Vision Thing
  • Challenges & Projects
  • Project14
  • Vision Thing
  • More
  • Cancel
Vision Thing
Forum BB AI and OpenCV 3.3+
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Vision Thing to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 5 replies
  • Subscribers 9 subscribers
  • Views 1092 views
  • Users 0 members are here
  • bb-ai
  • opencv
  • ai
  • dnn
  • deep neural network
  • deep neural networks
Related

BB AI and OpenCV 3.3+

vlasov01
vlasov01 over 5 years ago

I know BB AI comes with OpenCV 3.2.

I'd like to use BB AI with OpenCV Deep Neural Networks (dnn module) on my project. It comes with OpenCV 3.3 or later.

I'm wondering if anyone was able to get OpenCV 3.3 or later for BB AI?

If yes, are you still benefiting from BB AI hardware accelerators?

  • Sign in to reply
  • Cancel

Top Replies

  • ajcc
    ajcc over 5 years ago in reply to clem57 +1
    Arguments given to su will be interpreted as usernames, you're thinking of sudo sudo python -c "import cv2; print(cv2.__version__)"
  • clem57
    clem57 over 5 years ago in reply to ajcc +1
    I was really thing su and next line your command under root of course. But sudo also...
Parents
  • vlasov01
    vlasov01 over 5 years ago

    I was able to build OpenCV 4.1.2 on BB AI.

    (cv) debian@beaglebone:~$ python -c "import cv2; print(cv2.__version__)"
    4.1.2

    I'm not sure yet if it is using accelerators as I'm getting "TIOCL FATAL: Failed to open file /dev/mem" error when I'm calling dnn module from python.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 5 years ago in reply to vlasov01

    Use su before python command.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ajcc
    ajcc over 5 years ago in reply to clem57

    Arguments given to su will be interpreted as usernames, you're thinking of sudo

     

    sudo python -c "import cv2; print(cv2.__version__)"

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 5 years ago in reply to ajcc

    I was really thing

    su

    and next line your command under root of course.

    But sudo also...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • vlasov01
    vlasov01 over 5 years ago in reply to ajcc

    Hi Adrian,

     

    I'm using virtual python environment. And it was setup only for user debian. So when I run the command you suggested it is running it using a different version of OpenCV:

    sudo python -c "import cv2; print(cv2.__version__)"
    3.2.0

    And I was looking for OpenCV 3.3+ as it has support for dnn.

     

    I've tried another approach:

    cd /home/debian/.virtualenvs/cv/bin/
    sudo setcap cap_sys_rawio+ep python3

    But it gave me another error:

    ******************************************************************
    * FATAL ERROR:                                                   *
    * This OpenCV build doesn't support current CPU/HW configuration *
    *                                                                *
    * Use OPENCV_DUMP_CONFIG=1 environment variable for details      *
    ******************************************************************
    
    Required baseline features:
        ID=100 (NEON) - NOT AVAILABLE
    terminate called after throwing an instance of 'cv::Exception'
      what():  OpenCV(4.1.2) /home/debian/opencv/modules/core/src/system.cpp:598: error: (-215:Assertion failed) Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup. in function 'initialize'
    
    Aborted

     

    And if I set OPENCV_DUMP_CONFIG=1 then I'm getting the followimng information about my OpenCV configuration:

    OpenCV build configuration is:
    
    General configuration for OpenCV 4.1.2 =====================================
      Version control:               unknown
    
      Extra modules:
        Location (extra):            /home/debian/opencv_contrib/modules
        Version control (extra):     unknown
    
      Platform:
        Timestamp:                   2019-10-27T02:57:31Z
        Host:                        Linux 4.14.108-ti-r122 armv7l
        CMake:                       3.7.2
        CMake generator:             Unix Makefiles
        CMake build tool:            /usr/bin/make
        Configuration:               RELEASE
    
      CPU/HW features:
        Baseline:                    NEON
          requested:                 DETECT
          required:                  NEON
          disabled:                  VFPV3
    
      C/C++:
        Built as dynamic libs?:      YES
        C++ Compiler:                /usr/bin/c++  (ver 6.3.0)
        C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
        C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
        C Compiler:                  /usr/bin/cc
        C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
        C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
        Linker flags (Release):      -Wl,--gc-sections
        Linker flags (Debug):        -Wl,--gc-sections
        ccache:                      NO
        Precompiled headers:         NO
        Extra dependencies:          dl m pthread rt
        3rdparty dependencies:
    
      OpenCV modules:
        To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
        Disabled:                    world
        Disabled by dependency:      -
        Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java js matlab ovis python2 sfm viz
        Applications:                perf_tests apps
        Documentation:               NO
        Non-free algorithms:         YES
    
      GUI:
        GTK+:                        YES (ver 3.22.11)
          GThread :                  YES (ver 2.50.3)
          GtkGlExt:                  NO
        VTK support:                 NO
    
      Media I/O:
        ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
        JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver 62)
        WEBP:                        build (ver encoder: 0x020e)
        PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
        TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
        JPEG 2000:                   build (ver 1.900.1)
        OpenEXR:                     /usr/lib/arm-linux-gnueabihf/libImath.so /usr/lib/arm-linux-gnueabihf/libIlmImf.so /usr/lib/arm-linux-gnueabihf/libIex.so /usr/lib/arm-linux-gnueabihf/libHalf.so /usr/lib/arm-linux-gnueabihf/libIlmThread.so (ver 2.2.0)
        HDR:                         YES
        SUNRASTER:                   YES
        PXM:                         YES
        PFM:                         YES
    
      Video I/O:
        DC1394:                      YES (2.2.5)
        FFMPEG:                      YES
          avcodec:                   YES (57.64.101)
          avformat:                  YES (57.56.101)
          avutil:                    YES (55.34.101)
          swscale:                   YES (4.2.100)
          avresample:                YES (3.1.0)
        GStreamer:                   NO
        v4l/v4l2:                    YES (linux/videodev2.h)
    
      Parallel framework:            pthreads
    
      Trace:                         YES (with Intel ITT)
    
      Other third-party libraries:
        Lapack:                      NO
        Eigen:                       NO
        Custom HAL:                  YES (carotene (ver 0.0.1))
        Protobuf:                    build (3.5.1)
    
      OpenCL:                        YES (no extra features)
        Include path:                /home/debian/opencv/3rdparty/include/opencl/1.2
        Link libraries:              Dynamic load
    
      Python 3:
        Interpreter:                 /home/debian/.virtualenvs/cv/bin/python3 (ver 3.5.3)
        Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
        numpy:                       /home/debian/.virtualenvs/cv/lib/python3.5/site-packages/numpy/core/include (ver 1.17.3)
        install path:                /home/debian/.virtualenvs/cv/lib/python3.5/site-packages/cv2/python-3.5
    
      Python (for build):            /usr/bin/python2.7
    
      Java:
        ant:                         NO
        JNI:                         NO
        Java wrappers:               NO
        Java tests:                  NO
    
      Install to:                    /usr/local
    -----------------------------------------------------------------

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • vlasov01
    vlasov01 over 5 years ago in reply to ajcc

    Hi Adrian,

     

    I'm using virtual python environment. And it was setup only for user debian. So when I run the command you suggested it is running it using a different version of OpenCV:

    sudo python -c "import cv2; print(cv2.__version__)"
    3.2.0

    And I was looking for OpenCV 3.3+ as it has support for dnn.

     

    I've tried another approach:

    cd /home/debian/.virtualenvs/cv/bin/
    sudo setcap cap_sys_rawio+ep python3

    But it gave me another error:

    ******************************************************************
    * FATAL ERROR:                                                   *
    * This OpenCV build doesn't support current CPU/HW configuration *
    *                                                                *
    * Use OPENCV_DUMP_CONFIG=1 environment variable for details      *
    ******************************************************************
    
    Required baseline features:
        ID=100 (NEON) - NOT AVAILABLE
    terminate called after throwing an instance of 'cv::Exception'
      what():  OpenCV(4.1.2) /home/debian/opencv/modules/core/src/system.cpp:598: error: (-215:Assertion failed) Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup. in function 'initialize'
    
    Aborted

     

    And if I set OPENCV_DUMP_CONFIG=1 then I'm getting the followimng information about my OpenCV configuration:

    OpenCV build configuration is:
    
    General configuration for OpenCV 4.1.2 =====================================
      Version control:               unknown
    
      Extra modules:
        Location (extra):            /home/debian/opencv_contrib/modules
        Version control (extra):     unknown
    
      Platform:
        Timestamp:                   2019-10-27T02:57:31Z
        Host:                        Linux 4.14.108-ti-r122 armv7l
        CMake:                       3.7.2
        CMake generator:             Unix Makefiles
        CMake build tool:            /usr/bin/make
        Configuration:               RELEASE
    
      CPU/HW features:
        Baseline:                    NEON
          requested:                 DETECT
          required:                  NEON
          disabled:                  VFPV3
    
      C/C++:
        Built as dynamic libs?:      YES
        C++ Compiler:                /usr/bin/c++  (ver 6.3.0)
        C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
        C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-psabi -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
        C Compiler:                  /usr/bin/cc
        C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
        C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-psabi -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
        Linker flags (Release):      -Wl,--gc-sections
        Linker flags (Debug):        -Wl,--gc-sections
        ccache:                      NO
        Precompiled headers:         NO
        Extra dependencies:          dl m pthread rt
        3rdparty dependencies:
    
      OpenCV modules:
        To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
        Disabled:                    world
        Disabled by dependency:      -
        Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java js matlab ovis python2 sfm viz
        Applications:                perf_tests apps
        Documentation:               NO
        Non-free algorithms:         YES
    
      GUI:
        GTK+:                        YES (ver 3.22.11)
          GThread :                  YES (ver 2.50.3)
          GtkGlExt:                  NO
        VTK support:                 NO
    
      Media I/O:
        ZLib:                        /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
        JPEG:                        /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver 62)
        WEBP:                        build (ver encoder: 0x020e)
        PNG:                         /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.6.28)
        TIFF:                        /usr/lib/arm-linux-gnueabihf/libtiff.so (ver 42 / 4.0.8)
        JPEG 2000:                   build (ver 1.900.1)
        OpenEXR:                     /usr/lib/arm-linux-gnueabihf/libImath.so /usr/lib/arm-linux-gnueabihf/libIlmImf.so /usr/lib/arm-linux-gnueabihf/libIex.so /usr/lib/arm-linux-gnueabihf/libHalf.so /usr/lib/arm-linux-gnueabihf/libIlmThread.so (ver 2.2.0)
        HDR:                         YES
        SUNRASTER:                   YES
        PXM:                         YES
        PFM:                         YES
    
      Video I/O:
        DC1394:                      YES (2.2.5)
        FFMPEG:                      YES
          avcodec:                   YES (57.64.101)
          avformat:                  YES (57.56.101)
          avutil:                    YES (55.34.101)
          swscale:                   YES (4.2.100)
          avresample:                YES (3.1.0)
        GStreamer:                   NO
        v4l/v4l2:                    YES (linux/videodev2.h)
    
      Parallel framework:            pthreads
    
      Trace:                         YES (with Intel ITT)
    
      Other third-party libraries:
        Lapack:                      NO
        Eigen:                       NO
        Custom HAL:                  YES (carotene (ver 0.0.1))
        Protobuf:                    build (3.5.1)
    
      OpenCL:                        YES (no extra features)
        Include path:                /home/debian/opencv/3rdparty/include/opencl/1.2
        Link libraries:              Dynamic load
    
      Python 3:
        Interpreter:                 /home/debian/.virtualenvs/cv/bin/python3 (ver 3.5.3)
        Libraries:                   /usr/lib/arm-linux-gnueabihf/libpython3.5m.so (ver 3.5.3)
        numpy:                       /home/debian/.virtualenvs/cv/lib/python3.5/site-packages/numpy/core/include (ver 1.17.3)
        install path:                /home/debian/.virtualenvs/cv/lib/python3.5/site-packages/cv2/python-3.5
    
      Python (for build):            /usr/bin/python2.7
    
      Java:
        ant:                         NO
        JNI:                         NO
        Java wrappers:               NO
        Java tests:                  NO
    
      Install to:                    /usr/local
    -----------------------------------------------------------------

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube