Introduce CV_COMP_CHISQR_ALT, an alternative method to calculate ChiSquare Histogram comparison

There's some disagreement about the correct formula.
has its supporters, however, for texture analysis, the newly introduced formula became
standard. The commit enables both uses without breaking backward compatibility.

First contributor of this commit was sperrholz.
Fix GPU example build failed with cuda 5.5
OCL: tests: repair/disable failed tests in ocl module
OCL: tests: repair moments implementation in master branch, enable tests
Update cmake files by using CUDA_CUDA_LIBRARIES
fixed cpp wrappers of ML tree-based models
Removed old Python detection cruft.

None of this should be relevant as of CMake 2.8.7.
Bumped minimal Python version to 2.6.

Rationale: we already depend on it (e.g. some scripts use print_function).
Refactored NumPy detection.

Most importantly, added support for multiple include directores,
but also did some general cleanup.
Moved Sphinx detection outside of the PYTHONINTERP_FOUND block.

Who knows, maybe the user's Sphinx installation uses a Python we couldn't find.
Ignore Windows' Thumbs.db
Merge pull request #1340 from SpecLad:python-updates
Merge pull request #1327 from alalek:ocl_master_tests_fix
correct range computations, it is difficult to do the more efficient single pass 3N/2 implementations correctly in this particular setting without costing more than they save
Merge pull request #1339 from mdim:ml_cpp_wrappers_fix
Merge pull request #1267 from clhsieh:gpu_example_build_failed_with_cuda5p5
Merge commit '43aec5ad^' into merge-2.4

Conflicts:
	modules/contrib/src/inputoutput.cpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpuarithm/perf/perf_element_operations.cpp
	modules/gpuarithm/src/element_operations.cpp
	modules/ts/src/precomp.hpp
Merge commit '43aec5ad' into merge-2.4

Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVLegacyOptions.cmake
	modules/contrib/src/retina.cpp
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/video.rst
	modules/gpu/src/speckle_filtering.cpp
	modules/python/src2/cv2.cv.hpp
	modules/python/test/test2.py
	samples/python/watershed.py
War on Whitespace, master edition: trailing spaces.
War on Whitespace, master edition: file endings.