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
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.
changed support for 3-channels, changed CCOEFF
changed CCOEFF cn==1
added dft for CCORR
used vector data types for CCORR cn==1
Move some variables into #ifdef
Change uchar2 to short
added extra condition
replaced factors computation by precomputed values, added kernel for
binary mode
Fixed core for CCORR and SQDIFF. Used float instead of int for CV_8U. Fixed conditions for call dft.
Merge pull request #2874 from vbystricky:ocl_LUTAMDfix
Merge pull request #2887 from ilya-lavrenov:ipp_morph_fix
Updates python feature matching tutorial

The given ORB parameter was misspelled
Merge pull request #2892 from PhilLab:patch-1
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.