Commit 3350533f authored by Daniel Angelov's avatar Daniel Angelov

Fixed ambiguouty error, signess compare.

parent 6bd5e12b
......@@ -135,7 +135,7 @@ inline bool AsmallerB_XoverY(const edge& a, const edge& b)
inline double log_gamma_windschitl(const double& x)
{
return 0.918938533204673 + (x-0.5)*log(x) - x
+ 0.5*x*log( x*sinh(1/x) + 1/(810.0*pow(x,6.0)));
+ 0.5*x*log(x*sinh(1/x) + 1/(810.0*pow(x, 6.0)));
}
/**
......@@ -221,7 +221,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
Mat gaussian_img;
const double sigma = (SCALE < 1)?(SIGMA_SCALE / SCALE):(SIGMA_SCALE);
const double sprec = 3;
const unsigned int h = (unsigned int)(ceil(sigma * sqrt(2 * sprec * log(10))));
const unsigned int h = (unsigned int)(ceil(sigma * sqrt(2 * sprec * log(10.0))));
Size ksize(1 + 2 * h, 1 + 2 * h); // kernel size
GaussianBlur(image, gaussian_img, ksize, sigma);
// Scale image to needed size
......@@ -234,7 +234,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
ll_angle(rho, N_BINS, list);
}
LOG_NT = 5 * (log10(double(img_width)) + log10(double(img_height))) / 2 + log10(11);
LOG_NT = 5 * (log10(double(img_width)) + log10(double(img_height))) / 2 + log10(11.0);
const int min_reg_size = int(-LOG_NT/log10(p)); // minimal number of points in region that can give a meaningful event
// // Initialize region only when needed
......
......@@ -109,7 +109,7 @@ TEST_F(LSD_ADV, whiteNoise)
LSD detector(LSD_REFINE_ADV);
detector.detect(test_image, lines);
ASSERT_GE(40, lines.size());
ASSERT_GE((unsigned int)(40), lines.size());
}
TEST_F(LSD_ADV, constColor)
......@@ -118,12 +118,12 @@ TEST_F(LSD_ADV, constColor)
LSD detector(LSD_REFINE_ADV);
detector.detect(test_image, lines);
ASSERT_EQ(0, lines.size());
ASSERT_EQ((unsigned int)(0), lines.size());
}
TEST_F(LSD_ADV, lines)
{
const int numOfLines = 3;
const unsigned int numOfLines = 3;
GenerateLines(test_image, numOfLines);
LSD detector(LSD_REFINE_ADV);
detector.detect(test_image, lines);
......@@ -136,7 +136,7 @@ TEST_F(LSD_ADV, rotatedRect)
GenerateRotatedRect(test_image);
LSD detector(LSD_REFINE_ADV);
detector.detect(test_image, lines);
ASSERT_LE(4, lines.size());
ASSERT_LE((unsigned int)(4), lines.size());
}
TEST_F(LSD_STD, whiteNoise)
......@@ -145,7 +145,7 @@ TEST_F(LSD_STD, whiteNoise)
LSD detector(LSD_REFINE_STD);
detector.detect(test_image, lines);
ASSERT_GE(50, lines.size());
ASSERT_GE((unsigned int)(50), lines.size());
}
TEST_F(LSD_STD, constColor)
......@@ -154,12 +154,12 @@ TEST_F(LSD_STD, constColor)
LSD detector(LSD_REFINE_STD);
detector.detect(test_image, lines);
ASSERT_EQ(0, lines.size());
ASSERT_EQ((unsigned int)(0), lines.size());
}
TEST_F(LSD_STD, lines)
{
const int numOfLines = 3; //1
const unsigned int numOfLines = 3; //1
GenerateLines(test_image, numOfLines);
LSD detector(LSD_REFINE_STD);
detector.detect(test_image, lines);
......@@ -172,7 +172,7 @@ TEST_F(LSD_STD, rotatedRect)
GenerateRotatedRect(test_image);
LSD detector(LSD_REFINE_STD);
detector.detect(test_image, lines);
ASSERT_EQ(8, lines.size());
ASSERT_EQ((unsigned int)(8), lines.size());
}
TEST_F(LSD_NONE, whiteNoise)
......@@ -181,7 +181,7 @@ TEST_F(LSD_NONE, whiteNoise)
LSD detector(LSD_REFINE_NONE);
detector.detect(test_image, lines);
ASSERT_GE(50, lines.size());
ASSERT_GE((unsigned int)(50), lines.size());
}
TEST_F(LSD_NONE, constColor)
......@@ -190,12 +190,12 @@ TEST_F(LSD_NONE, constColor)
LSD detector(LSD_REFINE_NONE);
detector.detect(test_image, lines);
ASSERT_EQ(0, lines.size());
ASSERT_EQ((unsigned int)(0), lines.size());
}
TEST_F(LSD_NONE, lines)
{
const int numOfLines = 3; //1
const unsigned int numOfLines = 3; //1
GenerateLines(test_image, numOfLines);
LSD detector(LSD_REFINE_NONE);
detector.detect(test_image, lines);
......@@ -208,5 +208,5 @@ TEST_F(LSD_NONE, rotatedRect)
GenerateRotatedRect(test_image);
LSD detector(LSD_REFINE_NONE);
detector.detect(test_image, lines);
ASSERT_EQ(8, lines.size());
ASSERT_EQ((unsigned int)(8), lines.size());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment