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

Fix canny #1287

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Fix canny #1287

merged 5 commits into from
Dec 1, 2023

Conversation

rolalaro
Copy link

Fix two problems :

  • in vpCannyEdgeDetection, fix the way the gradient orientation is computed, getting results that are much closer to the ones obtained using opencv-backend
  • in vpImageFilter, fix a mistake on the way the partial derivatives are normalized when using opencv-backend

@@ -235,7 +235,7 @@ vpCannyEdgeDetection::performFilteringAndGradientComputation(const vpImage<unsig
/**
* \brief Get the interpolation weights and offsets.
*
* \param[in] absoluteTheta : The absolute value of the angle of the edge, expressed in degrees.
* \param[in] positiveTheta : The positive value of the angle of the edge, expressed in degrees.
Copy link
Contributor

@fspindle fspindle Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be complete, you could precise that this angle is between -180 and +180 deg (or \f$-\pi,+\pi\f$ see below)

Copy link
Contributor

@fspindle fspindle Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason to consider degrees instead of rad? Using deg means that to have to call vpMath::rad() that is useless
antan2() is returning rad
You can use M_PI_2 and M_PI_4 macros

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to rename positiveTheta into gradientOrientation to be more explicit

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suggestions have been addressed in the new commit e459437

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (e49493a) 54.41% compared to head (2b4e240) 54.43%.

❗ Current head 2b4e240 differs from pull request most recent head 43f9441. Consider uploading reports for the commit 43f9441 to get more accurate results

Files Patch % Lines
modules/core/src/image/vpCannyEdgeDetection.cpp 0.00% 3 Missing ⚠️
modules/core/src/image/vpImageFilter.cpp 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1287      +/-   ##
==========================================
+ Coverage   54.41%   54.43%   +0.01%     
==========================================
  Files         400      400              
  Lines       50512    50514       +2     
==========================================
+ Hits        27487    27496       +9     
+ Misses      23025    23018       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…iveGradient for gradientOrientation that is more understandable
@fspindle fspindle merged commit e4338fe into lagadic:master Dec 1, 2023
48 of 49 checks passed
@rolalaro rolalaro deleted the fixCanny branch December 2, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants