OpenCV 2.4.7 GPL Licensing Issue with mser.cpp - c++

I am using openCV 2.4.7 with C++ to build an application which will eventually be distributed. As far as I understand, openCV falls under the BSD open source license.
However, I found that there is a package called features2d which has a class called MSER which uses a table called "chitab3". This table is extracted from a paper which is under GPL. This is present in the source code of modules/features2d/src/mser.cpp as follows:
The color image algorithm is taken from: Maximally Stable Colour Regions for Recognition and Match;
it should be much slower than grey image method ( 3~4 times );
the chi_table.h file is taken directly from paper's source code which is distributed under GPL.
Since the MSER class is available in features2d, when features2d.dll is distributed so is MSER and eventually chitab3 as well.
All this led to the following questions:
What would be the best practice to prevent the usage of chitab3? I have no use for the MSER class but need the features2d.dll as it has other modules required for the application.
If chitab3 is under GPL, even MSER, features2d and openCV should be under GPL. Why is openCV under BSD although one of it's modules is under GPL?

You should report this issue directly to the OpenCV team to make them aware of it.
For your application, you can simply recompile OpenCV from the sources after moving MSER to the non-free OpenCV module, and explicitly disabling the non-free module in the build system. Then, the dll that you ship does not contain any data/code that cannot be used at your own convenience.

Related

Generated C++ code using MATLAB Coder : Compilation Error "undefined reference to `rgb2gray_tbb_real64'"

Generated C++ code from MATLAB for converting an image to grayscale, using MATLAB Coder. While compiling it on Dev C++ it shows error- undefined reference to rgb2gray_tbb_real64
One of the Generated code uses header file libmwrgb2gray_tbb.h. Screenschot It calls a function rgb2gray_tbb_real64, which is not defined anywhere.
How to sort this out?
Image Processing Toolbox code generation supports 2 distinct modes:
Generated code uses platform-specific optimized shared libraries. This is enabled for the MATLAB Coder hardware target MATLAB Host Computer and a few other similar targets.
Generated code is standalone, independent of shared libraries, and portable
The documentation covers these concepts in more detail. When using option (1), you must package the generated code using Coder utilities in order to relocate it. MATLAB Coder knows how to properly gather and package all of the dependencies for your generated code.
To do this packaging, you can use the packNGo function, use the Package button on the Finish Workflow screen of the MATLAB Coder App, or the Package Code button in the MATLAB Coder report. These steps are detailed in the MATLAB Coder documentation. To use packNGo you can:
codegen myFunction -args {1,2,3} -config:lib -report
load(fullfile('codegen','lib','myFunction','buildInfo.mat'));
packNGo(buildInfo, 'fileName', 'myFunction.zip');
That will create myFunction.zip in your current directory which will contain your generated code and all of the headers and libraries on which it depends. You can then import all of those into your IDE of choice.

Using OpenCV 3.3.1 on Qt Creator 3.5.1 on Linux Mint (latest kernel)

I'm trying too make a project in C++ using OpenCV via Qt Creator. I have not written any code yet as such, I'm just trying to get my project to access my openCV file.
I've tried a couple of methods I found on google, namely editing the $PKG_CONFIG_PATH variable:
echo $PKG_CONFIG_PATH
:/home/jess/Documents/SRI/TER/opencv-3.3.1`
(/home/jess... is where the openCV files are - as obtained and extracted from the website)
my .pro file looks like this:
QT += core gui
# add open CV
CONFIG += link_pkgconfig
PKGCONFIG += opencv-3.3.1
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
And when I build the project it tells me that openCV cannot be found (I have also tested using the name "openCV-3.3.1", same result)
if anyone can give me any pointers as to where I'm going wrong, I would be most grateful!
You need to have OpenCV dev version installed on your system. Fortunately OpenCV can be found in official Ubuntu/Mint repositories. To start developing OpenCV apps you need to install its -dev version.
sudo apt install libopencv-dev
Ok. Now head to your project's .pro file and link your project to OpenCV.
LIBS += -lopencv_core -lopencv_highgui
Make sure you've added all the OpenCV modules you need. OpenCV have the following modules:
core - a compact module defining basic data structures, including the dense multi-dimensional array Mat and basic functions used by all
other modules.
imgproc - an image processing module that includes linear and non-linear image filtering, geometrical image transformations (resize,
affine and perspective warping, generic table-based remapping), color
space conversion, histograms, and so on.
video - a video analysis module that includes motion estimation, background subtraction, and object tracking algorithms.
calib3d - basic multiple-view geometry algorithms, single and stereo camera calibration, object pose estimation, stereo correspondence
algorithms, and elements of 3D reconstruction.
features2d - salient feature detectors, descriptors, and descriptor matchers.
objdetect - detection of objects and instances of the predefined classes (for example, faces, eyes, mugs, people, cars, and so on).
highgui - an easy-to-use interface to simple UI capabilities.
videoio - an easy-to-use interface to video capturing and video codecs.
gpu - GPU-accelerated algorithms from different OpenCV modules.
... some other helper modules, such as FLANN and Google test wrappers, Python bindings, and others.
To link your project to another module just add a -lopencv_<module> to LIBS. That's it!

Image Library (IMGLIB) on Gumstix?

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

dll for voice recognition through kinect needed for c++ project

i am new to kinect development, I have watched the sample project for speech recognition with name "SpeechBasics-D2D" given in kinect sdk. it works fantastic. I need this whole project as class library (like .dll file). I have removed "TurtleController" class from project and all its refrences. (still worked fine). then I removed GUI part and try to initiate the class "SpeechBasics" from my main project, it does not start listening through kinect. I just convert the sample project "SpeechBasics-D2D" to class library project and try to call it from my main project. kindly give me some suggessions as i am stuck at this point, thanks in advance
The Kinect demo applications are using the Microsoft Speech Platform SDK; Version 11 being the latest.
http://www.microsoft.com/en-us/download/details.aspx?id=27226
In the C++ example I'd look through the "CSpeechBasics::CreateFirstConnected()" function. This is the function that finds the Kinect sensor and links it to the Speech SDK. The additional function calls made from it are all related to that.
Take note of what calls are being made into the references created here. Those are how the rest of the program are linking into the Speech SDK (the Kinect only serves as a microphone), and thus are what you will want to expose with your DLL.
Also - I'd recommend adding the "speech-recognition" and possibly the "speechrecognitionengine" tag to this post. That may capture a few more people who have tackled this.

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.