This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Can Custom OpenVX kernel with OpenCV run on the DSP?

Part Number: TDA4VM


Hi

I'm trying to implement a new custom OpenVX kernel.

I want to make the kernel run on the target DSP but when I link to the OpenCV library, it need opencv_xxx.lib which I don't have those library.

Is that possible to run OpenVX kernel with OpenCV on the DPS? Or it can only run on the Host?

  • Hello,

    This library is not available on TI's DSP.

    Regards,

    Lucas

  • Hello Lucas,

    Thanks for your reply.

    Then can OpenCV run on the Host CPU by implement host OpenVX kernel with OpenCV in it?

    I saw an tutorial video here:

    https://training.ti.com/module-1-how-openvx-compares-other-popular-compute-frameworks?context=1147880-1140070-1147252-1147257

    Is there any example that could run OpenCV within OpenVX kernel on TI's device? 

    What's the merit we could get to implement the OpenVX kernel with OpenCV?

    Thank you very much!

  • Hello Lucas,

    I follow the instruction in https://medium.com/trueface-ai/trueface-tutorials-how-to-cross-compile-popular-computer-vision-c-frameworks-for-raspberry-pi-4-afcbe2dcc302 to build for aarch64.

    Then the concerto.mak is:

    ifeq ($(TARGET_CPU), $(filter $(TARGET_CPU), A72))

    include $(PRELUDE)

    TARGET := vx_kernels_lanenet_host
    TARGETTYPE := library
    CPPSOURCES += vx_lanenet_postprocessing_host.cpp

    IDIRS += $(CUSTOM_KERNEL_PATH)/lanenet/include
    # IDIRS += $(J7_C_MODELS_PATH)/include
    # IDIRS += $(TIOVX_PATH)/source/include
    IDIRS += /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4

    LDIRS += /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/lib
    LDIRS += /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/lib/opencv4/3rdparty

    OPENCV_LIBS =
    OPENCV_LIBS += opencv_calib3d
    OPENCV_LIBS += opencv_core
    OPENCV_LIBS += opencv_dnn
    OPENCV_LIBS += opencv_features2d
    OPENCV_LIBS += opencv_flann
    OPENCV_LIBS += opencv_gapi
    OPENCV_LIBS += opencv_highgui
    OPENCV_LIBS += opencv_imgcodecs
    OPENCV_LIBS += opencv_imgproc
    OPENCV_LIBS += opencv_ml
    OPENCV_LIBS += opencv_objdetect
    OPENCV_LIBS += opencv_photo
    OPENCV_LIBS += opencv_stitching
    OPENCV_LIBS += opencv_video
    OPENCV_LIBS += opencv_videoio
    OPENCV_LIBS += ade
    OPENCV_LIBS += libjpeg-turbo
    OPENCV_LIBS += libpng
    OPENCV_LIBS += libprotobuf
    OPENCV_LIBS += quirc
    OPENCV_LIBS += zlib

    STATIC_LIBS += $(OPENCV_LIBS)

    CPPFLAGS += --std=c++11

    include $(FINALE)

    endif

    But the error occured as below:

    TARGET_COMBO=J7:LINUX:A72:1:release:GCC_LINUX_ARM
    HOST_ROOT=/home/cat/V3GA_07_02/psdkra/tiovx
    HOST_COMPILER=GCC_LINUX_ARM
    HOST_PLATFORM=PC
    HOST_OS=LINUX
    HOST_CPU=x86_64
    HOST_ARCH=64
    HOST_FAMILY=x86_64
    HOST_NUM_CORES=8
    TARGET_OS=LINUX
    TARGET_CPU=A72
    TARGET_ARCH=64
    TARGET_FAMILY=ARM
    TARGET_NUM_CORES=1
    TARGET_PLATFORM=J7
    TARGET_BUILD=release
    TARGET_OUT=/home/cat/V3GA_07_02/psdkra/tiovx/out/J7/A72/LINUX/release
    TARGET_DOC=/home/cat/V3GA_07_02/psdkra/tiovx/out/J7/A72/LINUX/release/docs
    BUILD_DEFS = CUSTOM_KERNEL_PATH BUILD_TUTORIAL BUILD_CONFORMANCE_TEST
    J7_LINUX_A72_1_release_GCC_LINUX_ARM_DEFS = LINUX J7 A72="A72" TARGET_NUM_CORES=1 TARGET_ARCH=64 ARCH_64 ARM TARGET_BUILD=1
    J7_LINUX_A72_1_release_GCC_LINUX_ARM_LDIRS =
    SCM_ROOT=
    SCM_VERSION=
    Copying Prebuilt libs from prebuilt_libs to lib
    [GCC] Compiling C++ vx_lanenet_postprocessing_host.cpp
    In file included from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core.hpp:3290,
    from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/opencv.hpp:52,
    from /home/cat/V3GA_07_02/psdkra/tiovx/kernels_j7/lanenet/host/vx_lanenet_postprocessing_host.cpp:5:
    /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core/utility.hpp:697:14: error: 'recursive_mutex' in namespace 'std' does not name a type
    697 | typedef std::recursive_mutex Mutex;
    | ^~~~~~~~~~~~~~~
    In file included from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core.hpp:3290,
    from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/opencv.hpp:52,
    from /home/cat/V3GA_07_02/psdkra/tiovx/kernels_j7/lanenet/host/vx_lanenet_postprocessing_host.cpp:5:
    /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core/utility.hpp:63:1: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
    62 | #include <mutex> // std::mutex, std::lock_guard
    +++ |+#include <mutex>
    63 | #endif
    In file included from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core.hpp:3290,
    from /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/opencv.hpp:52,
    from /home/cat/V3GA_07_02/psdkra/tiovx/kernels_j7/lanenet/host/vx_lanenet_postprocessing_host.cpp:5:
    /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core/utility.hpp:698:29: error: 'Mutex' is not a member of 'cv'
    698 | typedef std::lock_guard<cv::Mutex> AutoLock;
    | ^~~~~
    /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core/utility.hpp:698:29: error: 'Mutex' is not a member of 'cv'
    /home/cat/opencv-4.1.0/build_aarch64/install_aarch64/usr/local/include/opencv4/opencv2/core/utility.hpp:698:34: error: template argument 1 is invalid
    698 | typedef std::lock_guard<cv::Mutex> AutoLock;
    | ^

  • Hello Lucas,

    I see there are OpenCV libraries supported on older version products.

    https://www.ti.com/microcontrollers-mcus-processors/processors/digital-signal-processors/libraries/open-cv.html

    So, is OpenCV not ready on DSPs in TDA4VM product? Will it be supported in the future?

  • Hello,

    There are no plans in our roadmap to support OpenCV on the J7 DSP's. 

    OpenCV is not distributed by TI on A72, but can be integrated as a library on A72.  Regarding your issue with compiling OpenCV on A72, it looks like there is some missing header files or include paths in your project.  I would recommend checking online to see where these may be defined and include these in your code.

    Regards,

    Lucas