All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] OpenCV modules headers not in the SDK
@ 2022-08-06 17:28 Stefano Cottafavi
  2022-08-06 17:43 ` Giulio Benetti
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Cottafavi @ 2022-08-06 17:28 UTC (permalink / raw)
  To: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 337 bytes --]

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?

Cheers,
Stefano

[-- Attachment #1.2: Type: text/html, Size: 1085 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-06 17:28 [Buildroot] OpenCV modules headers not in the SDK Stefano Cottafavi
@ 2022-08-06 17:43 ` Giulio Benetti
  2022-08-06 18:15   ` Stefano Cottafavi
  0 siblings, 1 reply; 8+ messages in thread
From: Giulio Benetti @ 2022-08-06 17:43 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]

Hi Stefano,

> Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi <stefano.cottafavi@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@Benetti Engineering sas

> 
> Cheers,
> Stefano
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

[-- Attachment #1.2: Type: text/html, Size: 2333 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-06 17:43 ` Giulio Benetti
@ 2022-08-06 18:15   ` Stefano Cottafavi
  2022-08-06 21:54     ` Giulio Benetti
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Cottafavi @ 2022-08-06 18:15 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1656 bytes --]

Hi Giulio,
thanks for the quick reply. Here's the defconfig
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

Looking forward to your insights.

Best
Stefano

On Sat, Aug 6, 2022 at 7:43 PM Giulio Benetti <
giulio.benetti@benettiengineering.com> wrote:

> Hi Stefano,
>
> Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi <
> stefano.cottafavi@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@Benetti Engineering sas
>
>
> Cheers,
> Stefano
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
>
>

[-- Attachment #1.2: Type: text/html, Size: 4190 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-06 18:15   ` Stefano Cottafavi
@ 2022-08-06 21:54     ` Giulio Benetti
  2022-08-06 22:46       ` Giulio Benetti
  0 siblings, 1 reply; 8+ messages in thread
From: Giulio Benetti @ 2022-08-06 21:54 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot

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?

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@benettiengineering.com 
> <mailto:giulio.benetti@benettiengineering.com>> wrote:
> 
>     Hi Stefano,
> 
>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
>>     <stefano.cottafavi@gmail.com <mailto:stefano.cottafavi@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@Benetti Engineering sas
> 
>>
>>     Cheers,
>>     Stefano
>>     _______________________________________________
>>     buildroot mailing list
>>     buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>>     https://lists.buildroot.org/mailman/listinfo/buildroot
>>     <https://lists.buildroot.org/mailman/listinfo/buildroot>
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-06 21:54     ` Giulio Benetti
@ 2022-08-06 22:46       ` Giulio Benetti
  2022-08-07  9:12         ` Stefano Cottafavi
  0 siblings, 1 reply; 8+ messages in thread
From: Giulio Benetti @ 2022-08-06 22:46 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot

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@benettiengineering.com>
> Date:
> 06/08/22, 23:54
> 
> To:
> Stefano Cottafavi <stefano.cottafavi@gmail.com>
> CC:
> buildroot@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@benettiengineering.com 
>> <mailto:giulio.benetti@benettiengineering.com>> wrote:
>>
>>     Hi Stefano,
>>
>>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
>>>     <stefano.cottafavi@gmail.com <mailto:stefano.cottafavi@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@Benetti Engineering sas
>>
>>>
>>>     Cheers,
>>>     Stefano
>>>     _______________________________________________
>>>     buildroot mailing list
>>> buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>>> https://lists.buildroot.org/mailman/listinfo/buildroot
>>> <https://lists.buildroot.org/mailman/listinfo/buildroot>
>>
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-06 22:46       ` Giulio Benetti
@ 2022-08-07  9:12         ` Stefano Cottafavi
  2022-08-07 22:08           ` Giulio Benetti
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Cottafavi @ 2022-08-07  9:12 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 5616 bytes --]

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@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@benettiengineering.com>
> > Date:
> > 06/08/22, 23:54
> >
> > To:
> > Stefano Cottafavi <stefano.cottafavi@gmail.com>
> > CC:
> > buildroot@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@benettiengineering.com
> >> <mailto:giulio.benetti@benettiengineering.com>> wrote:
> >>
> >>     Hi Stefano,
> >>
> >>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
> >>>     <stefano.cottafavi@gmail.com <mailto:stefano.cottafavi@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@Benetti Engineering sas
> >>
> >>>
> >>>     Cheers,
> >>>     Stefano
> >>>     _______________________________________________
> >>>     buildroot mailing list
> >>> buildroot@buildroot.org <mailto:buildroot@buildroot.org>
> >>> https://lists.buildroot.org/mailman/listinfo/buildroot
> >>> <https://lists.buildroot.org/mailman/listinfo/buildroot>
> >>
> >>
> >> _______________________________________________
> >> buildroot mailing list
> >> buildroot@buildroot.org
> >> https://lists.buildroot.org/mailman/listinfo/buildroot
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>

[-- Attachment #1.2: Type: text/html, Size: 10188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
  2022-08-07  9:12         ` Stefano Cottafavi
@ 2022-08-07 22:08           ` Giulio Benetti
  0 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2022-08-07 22:08 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot

Hi Stefano,

On 07/08/22 11:12, Stefano Cottafavi wrote:
> 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

This passes correctly:
-DBUILD_opencv_objdetect=ON
to OPENCV4_CONF_OPTS in package/opencv4/opencv4.mk

The problem is during opencv4 where you can find:
"
-- Module opencv_objdetect disabled because opencv_dnn dependency can't 
be resolved!
"

so opencv_objdetect needs opencv_dnn, but then opencv_dnn needs
protobuf:
https://github.com/opencv/opencv/blob/4.x/modules/dnn/CMakeLists.txt#L5-L7

otherwise cmake disables dnn that is required by objdetect.

So, what you can do now to have objdetect built and find its headers
is to enable in Buildroot configuration:
BR2_PACKAGE_OPENCV4_WITH_PROTOBUF=y (that will select BR2_PACKAGE_PROTOBUF)
and:
BR2_PACKAGE_OPENCV4_LIB_DNN=y

Then please build from scratch with:
$ make clean; make

What I can do instead is to create a patch for Buildroot that selects
BR2_PACKAGE_OPENCV4_LIB_DNN if BR2_PACKAGE_OPENCV4_LIB_OBJDETECT is
enabled and that also selects BR2_PACKAGE_OPENCV4_WITH_PROTOBUF if
BR2_PACKAGE_OPENCV4_LIB_DNN is enabled.

Let me know if it works for you too.

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

> - 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@benettiengineering.com 
> <mailto:giulio.benetti@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@benettiengineering.com
>     <mailto:giulio.benetti@benettiengineering.com>>
>      > Date:
>      > 06/08/22, 23:54
>      >
>      > To:
>      > Stefano Cottafavi <stefano.cottafavi@gmail.com
>     <mailto:stefano.cottafavi@gmail.com>>
>      > CC:
>      > buildroot@buildroot.org <mailto:buildroot@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>
>     <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
>     <http://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
>     <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@benettiengineering.com
>     <mailto:giulio.benetti@benettiengineering.com>
>      >> <mailto:giulio.benetti@benettiengineering.com
>     <mailto:giulio.benetti@benettiengineering.com>>> wrote:
>      >>
>      >>     Hi Stefano,
>      >>
>      >>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
>      >>>     <stefano.cottafavi@gmail.com
>     <mailto:stefano.cottafavi@gmail.com>
>     <mailto:stefano.cottafavi@gmail.com
>     <mailto:stefano.cottafavi@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@Benetti Engineering sas
>      >>
>      >>>
>      >>>     Cheers,
>      >>>     Stefano
>      >>>     _______________________________________________
>      >>>     buildroot mailing list
>      >>> buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>     <mailto:buildroot@buildroot.org <mailto:buildroot@buildroot.org>>
>      >>> https://lists.buildroot.org/mailman/listinfo/buildroot
>     <https://lists.buildroot.org/mailman/listinfo/buildroot>
>      >>> <https://lists.buildroot.org/mailman/listinfo/buildroot
>     <https://lists.buildroot.org/mailman/listinfo/buildroot>>
>      >>
>      >>
>      >> _______________________________________________
>      >> buildroot mailing list
>      >> buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>      >> https://lists.buildroot.org/mailman/listinfo/buildroot
>     <https://lists.buildroot.org/mailman/listinfo/buildroot>
>      >
>      > _______________________________________________
>      > buildroot mailing list
>      > buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>      > https://lists.buildroot.org/mailman/listinfo/buildroot
>     <https://lists.buildroot.org/mailman/listinfo/buildroot>
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] OpenCV modules headers not in the SDK
@ 2022-08-07 18:12 Giulio Benetti
  0 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2022-08-07 18:12 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 6167 bytes --]

Hi Stefano,

I give a try tonight and let you know.

Giulio

Inviato da iPhone

> Il giorno 7 ago 2022, alle ore 11:13, Stefano Cottafavi <stefano.cottafavi@gmail.com> ha scritto:
> 
> 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@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@benettiengineering.com>
>> > Date:
>> > 06/08/22, 23:54
>> > 
>> > To:
>> > Stefano Cottafavi <stefano.cottafavi@gmail.com>
>> > CC:
>> > buildroot@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@benettiengineering.com 
>> >> <mailto:giulio.benetti@benettiengineering.com>> wrote:
>> >>
>> >>     Hi Stefano,
>> >>
>> >>>     Il giorno 6 ago 2022, alle ore 19:29, Stefano Cottafavi
>> >>>     <stefano.cottafavi@gmail.com <mailto:stefano.cottafavi@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@Benetti Engineering sas
>> >>
>> >>>
>> >>>     Cheers,
>> >>>     Stefano
>> >>>     _______________________________________________
>> >>>     buildroot mailing list
>> >>> buildroot@buildroot.org <mailto:buildroot@buildroot.org>
>> >>> https://lists.buildroot.org/mailman/listinfo/buildroot
>> >>> <https://lists.buildroot.org/mailman/listinfo/buildroot>
>> >>
>> >>
>> >> _______________________________________________
>> >> buildroot mailing list
>> >> buildroot@buildroot.org
>> >> https://lists.buildroot.org/mailman/listinfo/buildroot
>> > 
>> > _______________________________________________
>> > buildroot mailing list
>> > buildroot@buildroot.org
>> > https://lists.buildroot.org/mailman/listinfo/buildroot
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

[-- Attachment #1.2: Type: text/html, Size: 11283 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-07 22:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06 17:28 [Buildroot] OpenCV modules headers not in the SDK Stefano Cottafavi
2022-08-06 17:43 ` Giulio Benetti
2022-08-06 18:15   ` Stefano Cottafavi
2022-08-06 21:54     ` Giulio Benetti
2022-08-06 22:46       ` Giulio Benetti
2022-08-07  9:12         ` Stefano Cottafavi
2022-08-07 22:08           ` Giulio Benetti
2022-08-07 18:12 Giulio Benetti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.