Skip to content

Commit 168c757

Browse files
committed
rounded double to int, changed < to <=
1 parent 99e09d7 commit 168c757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demos/social_distance_demo/cpp/src/geodist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ std::tuple<bool, bool, double> socialDistance(std::tuple<int, int> &frameShape,
226226
std::tie(bdA, bdK) = getLineComponent(B, D);
227227
std::tie(acA, acK) = getLineComponent(A, C);
228228

229-
double bdinf = B.x < D.x ? -9999999999. : 9999999999.;
229+
double bdinf = std::lround(B.x) <= std::lround(D.x) ? -9999999999. : 9999999999.;
230230
Line2d BDinf = getLine(D, cv::Point2d(bdinf, getY(bdinf, bdA, bdK)));
231231

232-
double acinf = A.x < C.x ? -9999999999. : 9999999999.;
232+
double acinf = std::lround(A.x) <= std::lround(C.x) ? -9999999999. : 9999999999.;
233233
Line2d ACinf = getLine(C, cv::Point2d(acinf, getY(acinf, acA, acK)));
234234

235235
// Vanishing point

0 commit comments

Comments
 (0)