Skip to content

[Bugfix] Ensure radius defaults are applied when BilateralFilter diameter is <= 0#144

Open
zacharyvincze wants to merge 3 commits intoROCm:developfrom
zacharyvincze:zv/feature/bilaterial-filter-default-value
Open

[Bugfix] Ensure radius defaults are applied when BilateralFilter diameter is <= 0#144
zacharyvincze wants to merge 3 commits intoROCm:developfrom
zacharyvincze:zv/feature/bilaterial-filter-default-value

Conversation

@zacharyvincze
Copy link
Copy Markdown
Contributor

Description

  • Fixes a bug in BilateralFilter where default radius was applied when radius was <= 0, not diameter.
  • Adds test cases with the diameter set to <= 0 to ensure that the behavior is as intended.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes BilateralFilter’s default-radius logic so the fallback radius is applied only when diameter <= 0 (instead of when the derived radius <= 0), aligning behavior with the intended API semantics and adding regression coverage.

Changes:

  • Update radius computation in dispatch_bilateral_filter_border_mode to use the default-radius formula only when diameter <= 0.
  • Add Python and C++ test cases that exercise diameter values of 0 and -1.
  • Clarify the diameter parameter documentation to describe the radius derivation rules.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/op_bilateral_filter.cpp Fixes radius selection logic so fallback radius depends on diameter <= 0.
include/op_bilateral_filter.hpp Documents the updated diameter-to-radius behavior and sigmaSpace clamping.
tests/roccv/python/test_op_bilateral_filter.py Adds parameterized test inputs with non-positive diameter.
tests/roccv/cpp/src/tests/operators/test_op_bilateral_filter.cpp Adds CPU/GPU correctness tests for diameter <= 0 cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/op_bilateral_filter.cpp 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #144      +/-   ##
===========================================
+ Coverage    74.26%   74.34%   +0.07%     
===========================================
  Files           79       79              
  Lines         3357     3355       -2     
  Branches       738      738              
===========================================
+ Hits          2493     2494       +1     
+ Misses         382      380       -2     
+ Partials       482      481       -1     
Files with missing lines Coverage Δ
src/op_bilateral_filter.cpp 72.28% <50.00%> (+1.40%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants