OpenCV g++ compile

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OpenCV g++ compile

2,226件の閲覧回数
HT_MOB
Contributor II

I got imx8mpevk and implemented imx-image-full on the board with Yocto rev.5.10.9_1.0.0.

I want to build tensorflow-lite with c ++, but I don't know how to link the opencv library with g++ options.

How do I compile the opencv library?

For example, on ubuntu, amd64
g++ -o <> .o <> .cpp `pkg-config opencv4 --libs --cflags`
If you command like, the compilation will succeed.

On the board, I found the opencv library in find in the following location:
/usr/lib/libopencv_core.so.4.4.0
/usr/lib/libopencv_imgproc.so.4.4.0

0 件の賞賛
返信
3 返答(返信)

2,213件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello HT_MOB,

One alternative to using Tensorflow C++ API I found is to use cppflow.

It's a lightweight C++ wrapper around Tensorflow C API. You get very small executables and it links against the libtensorflow.so already compiled file. There are also examples of use and you use CMAKE instead of Bazel.

https://www.tensorflow.org/lite/api_docs/cc

 

Regards

 

0 件の賞賛
返信

2,204件の閲覧回数
HT_MOB
Contributor II

Hellow Bio_TICFSL.

I was able to compile the tensorflow library with c ++ on my host pc using the method you showed.

How do I deploy this compiled bin to imx8mpevk?

I copied the bin generated on the host pc to imx8mpevk and ran it, resulting in an error like this:

root @ imx8mpevk: ~ / source / tensolflow_test # ./main
-sh: ./main: cannot execute binary file: Exec format error

 

I think this error is due to an architectural difference.
I'm assuming you have a device cross-compilation environment, do you have one?

 

0 件の賞賛
返信

2,150件の閲覧回数
HT_MOB
Contributor II

Does anyone know the problem above?

0 件の賞賛
返信