1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

Revert "documentation: avoid links to 'master' branch from 3.4 maintenance branch"
This reverts commit 9ba9358ecb.

Revert "documentation: avoid links to 'master' branch from 3.4 maintenance branch (2)"
This reverts commit f185802489.
This commit is contained in:
Alexander Alekhin
2018-06-04 19:24:09 +03:00
147 changed files with 5707 additions and 2831 deletions
+30
View File
@@ -1918,5 +1918,35 @@ TEST(Imgproc_Hist_CalcBackProject, accuracy) { CV_CalcBackProjectTest test; test
TEST(Imgproc_Hist_CalcBackProjectPatch, accuracy) { CV_CalcBackProjectPatchTest test; test.safe_run(); }
TEST(Imgproc_Hist_BayesianProb, accuracy) { CV_BayesianProbTest test; test.safe_run(); }
TEST(Imgproc_Hist_Calc, calcHist_regression_11544)
{
cv::Mat1w m = cv::Mat1w::zeros(10, 10);
int n_images = 1;
int channels[] = { 0 };
cv::Mat mask;
cv::MatND hist1, hist2;
cv::MatND hist1_opt, hist2_opt;
int dims = 1;
int hist_size[] = { 1000 };
float range1[] = { 0, 900 };
float range2[] = { 0, 1000 };
const float* ranges1[] = { range1 };
const float* ranges2[] = { range2 };
setUseOptimized(false);
cv::calcHist(&m, n_images, channels, mask, hist1, dims, hist_size, ranges1);
cv::calcHist(&m, n_images, channels, mask, hist2, dims, hist_size, ranges2);
setUseOptimized(true);
cv::calcHist(&m, n_images, channels, mask, hist1_opt, dims, hist_size, ranges1);
cv::calcHist(&m, n_images, channels, mask, hist2_opt, dims, hist_size, ranges2);
for(int i = 0; i < 1000; i++)
{
EXPECT_EQ(hist1.at<float>(i, 0), hist1_opt.at<float>(i, 0)) << i;
EXPECT_EQ(hist2.at<float>(i, 0), hist2_opt.at<float>(i, 0)) << i;
}
}
}} // namespace
/* End Of File */