mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge branch 4.x
This commit is contained in:
@@ -211,5 +211,20 @@ INSTANTIATE_TEST_CASE_P(Imgproc_Hist, Imgproc_Equalize_Hist, ::testing::Combine(
|
||||
::testing::Values(cv::Size(123, 321), cv::Size(256, 256), cv::Size(1024, 768)),
|
||||
::testing::Range(0, 10)));
|
||||
|
||||
// See https://github.com/opencv/opencv/issues/24757
|
||||
TEST(Imgproc_Hist_Compare, intersect_regression_24757)
|
||||
{
|
||||
cv::Mat src1 = cv::Mat::zeros(128,1, CV_32FC1);
|
||||
cv::Mat src2 = cv::Mat(128,1, CV_32FC1, cv::Scalar(std::numeric_limits<double>::max()));
|
||||
|
||||
// Ideal result Wrong result
|
||||
src1.at<float>(32 * 0,0) = +1.0f; // work = +1.0 +1.0
|
||||
src1.at<float>(32 * 1,0) = +55555555.5f; // work = +55555556.5 +55555555.5
|
||||
src1.at<float>(32 * 2,0) = -55555555.5f; // work = +1.0 0.0
|
||||
src1.at<float>(32 * 3,0) = -1.0f; // work = 0.0 -1.0
|
||||
|
||||
EXPECT_DOUBLE_EQ(compareHist(src1, src2, cv::HISTCMP_INTERSECT), 0.0);
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
/* End Of File */
|
||||
|
||||
Reference in New Issue
Block a user