Skip to content

imageProcessing: guard OpenCV-dependent filters behind ALICEVISION_HA…#2090

Merged
servantftransperfect merged 3 commits intodevelopfrom
fix/guard-opencv-filters-imageProcessing
Mar 25, 2026
Merged

imageProcessing: guard OpenCV-dependent filters behind ALICEVISION_HA…#2090
servantftransperfect merged 3 commits intodevelopfrom
fix/guard-opencv-filters-imageProcessing

Conversation

@predat
Copy link
Contributor

@predat predat commented Mar 19, 2026

Summary

Guard the registration of OpenCV-dependent image processing steps behind the ALICEVISION_HAVE_OPENCV compile-time flag.

Motivation

Three filter steps — BilateralFilter, ClaheFilter, and NlmFilter — rely on OpenCV internally. Without this guard, any build configuration that does not include OpenCV will fail at compile time when setupSteps() tries to instantiate these classes.

Changes

  • Wrapped BilateralFilterProcess and ClaheFilterProcess registration under #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_OPENCV) in main_imageProcessing.cpp.
  • Wrapped NlmFilterProcess registration under the same guard.

Sylvain Maziere and others added 3 commits March 24, 2026 16:59
Co-authored-by: Fabien Castan <fabcastan@gmail.com>
…Filter OpenCV checks

The `#if ALICEVISION_HAVE_OPENCV` guards were incorrectly placed
*before* the
`if (pParams.*.enabled)` runtime checks, causing the entire block
(including
the enabled-check) to be silently skipped at compile time when OpenCV is
absent.

- Move the preprocessor guard *inside* the runtime `if` block for
  bilateralFilter
  and nlmFilter, so the enabled-check is always compiled and evaluated
- Add an `#else` branch for nlmFilter that logs an explicit error when
  OpenCV
  is unavailable and the filter is requested, instead of silently bypassing it
@servantftransperfect servantftransperfect force-pushed the fix/guard-opencv-filters-imageProcessing branch from cd3af8b to 4d732b0 Compare March 24, 2026 15:59
@servantftransperfect servantftransperfect merged commit 551b6cd into develop Mar 25, 2026
4 checks passed
@servantftransperfect servantftransperfect deleted the fix/guard-opencv-filters-imageProcessing branch March 25, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants