mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge pull request #22164 from lamm45:hough-angles
Fix angle discretization in Hough transforms
This commit is contained in:
@@ -329,6 +329,17 @@ TEST(HoughLinesPointSet, regression_21029)
|
||||
EXPECT_TRUE(lines.empty());
|
||||
}
|
||||
|
||||
TEST(HoughLines, regression_21983)
|
||||
{
|
||||
Mat img(200, 200, CV_8UC1, Scalar(0));
|
||||
line(img, Point(0, 100), Point(100, 100), Scalar(255));
|
||||
std::vector<Vec2f> lines;
|
||||
HoughLines(img, lines, 1, CV_PI/180, 90, 0, 0, 0.001, 1.58);
|
||||
ASSERT_EQ(lines.size(), 1U);
|
||||
EXPECT_EQ(lines[0][0], 100);
|
||||
EXPECT_NEAR(lines[0][1], 1.57179642, 1e-4);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P( ImgProc, StandartHoughLinesTest, testing::Combine(testing::Values( "shared/pic5.png", "../stitching/a1.png" ),
|
||||
testing::Values( 1, 10 ),
|
||||
testing::Values( 0.05, 0.1 ),
|
||||
|
||||
Reference in New Issue
Block a user