Skip to content

Commit

Permalink
Flush image before moving-edges initialisation by click
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jul 27, 2023
1 parent 5f0f40a commit 6794698
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions modules/tracker/me/src/moving-edges/vpMeEllipse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,8 @@ void vpMeEllipse::initTracking(const vpImage<unsigned char> &I, bool trackCircle
std::vector<vpImagePoint> iP(n);
m_trackArc = trackArc;

vpDisplay::flush(I);

if (m_trackCircle) {
if (m_trackArc) {
std::cout << "First and third points specify the extremities of the arc of circle (clockwise)" << std::endl;
Expand Down
14 changes: 8 additions & 6 deletions modules/tracker/me/src/moving-edges/vpMeLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,16 @@ void vpMeLine::initTracking(const vpImage<unsigned char> &I)
{
vpImagePoint ip1, ip2;

vpDisplay::flush(I);

std::cout << "Click on the line first point..." << std::endl;
while (vpDisplay::getClick(I, ip1) != true)
;
while (vpDisplay::getClick(I, ip1) != true) { }

vpDisplay::displayCross(I, ip1, 7, vpColor::red);
vpDisplay::flush(I);
std::cout << "Click on the line second point..." << std::endl;
while (vpDisplay::getClick(I, ip2) != true)
;
while (vpDisplay::getClick(I, ip2) != true) { }

vpDisplay::displayCross(I, ip2, 7, vpColor::red);
vpDisplay::flush(I);

Expand Down Expand Up @@ -900,8 +902,8 @@ void vpMeLine::computeRhoTheta(const vpImage<unsigned char> &I)
end = false;
if (incr == 1) {
throw(vpException(vpException::fatalError, "In vpMeLine cannot determine rho sign, since "
"there is no gray level difference between both "
"sides of the line"));
"there is no gray level difference between both "
"sides of the line"));
}
}
update_indices(theta, i, j, incr, i1, i2, j1, j2);
Expand Down

0 comments on commit 6794698

Please sign in to comment.