Image Library (IMGLIB) on Gumstix? - c++

I need to run AprilTags C++ algorithm on gumstix using DSP image library. Without DSP, Algorithm is eating up 85% cpu with 4fps. I am trying to get TI Image Library IMGLIB on Gumstix with Yocto Project. I could not find any resources or hints how to do it.
It would be great if I can get some inputs on how to proceed with getting imglib on gumstix using yocto project/open-embedded
Should I write a recipe with bitbake or is there any other way to get IMGLIB on Gumstix?

Try to bitbake the TI Image Library IMGLIB, and you should obtain
a library and modules DSPlink, CMem, etc which should be used to
communicate with the Gumstix DSP. In your application you link
to the library (e.g. specify its path in the makefile) and add
the include header (.h) in your application source code. That
is the theory anyway. I have bitbaked it and trying to use IMGLIB
now. Can report some progress. What OS/kernel you are using ?
Brahim

Related

Bundle and build libcurl along with custom lib

Problem
How can I distribute a c++ library as source code along with the source code of libcurl and let the consumer of the library handle building it as needed? I'm using FastBuild as a build system.
Context
I have a C++ library that I distribute as source and let the clients handle building it along with their code.
The repo includes the source for a dependency as well, tinyxml, which is built along with the library itself thus becoming completely transparent for the clients.
It has worked fine up to now but clearly does not scale well for more complex dependencies, such as libcurl.
Things I've considered as an alternative to bundling libcurl's source
have pre-compiled libraries of libcurl. But I don't know which platforms/flags the consumer is going to use
have libcurl installed on the build machine. It would require extra setup steps for the consumer, it won't be just pulling the code and using
Edit 1: Update with build system
You didn't mention which build system are you using.
If you are using cmake, you can make use of ExternalProject_Add to download/build/install the dependent library.
See examples:
https://cmake.org/cmake/help/git-stage/module/ExternalProject.html#examples
If I understand you correctly you need that any client who obtains source code of your library would be able to also obtain corresponding source code of libcurl and tinyxml libraries.
Personally I would use cmake for that purpose as #brokenfoot has already suggested. But instead of ExternalProject_Add it seems that in your case FetchContent would be enough and less complicated: https://cmake.org/cmake/help/latest/module/FetchContent.html

How to load checkpoint and inference with C++ for tensorflow?

I have Tensorflow with python api and got these checkpoint model file:
model.ckpt-17763.data-00000-of-00001
model.ckpt-17763.index
model.ckpt-17763.meta
But I want a C/C++ shared library (.so file) when integrating into production. So I need to load these model file and inference with C++ code and compile to a shared library. Is there some tutorial or sample for doing this?
You can write c++ code to load and use your graph with the instructions given here.
You can use the files here to make a Cmake project with tensorflow outside the TF repository, and compile your library.
However, you'll still need the .ckpt files next to your .so, I don't know how to intergate them inside it.
There are a lot of questions about that on S.O., and a few tutorials (see the two cited in this answer) but since tensorflow is evolving fast, they quickly become outdated, and it's always a bit of struggle to get it to work properly (totally feasible, and getting easier, though).

Can't configure OpenCV with Qt properly?

I'm trying to configure OpenCV (3.1) with Qt Creator on Windows 32 and 64 bit for a long time to create a GUI application but I just can't seem to solve this configuration part. I've tried and read a lot of tutorials there are on the internet (https://zahidhasan.wordpress.com/2014/08/19/qt-5-3-1-64-bit-mingw-windows/ for example) but with no success.
When I try to run my program, I'm getting these errors:
enter image description here
To use a library, you have to reference its headers (and that is what you have done correctly with your #include directives).
But you also have to point the linker to the location and names of libraries to link. That is currently missing in your configuration, because you get undefined reference errors from linker.
Hard to tell anything more without knowing more details on your setup so far.
Depending on your environment and the build of OpenCV you need, you need to configure your project to use static libraries or DLLs (I assume we speak about Windows here).
As you use imread(), you will surely need the opencv_highgui*.* library, but this will surely not suffice.
See e.g. this OpenCV documentation for a complete list of OpenCV libraries.

ArUco program from scratch

I'm using the ArUco library with OpenCV (more information here) but I can't find a way to build and run a program from scratch.
Once I installed the library I have access to different examples but if I want for instance to create a new file and add the library headers inside it, how can I compile and run it ? (with a command line or IDE, anything is fine)
Thank you
I sent and email to the library's author and he added clear instructions at the end of the project webpage :)
It seems you need to learn how to use your IDE's, compilation tools and general compilation basic stuff. This is not a question related to Aruco, or mostly any other tags you have set.
Try to lean CMake first, 'cause Aruco compilation is based on CMake: http://www.cmake.org/
You can start by just editing the aruco_simple example.
For a IDE that works right away with CMake you can try either Qt Creator >3.1 or KDevelop. Both free.

Getting Webcam to work in OpenCV

I'm trying to get my webcam to capture video in OpenCV, version 2.2 in Windows 7 64 bit. However, I'm having some difficulties. None of the sample binaries that come with OpenCV can detect my webcam. Recently I came across this posting which suggested that the answer lies in recompiling a file, opencv_highgui with the property HAVE_VIDEOINPUT HAVE_DSHOW in the property page.
Can't access webcam with OpenCV
However, I'm unsure about procedurally how to do this. Can someone recommend as to how to go about this? Thanks.
Roughly, these are the important steps:
Download the OpenCV 2.2 source code,
set up a project to compile it, according to the InstallGuide,
make any changes you need to make in the code,
build the opencv_highgui library (dll and lib files, probably), and
replace these in your original project.
If you can configure the project to generate the highgui files only (and not every library in OpenCV), do so, since the change you need to do shouldn't affect other modules. This saves some time.
The detailed instructions to build OpenCV are in: http://opencv.willowgarage.com/wiki/InstallGuide. You should follow this guide.