OpenCV Error for Renesas R-Car-H3

Hello,

I am using object detection application on Renesas -Rcar H3 board. Below are the details.

openCV  version -2.4.13

Poky version -2.1.3

Yocto Version - v2.23.1.

Host OS for yocto build - Ubuntu 16.04

While running the application on Renesas board, below GTK related error were shown

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or [ 1976.641753] audit: type=1706

Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvWaitKey, fil7

terminate called after throwing an instance of 'cv::Exception'

  what():  /media/2.4.13.7_pckage/modules/highgui/src/window.cpp:567: error: (-2) The function is not implemented. Rebuild the library with Wiy

 

Note: Same error occurred while executing the application on Host system (Ubuntu_16.04) , after installing libgtk2.0-dev_2.24.31-2_arm64.deb package error was resolved.

 

Tried below options to solve the error

 

Option#1 

As mentioned in error, we downloaded the libgtk2.0-dev_2.24.31-2_arm64.deb package and copied it to the  Renesas board to install manually.

But the board does not have dpkg package manager ,which is required to install .deb. We tried to install this with opkg package manager which is available in Renesas board .

So we have converted libgtk2.0-dev_2.24.31-2_arm64.deb package to libgtk2.0-dev_2.24.31-2_arm64.ipk package which is opkg compatable format.By installing this package , error was not solved.

Option#2

Tried to add GTK as part of Yocto build. There is a separate layer called meta-gnome in openembedded layer which supports gtk. We cloned that layer, included in yocto build and generated SDK with gnome layer.But there is no package of GTK or related to GTK in rootfs of the Renesas Board.

Please help me to solve GTK related error. 

  • Hi ASTHA,

    Thanks for your inquiry.

    There are 02 questions in order to understand your issue in more details.
    1. How did you integrate OpenCV into your rootfs ?
    Did you manually compile it from source code ? Or Did you enable OpenCV feature during Yocto build ?
    2. Could you describe more about the system use-case when the error was occurred ?

    Best regards,
    KHIEM Nguyen
  • In reply to KhiemN:

    Hello KHIEM ,
    Thank you for quick response..
    Please find answers below.
    1)OpenCV feature is enabled during Yocto Build.
    2)Use case- OpenCV application is cross-compiled in native ubuntu using yocto-SDK. While running the cross compiled executable on the Renesas board, mentioned error were displayed.

    Note: OpenCV application works on input video file (not live captured) and mark boundary boxes for detected object.Output should be displayed on connected monitor. For display of output, GTK- lib is needed.

    Please revert if more information is needed.
    Thanks &Regards
    Astha Mishra
  • In reply to ASTHA:

    Hi ASTHA,

     

    Regarding to GTK support for OpenCV, we can enable related GTK package(s) by adding two lines into local.conf ($WORK/build/conf/local.conf).

    You may append to the end of the file.

    PACKAGECONFIG_append_pn-opencv = " gtk"

    PACKAGECONFIG_append_pn-nativesdk-opencv = " gtk"


    Please rebuild your rootfs, SDK and re-build your OpenCV application after that.

     

    Best regards,

    KHIEM Nguyen

  • Hello KHIEM,

    I have added below lines in local.conf
    PACKAGECONFIG_append_pn-opencv = " gtk"
    PACKAGECONFIG_append_pn-nativesdk-opencv = " gtk"

    It was giving below error.
    **********************************************************************************************************************
    ERROR: Nothing PROVIDES 'gtk+' (but /home/astha/build/meta-rcar/meta-rcar-gen3-adas/recipes-graphics/opencv/opencv_2.4.bb DEPENDS on or otherwise requires it)
    ERROR: gtk+ was skipped: one of '['directfb', 'x11']' needs to be in DISTRO_FEATURES
    **********************************************************************************************************************
    So I have changed "gtk" to "gtk+"
    with gtk+, yocto build was success. SDK and OpenCV application was also rebuild after that.
    On execution on application on Renesas Target, its giving same error as earlier.
    The function is not implemented. Rebuild the library with Windows, GTK+ 2.x

    Thanks & Regards
    Astha Mishra
  • In reply to ASTHA:

    Hi Astha,

    Since the GTK+ (for ARM) has already been included in your Yocto build but the error still occurred,
    I guess that feature might not be supported for ARM-based system.

    Have you successfully run your OpenCV applications in another ARM-based platform ?

    Best regards,
    KHIEM Nguyen
  • Hello KHIEM ,

    I have tried same application on Raspberry PI which has arm based Cortex-A53. Application is running perfectly fine on Raspberry PI broad.
    First it also shown error for GTK, after installation of " libgtk2.0-dev_2.24.31-2_arm64.deb" package on Raspberry PI board, GTK issue was solved.

    One more information is , GTK related files are present in build directory of yocto build but its not present in rootfs which is used on renesas board.

    Thanks & Regards
    Astha Mishra
  • In reply to ASTHA:

    Hi Astha,

    > I have tried same application on Raspberry PI which has arm based Cortex-A53. Application is running perfectly fine on Raspberry PI broad.

    Could you double-check the CV version ? Is it 2.4.13 or other versions ?
    If the Raspberry Pi rootfs is also compiled from Yocto recipe, we may check the differences under OpenCV support.

    BTW, may you search for GTK related files in Raspberry rootfs after installing the .deb file ?
    It's good to give a comparison between Raspberry env. and R-Car env., I guess.

    > One more information is , GTK related files are present in build directory of yocto build but its not present in rootfs which is used on renesas board.

    If we have already enabled all the OpenCV support in Yocto recipe, we may consider current result as a limitation.
    As my suggestion above, we may look into the Yocto recipe implementation of Raspberry Pi to check the differences.

    Best regards,
    KHIEM Nguyen
  • In reply to KhiemN:

    Hello KHIEM ,

    Sorry for delayed response. Please find my reply for queries below,

    KHIEM : Could you double-check the CV version ? Is it 2.4.13 or other versions ?
    ASTHA: Yes, It is Version 2.4.13

    KHIEM :If the Raspberry Pi rootfs is also compiled from Yocto recipe, we may check the differences under OpenCV support.
    ASTHA: I am using "Raspbian" OS provided by Raspberry-PI. I didn't build Yocto recipe for Raspberry Pi rootfs.

    KHIEM :If we have already enabled all the OpenCV support in Yocto recipe, we may consider current result as a limitation.
    ASTHA: I have got information from Renesas that GTK+ 2 is not supported in Yocto for H3. I have tried with GTK+ 3 in yocto recipe , now I can see GTK related files are present in rootfs used for Renesas board. So conclusion is GTK+ 2 is limitation for yocto build for R-car H3.

    Thanks & Regards
    Astha Mishra