Skip to content

core: OPENCV_ALGO_HINT_DEFAULT should be validated. #26709

@Kumataro

Description

@Kumataro

Describe the feature and motivation

There is typo in OPENCV_ALGO_HINT_DEFAULT document.
We have to replace from ALGO_HINT_APROX to ALGO_HINT_APPROX.

https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html

- Set default OpenCV implementation hint value: ALGO_HINT_ACCURATE or ALGO_HINT_APROX. 
+ Set default OpenCV implementation hint value: ALGO_HINT_ACCURATE or ALGO_HINT_APPROX. 

However, there are no this option validation. So we cannot notice invalid option until building error. I think It is better to implement this cmake option validation.

--   Platform:
--     Timestamp:                   2024-11-21T08:56:48Z
--     Host:                        Linux 6.8.0-48-generic x86_64
--     CMake:                       3.28.3
--     CMake generator:             Ninja
--     CMake build tool:            /usr/bin/ninja
--     Configuration:               Release
--     Algorithm Hint:              ALGO_HINT_APROX

/home/kmtr/work/opencv4/modules/core/src/system.cpp: In function ‘cv::AlgorithmHint cv::getDefaultAlgorithmHint()’:
<command-line>: error: ‘ALGO_HINT_APROX’ was not declared in this scope; did you mean ‘ALGO_HINT_APPROX’?
/home/kmtr/work/opencv4/modules/core/src/system.cpp:2890:12: note: in expansion of macro ‘OPENCV_ALGO_HINT_DEFAULT’
 2890 |     return OPENCV_ALGO_HINT_DEFAULT;
      |            ^~~~~~~~~~~~

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions