Pick centers in KMeans++ with a probability proportional to their distance^2, instead of simple distance, to previous centers
Apply to KMeansIndex KMeanspp the same modification as in HierarchicalClusteringIndex
As some processed distances are already ^2, use template to select whether or not we have to ^2 in KMeanspp
Move templates in dist.h in order to share them between KMeansIndex and HierarchicalClusteringIndex classes.
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.
fix tiled read for reading tiles into partial blocks in image
Revert "disable gpu Subtract_Array test:"

This reverts commit e91bf95d5832e87aa70240c50f0bf7fcc587e8c8.
Revert "disable gpu CvtColor.*2HSV tests:"

This reverts commit 952027a8536215a5e4308c79a59308c6b3426354.
fix epsilons for several gpu tests
Revert "disable CUDA generalized Hough Transform"

This reverts commit 33d42b740c6fe938b63a0b25c9ad51741aba48c3.
dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a.
fix nonfree module compilation without CUDA
Merge pull request #2300 from asmorkalov:android_no_cuda_not_armeabiv7a
Implicit testdata directory permissions setup added.
Revert "disable gpu Canny and HoughCircles perf tests:"

This reverts commit dbce90692acd84fbf46bde4da4b1726049f42857.
Merge pull request #2297 from asmorkalov:ocv_testdata_install_perms_fix
Merge pull request #2301 from jet47:fix-nonfree-build
fixed several bugs in CUDA Canny implementation:

* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd
Merge pull request #2294 from jet47:fix-gpu-issues
Merge pull request #2303 from jet47:gpu-canny-fix