Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpMeEllipse exceptions maangement #1361

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions modules/tracker/me/src/moving-edges/vpMeEllipse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
// Equations below from Chaumette PhD and TRO 2004 paper
double num = (m_K[0] * m_K[1]) - (m_K[2] * m_K[2]); // > 0 for an ellipse
if (num <= 0) {
throw(vpException(vpException::fatalError, "The points do not belong to an ellipse! num: %f", num));
throw(vpTrackingException(vpTrackingException::fatalError, "The points do not belong to an ellipse! num: %f", num));

Check warning on line 229 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L229

Added line #L229 was not covered by tests
}

m_uc = ((m_K[2] * m_K[4]) - (m_K[1] * m_K[3])) / num;
Expand Down Expand Up @@ -263,7 +263,7 @@
{
// Warning: similar code in vpMbtMeEllipse::sample()
if (!m_me) {
throw(vpException(vpException::fatalError, "Moving edges on ellipse not initialized"));
throw(vpTrackingException(vpTrackingException::fatalError, "Moving edges on ellipse not initialized"));

Check warning on line 266 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L266

Added line #L266 was not covered by tests
}
// Delete old lists
m_meList.clear();
Expand Down Expand Up @@ -331,7 +331,7 @@
unsigned int vpMeEllipse::plugHoles(const vpImage<unsigned char> &I)
{
if (!m_me) {
throw(vpException(vpException::fatalError, "Moving edges on ellipse tracking not initialized"));
throw(vpTrackingException(vpTrackingException::fatalError, "Moving edges on ellipse tracking not initialized"));

Check warning on line 334 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L334

Added line #L334 was not covered by tests
}
unsigned int nb_pts_added = 0;
int nbrows = static_cast<int>(I.getHeight());
Expand Down Expand Up @@ -574,8 +574,8 @@

if (m_meList.size() != m_angleList.size()) {
// Should never occur
throw(vpException(vpException::fatalError, "Lists are not coherent in vpMeEllipse::plugHoles(): nb MEs %ld, nb ang %ld",
m_meList.size(), m_angleList.size()));
throw(vpTrackingException(vpTrackingException::fatalError, "Lists are not coherent in vpMeEllipse::plugHoles(): nb MEs %ld, nb ang %ld",
m_meList.size(), m_angleList.size()));

Check warning on line 578 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L577-L578

Added lines #L577 - L578 were not covered by tests
}

if (vpDEBUG_ENABLE(3)) {
Expand Down Expand Up @@ -654,7 +654,7 @@
vpMatrix KerA;
unsigned int dim = A.nullSpace(KerA, 1);
if (dim > 1) { // case with less than 5 independent points
throw(vpException(vpMatrixException::rankDeficient, "Linear system for computing the ellipse equation ill conditioned"));
throw(vpMatrixException(vpMatrixException::rankDeficient, "Linear system for computing the ellipse equation ill conditioned"));

Check warning on line 657 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L657

Added line #L657 was not covered by tests
}
unsigned int nbRows = m_K.getRows();
for (unsigned int i = 0; i < nbRows; ++i) {
Expand Down Expand Up @@ -845,7 +845,7 @@
}
unsigned int dim = DA.nullSpace(KerDA, 1);
if (dim > 1) { // case with less than 5 independent points
throw(vpException(vpMatrixException::rankDeficient, "Linear system for computing the ellipse equation ill conditioned"));
throw(vpMatrixException(vpMatrixException::rankDeficient, "Linear system for computing the ellipse equation ill conditioned"));

Check warning on line 848 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L848

Added line #L848 was not covered by tests
}


Expand Down Expand Up @@ -953,8 +953,8 @@

if (m_meList.size() != m_angleList.size()) {
// Should never occur
throw(vpException(vpException::fatalError, "Lists are not coherent in vpMeEllipse::leastSquareRobust(): nb MEs %ld, nb ang %ld",
m_meList.size(), m_angleList.size()));
throw(vpTrackingException(vpTrackingException::fatalError, "Lists are not coherent in vpMeEllipse::leastSquareRobust(): nb MEs %ld, nb ang %ld",
m_meList.size(), m_angleList.size()));

Check warning on line 957 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L956-L957

Added lines #L956 - L957 were not covered by tests
}

// Manage the list so that all new angles belong to [0;2Pi]
Expand Down Expand Up @@ -1078,8 +1078,8 @@

if ((m_meList.size() != numberOfGoodPoints) || (m_angleList.size() != numberOfGoodPoints)) {
// Should never occur
throw(vpException(vpException::fatalError, "Lists are not coherent at the end of vpMeEllipse::leastSquareRobust(): nb goog MEs %d and %ld, nb ang %ld",
numberOfGoodPoints, m_meList.size(), m_angleList.size()));
throw(vpTrackingException(vpTrackingException::fatalError, "Lists are not coherent at the end of vpMeEllipse::leastSquareRobust(): nb goog MEs %d and %ld, nb ang %ld",
numberOfGoodPoints, m_meList.size(), m_angleList.size()));

Check warning on line 1082 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L1081-L1082

Added lines #L1081 - L1082 were not covered by tests
}

// set extremities of the angle list
Expand Down Expand Up @@ -1332,7 +1332,7 @@

// Stop in case of failure after resample
if (m_numberOfGoodPoints <= minNbGoodPoints) {
throw(vpException(vpTrackingException::notEnoughPointError, "Impossible to track the ellipse, not enough features"));
throw(vpTrackingException(vpTrackingException::notEnoughPointError, "Impossible to track the ellipse, not enough features"));

Check warning on line 1335 in modules/tracker/me/src/moving-edges/vpMeEllipse.cpp

View check run for this annotation

Codecov / codecov/patch

modules/tracker/me/src/moving-edges/vpMeEllipse.cpp#L1335

Added line #L1335 was not covered by tests
}
}

Expand Down
Loading