Why include opencv header from opencv2 directory? - opencv3.0

I've installed last version of opencv.
I've followed some C++ tutorials and i do not understand something.
I have to include some files files like that
#include <opencv2/core/core.hpp>
When i print CV_VERSION constant value, it says me 3.1.0. This is the latest version.
So why should i include files in opencv2 directory and not opencv3 ?
Thanks

The opencv2 you include does not mean release 2.x. That is the folder that contains the header for all releases (2.x 3.x 4.x etc.) You can see that from opencv Github. The same folder is found under 2.4, 3.4, and 4.3.
I don't know where the name comes from. But someone explained here that
"folder opencv contains the header files for old fashion C style opencv functions and the folder opencv2 contains the headers for the new and more flexible C++ interface"

Related

gtsam is not able to find Eigen

I use version 4.1.1 of GTSAM. I have version 3.3.4 of Eigen installed.
The error is:
/usr/local/include/gtsam/base/OptionalJacobian.h:22:10: fatal error: Eigen/Dense: No such file or directory
#include <Eigen/Dense>
I tried building GTSAM with the flag -DGTSAM_USE_SYSTEM_EIGEN set to both on and off.
The same error message appears in both cases.
For reference this is a ROS project built with catkin.
Have you seen this PR: https://github.com/borglab/gtsam/pull/1304
If you can upgrade GTSAM to 4.2a8, it uses Eigen's find script's rather than custom ones and should properly find Eigen3, if you have it installed if you require to build from source.
Since you are using ROS, why not go the standard route... Have you declared a dependency on it in your package.xml and installed it with rosdep?
https://github.com/ros/rosdistro/pull/23198/files
Add to your package.xml:
<depend>gtsam</depend>
And, your CMakeLists, you just call
find_package(gtsam REQUIRED)
It is unclear to me, if gtsam is available through binaries, why you would be building it from source.
I was able to get it working by cloning version 4.0.3 of GTSAM into the src folder of my workspace, then building it with the following arguments:
-DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_POSE3_EXPMAP=ON -DGTSAM_ROT3_EXPMAP=ON

What is a .framework file and how can I get it?

I'm attempting to use OpenCV in Xcode. I've installed OpenCV 2.4.12 using Homebrew. The associated files are located in /usr/local/Cellar/opencv.
In the documentation I am instructed to add "opencv2.framework" to my project as a binary library. There is no opencv2.framework file anywhere in my opencv directory.
Do I have to make the .framework file or something?
Explore /System/Library/Frameworks for examples on your OS X system. These are bundles containing headers and the compiled framework binaries. If you don't have a .framework directory in the OpenCV resources that you installed, perhaps you installed the source code and you have to build the framework.

Stanford Word Segmenter download lacks source code

The download package for the Stanford Word Segmenter, e.g.
http://nlp.stanford.edu/software/stanford-segmenter-2015-01-29.zip
does not include any source code, though the web page
http://nlp.stanford.edu/software/segmenter.shtml
suggests that it should: "The download is a zipped file consisting of model files, compiled code, and source files". The download does include a build.xml file, but the lack of a src directory means that ant doesn't work (specifically complaining that it can't find the expected src directory).
And src seems to be needed, because without recompilation, attempt to use the demo script results in an "Unsupported major.minor version 52.0" error.
The sources are contained within the jar file called stanford-segmenter-3.5.1-sources.jar. All these sources are also included within the larger CoreNLP package, whose source you can browse on GitHub.
And src seems to be needed, because without recompilation, attempt to use the demo script results in an "Unsupported major.minor version 52.0" error.
Stanford NLP tools version 3.5 and later require Java 8. You need to either update your JDK version or downgrade to the Segmenter 3.4.1 (this is the last version compatible with Java 7).

Xcode does not detect tesseract and opencv headers

I am trying to compile a C++ project that uses OpenCV and Tesseract(not iOS) in Xcode 5.1. I have downloaded OpenCV and Tesseract and the header and library files are sitting in my /usr/local/include/ and /usr/local/lib/ folders respectively.
I have tried modifying my Xcode project "Header search paths" and "Library search paths" to include the above two folders according to this.
However, I am getting the following compilation errors in round robin fashion
"Lexical Preprocessor Issue - 'tesseract\baseapi.h' file not found"
"Lexical Preprocessor Issue - 'opencv\cv.h' file not found"
I have also tried adding specific paths for tesseract and opencv with no luck.
Has anyone fixed this issue before?
The issue was fixed when the libraries were added to the Xcode project. Refer to https://gist.github.com/balazspete/6982565

what happened to SDL_mixer.h?

I am trying to get some open source C++ code to compile in xcode. It uses the SDL library. I downloaded SDL 2.0 for OS X and installed it and things are working -- but the download didn't seem to include the file SDL_mixer.h -- which is referenced in the code, as shown below.
#include <SDL/SDL_mixer.h>
What happened to this file? Did it get dropped from SDL? What do I do to work around the missing file to get the code working?
SDL Mixer has always been a separate library you have to install next to your SDL.
To fix your problem, download and install the library in such a way that SDL_mixer.h is located in an SDL/ folder of your include paths.
Install the SDL Mixer framework and add a reference to it in your project.
Include the SDL_Mixer.h header like so:
#include <SDL2_Mixer/SDL_Mixer.h>

Resources