Fix for (Bug #2789)

Add MatlabFormatter for matlab style output.
See http://code.opencv.org/issues/2789
Merge branch 'master' into matlab_formatter
cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>).
Fixed scanning bug identified in comments in pull request #1119.
NFA calculations now generate better line segments.
Issue #3709 - PyBindings for LSD

Corrected crashing in Python bindings while using LSD_REFINE_NONE flags
Corrected not drawing lines in drawSegments and compareSegments in Python bindings
used built-in functions
used abs
used abs in reduction operations
Removed "CV_" prefix from constants in docs

The `calib3d.hpp` has a definition of the constant that does not contain the prefix "CV_".
The affected methods were `findHomography` and `findEssentialMat`.
Now the documentation updates the definition of the constants to conform to the header.
optimization of cv::warpAffine INTER_CUBIC
cvtColor - optimized index calculations; usage of build-in functions
added 32s to 32u conversion
optimized cv::inRange
Change kernel for optimization. Remove restriction to align data

Fix kernel compilation errors on AMD system

Fix licanse information in cl file

Support CV_64F destination type

Change build options of the kernel

Optimize sum of square

Remove separate kernel for integral square

Increase epsilon for perfomance tests

Increase epsilon for perfomance tests

Test double support on AMD devices

Fix some issues

Try to fix problems with AMD device

Try to solve problem with AMD device

Fix error of destination size in kernel

Fix warnings
removed contrib, legacy and softcsscade modules; removed latentsvm and datamatrix detector from objdetect. removed haartraining and sft apps.
some of the stuff will be moved to opencv_contrib module.
in order to make this PR pass buildbot, please, comment off opencv_legacy, opencv_contrib and opencv_softcascade test runs.
put the detection-based tracker back (to objdetect module), so that the Android face detection sample builds fine. The patch by Konstantin Matskevich that adds C++11 threads support has been merged in too. Also, fixed compile error in the doc builder.
removed extra whitespaces
fixed compile warnings on Windows
fixed some more compile warnings on Windows
Merge pull request #2894 from vpisarev:cleanup_project_tree1