When a cluster is empty for KMeans, it's better to give it the point from another cluster j that is the furthest one from center j.
modified OpenCL SURF API and the tests in 2.4.x to prove that it gives different from CPU results
made SURF_OCL default constructor parameters the same as SURF
modified SURF's performance test to test OpenCL version as well
fixed doc builder warnings; make sure the tests give reasonable results when OpenCL is not available
Implicit CUDA and OpenCL control for module definition added.

Feature allows to exclude CUDA or OpenCL optimizations at all even CUDA is used
on build. Exclusion of CUDA or OpenCL cut unwanted dependencies.
fix: use "cvAlloc" wrapper function for malloc.
Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in BackgroundSubtractorMOG2
fix: use "cvAlloc" wrapper function for malloc.
fixed  h / s ranges in histogram_calculation tutorial

literalinclude

literalinclude, dropped :lines:
Merge pull request #2460 from berak:b_3598_24
minor doc fix
made the example consistent with the fuction definition and improved doc

made the example consistent with the fuction definition and improved doc
remove intel guard since the code is 2 times faster on AMD too
It's will be better
I have changed one sentence in tutorial, making it more understandable
Merge pull request #2026 from pemmanuelviel:giveFurthestPoint
Merge pull request #2456 from kurodash:pr_use_cvAlloc
Merge pull request #2488 from Nerei:minor_doc
Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_weight_bugfix