Describe the bug
BilateralFilter in app/operators/filtering/bilateral_filter.py reads filterSize directly with no validation. Passing 0 or any negative integer to cv2.bilateralFilter raises an OpenCV exception. All blurring operators (Blur, GaussianBlur, MedianBlur) validate their kernel size — BilateralFilter does not.
To Reproduce
Steps to reproduce the behavior:
- Add a
BilateralFilter block to the pipeline
- Set
filterSize to 0 or any negative value
- Run the pipeline — crashes with
cv2.error
Expected behavior
Should raise a clear ValueError when filterSize is zero or negative, consistent with how other operators validate their parameters.
Screenshots
N/A
Environment:
Additional context
Relevant code in app/operators/filtering/bilateral_filter.py:
filter_size = int(self.params.get("filterSize", 5))
# no validation — cv2.bilateralFilter throws on filterSize <= 0
return cv2.bilateralFilter(image, filter_size, sigma_color, sigma_space)
Describe the bug
BilateralFilterinapp/operators/filtering/bilateral_filter.pyreadsfilterSizedirectly with no validation. Passing0or any negative integer tocv2.bilateralFilterraises an OpenCV exception. All blurring operators (Blur,GaussianBlur,MedianBlur) validate their kernel size —BilateralFilterdoes not.To Reproduce
Steps to reproduce the behavior:
BilateralFilterblock to the pipelinefilterSizeto0or any negative valuecv2.errorExpected behavior
Should raise a clear
ValueErrorwhenfilterSizeis zero or negative, consistent with how other operators validate their parameters.Screenshots
N/A
Environment:
Additional context
Relevant code in
app/operators/filtering/bilateral_filter.py: