[Buildroot] OpenCV modules headers not in the SDK

Stefano Cottafavi stefano.cottafavi at gmail.com
Sun Aug 7 09:12:43 UTC 2022


Hi Giulio,
thanks for trying that out. Your assumptions are correct, I export the SDK
with "make sdk" and use that in QtCreator to build my application.

Looking at the location you pointed out I can indeed find some of the
headers, but not all of the opencv modules that have been enabled in the
defconfig.
As per my original message I believe the problem is somewhat related to
(some of?) the modules.
Sticking to the case of objdetect module and following the breadcrumbs:
- the module is enabled in defconfig with
BR2_PACKAGE_OPENCV4_LIB_OBJDETECT=y
- the module src are available to buildroot in
output/build/opencv4-4.5.5/modules/objdetect/

yet the module is not flagged for compilation in
output/build/opencv4-4.5.5/buildroot-build/opencv2/

#define HAVE_OPENCV_CALIB3D
#define HAVE_OPENCV_CORE
#define HAVE_OPENCV_FEATURES2D
#define HAVE_OPENCV_FLANN
#define HAVE_OPENCV_GAPI
#define HAVE_OPENCV_IMGCODECS
#define HAVE_OPENCV_IMGPROC
#define HAVE_OPENCV_ML
#define HAVE_OPENCV_VIDEO
#define HAVE_OPENCV_VIDEOIO

and never makes it to the sysroot of the sdk, on my end.
can you reproduce the issue?

Stef


On Sun, Aug 7, 2022 at 12:46 AM Giulio Benetti <
giulio.benetti at benettiengineering.com> wrote:

> Hi Stefano,
>
> On 06/08/22 23:54, Giulio Benetti wrote:
> > Subject:
> > Re: [Buildroot] OpenCV modules headers not in the SDK
> > From:
> > Giulio Benetti <giulio.benetti at benettiengineering.com>
> > Date:
> > 06/08/22, 23:54
> >
> > To:
> > Stefano Cottafavi <stefano.cottafavi at gmail.com>
> > CC:
> > buildroot at buildroot.org
> >
> >
> > Hi Stefano,
> >
> > On 06/08/22 20:15, Stefano Cottafavi wrote:
> >> Hi Giulio,
> >> thanks for the quick reply. Here's the defconfig
> >> https://pastebin.com/Xsh5d4HG <https://pastebin.com/Xsh5d4HG>
> >> For the sake of completeness I didn't remove any of the lines, but
> >> some are specific to my out-of-tree folder and overlays, so you might
> >> want to get rid of those.
> >>
> >> I'm currently building the 2022.05.1 tag with SHA
> >> 2e399893b4f60f1e103228df6e4439d4e4ac3dd5
> >
> > Thank you. I'm building it right now. The package opencv4.mk looks
> > correct because it does have OPENCV4_INSTALL_STAGING = YES, and that
> > should install the header files. If there is a bug it could be inside
> > opencv4 cmake itself.
> >
> > By the way, I guess the problem you're experience is that you after
> > building the Buildroot's defconfig you try to build another application
> > (i.e. a qt5 application) that requires opencv4 and it can't find the
> > headers, right?
>
> I've built and I can find the headers(.hpp) files under:
>
> output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/opencv4/opencv2
> according to:
> https://docs.opencv.org/4.x/examples.html
> where all examples include directly:
> #include "opencv2/shape.hpp"
> ...
>
> Can you double check if files are there?
>
> If you can find them then it could be a problem with your application
> include path where you should explictly add
> "output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/opencv4"
> to -I search path. In Qt5,
> that I suspect you're using, add INCLUDEPATH to .pro file and re-run
> qmake and then rebuild.
>
> Let me know if this fixes the problems.
>
> Best regards
> --
> Giulio Benetti
> Benetti Engineering sas
>
> > Best regards
> > --
> > Giulio Benetti
> > Benetti Engineering sas
> >
> >> Looking forward to your insights.
> >>
> >> Best
> >> Stefano
> >>
> >> On Sat, Aug 6, 2022 at 7:43 PM Giulio Benetti
> >> <giulio.benetti at benettiengineering.com
> >> <mailto:giulio.benetti at benettiengineering.com>> wrote:
> >>
> >>     Hi Stefano,
> >>
> >>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
> >>>     <stefano.cottafavi at gmail.com <mailto:stefano.cottafavi at gmail.com>>
> >>>     ha scritto:
> >>>
> >>>     
> >>>     Hi all,
> >>>     I've successfully built Buildroot 2022.05 for the Raspberry Pi4
> >>>     adding support for Qt5 and OpenCV (including objdetect module
> >>>     amongst few other).
> >>>     I've also managed to generate the SDK for such a build however I
> >>>     can't find the header files of those OpenCV modules anywhere in
> >>>     the SDK.
> >>>
> >>>     Is this expected or a bug?
> >>
> >>     It looks like a bug. Can you please pastebin your specific
> defconfig?
> >>
> >>     You can obtain it moving to your output folder and  issuing:
> >>     $ make savedeconfig
> >>     then you obtain a file called defconfig so copy and paste it on
> >>     pastebin and provide here
> >>     the link to the pastebin and also the SHA1 commit of your Buildroot
> >>     git or the specific version.
> >>
> >>     This way we can help you.
> >>
> >>     Best regards
> >>     —
> >>     Giulio Benetti
> >>     CEO/CTO at Benetti Engineering sas
> >>
> >>>
> >>>     Cheers,
> >>>     Stefano
> >>>     _______________________________________________
> >>>     buildroot mailing list
> >>> buildroot at buildroot.org <mailto:buildroot at buildroot.org>
> >>> https://lists.buildroot.org/mailman/listinfo/buildroot
> >>> <https://lists.buildroot.org/mailman/listinfo/buildroot>
> >>
> >>
> >> _______________________________________________
> >> buildroot mailing list
> >> buildroot at buildroot.org
> >> https://lists.buildroot.org/mailman/listinfo/buildroot
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20220807/80dbf0d7/attachment-0001.html>


More information about the buildroot mailing list