Fix equalization formula in equalizeHist function & rewrite in C++

Old implementation did

    lut[i] = 255 * (count(Y <= i)) / (width * height)

which actually shifts uniform histograms.
From now histogram is equalized as

    C = count(Y == min(Y))
    lut[i] = 255 * (count(Y <= i) - C) / (width * height - C)
Merge pull request #224 from wswld:2.4
use opencv's integer type convension
disable windows build warning for connectedcomponents template argument comparisons
Add support for multidimentional matrices into the sanity checks
Merge branch 'master' of https://github.com/nevion/opencv into cc
fixed build warnings from VS; hopefully, fixes Android build too
Merge pull request #227 from taka-no-me:sanity_MatND
Merge pull request #225 from pieleric:2.4
proper dimensions from cv::Size in output stats/centroid
fast optical flow bm implementation
drop usage of macros... the type is already there!
TBB version of calcHist
updated gpu houghlines sample
perf tests for calcHist 2-3D case
replaced _mm_packs_epi32 to _mm_packus_epi32
Merge remote-tracking branch 'upstream/master' into SIMDFastAreaResize-2
removed debug messages
changed loop condition
added #undef _mm_packus_epi32