Fix for (Bug #2789)

Add MatlabFormatter for matlab style output.
See http://code.opencv.org/issues/2789
Merge branch 'master' into matlab_formatter
fixing accum_dist and operator() mismatching for HellingerDistance and KL_Divergence
Added function decomposeHomographyMat. New files added are homography_decomp.cpp and test_homography_decomp.cpp.
Modified files calib3d.hpp and camera_calibration_and_3d_reconstruction.rst.
Fixed warnings and parameter name mismatches, added #include needed in some platforms.
cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>).
Implemented Kullback-Leibler divergence
Fixed scanning bug identified in comments in pull request #1119.
NFA calculations now generate better line segments.
Unroll pyrUp kernel
Removed useless multiplication by 4
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
some optimizaions of cv::pow
optimized cv::calcHist
eliminated convertTo
optimized histogram merging
cv::equalizeHist
Added support for 3-channels
used built-in functions
used abs
used abs in reduction operations