imageProcessing: guard OpenCV-dependent filters behind ALICEVISION_HA…#2090
Open
imageProcessing: guard OpenCV-dependent filters behind ALICEVISION_HA…#2090
Conversation
Co-authored-by: Fabien Castan <fabcastan@gmail.com>
| { | ||
| steps.push_back(std::make_unique<NoiseProcess>(ENoiseMethod_enumToString(pParams.noise.method), pParams.noise.A, pParams.noise.B, pParams.noise.mono)); | ||
| } | ||
| #if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_OPENCV) |
Member
There was a problem hiding this comment.
same than the other comment
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Guard the registration of OpenCV-dependent image processing steps behind the
ALICEVISION_HAVE_OPENCVcompile-time flag.Motivation
Three filter steps —
BilateralFilter,ClaheFilter, andNlmFilter— rely on OpenCV internally. Without this guard, any build configuration that does not include OpenCV will fail at compile time whensetupSteps()tries to instantiate these classes.Changes
BilateralFilterProcessandClaheFilterProcessregistration under#if ALICEVISION_IS_DEFINED(ALICEVISION_HAVE_OPENCV)inmain_imageProcessing.cpp.NlmFilterProcessregistration under the same guard.