Repository: opencv
Issue: OpenMP parallel backend never loaded 
Labels: bug

### System Information

OpenCV version: 4.5.5 & 4.7.0
Operating System / Platform: Ubuntu 22.04
Compiler & compiler version: GCC 11.3.0

### Detailed description

OpenMP parallel backend is never loaded :
```
[DEBUG:0@0.010] global  /modules/core/src/parallel/parallel.cpp (107) createDefaultParallelForAPI core(parallel): Initializing parallel backend...
[DEBUG:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (69) ParallelBackendRegistry core(parallel): Builtin backends(2): TBB(1000); OPENMP(990)
[ INFO:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (117) readPrioritySettings core(parallel): Configured priority list (OPENCV_PARALLEL_PRIORITY_LIST): OPENMP,TBB
[DEBUG:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (130) readPrioritySettings core(parallel): New backend priority: 'OPENMP' => 102000
[DEBUG:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (130) readPrioritySettings core(parallel): New backend priority: 'TBB' => 101000
[ INFO:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (72) ParallelBackendRegistry core(parallel): Updated backends priorities: TBB(101000); OPENMP(102000)
[DEBUG:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (94) ParallelBackendRegistry core(parallel): Available backends(2): TBB(101000); OPENMP(102000)
[ INFO:0@0.010] global  /modules/core/src/parallel/registry_parallel.impl.hpp (96) ParallelBackendRegistry core(parallel): Enabled backends(2, sorted by priority): OPENMP(102000); TBB(101000)
[DEBUG:0@0.010] global  /modules/core/src/parallel/parallel.cpp (65) createParallelForAPI core(parallel): trying backend: OPENMP (priority=102000)
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (219) getPluginCandidates core(parallel): OPENMP plugin's glob is 'libopencv_core_parallel_openmp*.so', 1 location(s)
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (229) getPluginCandidates     -  /install/lib: 0
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (233) getPluginCandidates Found 0 plugin(s) for OPENMP
[DEBUG:0@0.011] global  /modules/core/src/parallel/parallel.cpp (65) createParallelForAPI core(parallel): trying backend: TBB (priority=101000)
[ INFO:0@0.011] global  /modules/core/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp (54) ParallelForBackend Initializing TBB parallel backend: TBB_INTERFACE_VERSION=10005
[ INFO:0@0.011] global  /modules/core/src/parallel/parallel.cpp (77) createParallelForAPI core(parallel): using backend: TBB (priority=101000)
```

```#cmakedefine HAVE_OPENMP``` is missing in make/templates/cvconfig.h.in. causing OpenCV trying to load dynamic openmp backend (in registry_parallel.impl.hpp). Dynamic openmp seems not working/finished (AFAIK).

If I add ```#cmakedefine HAVE_OPENMP``` in make/templates/cvconfig.h.in, static backend of openmp is loaded and parallel_loop works ok : 

```
 [DEBUG:2@0.531] global opencv/modules/core/src/parallel/parallel.cpp (107) createDefaultParallelForAPI core(parallel): Initializing parallel backend...
[DEBUG:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (69) ParallelBackendRegistry core(parallel): Builtin backends(2): TBB(1000); OPENMP(990)
[ INFO:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (117) readPrioritySettings core(parallel): Configured priority list (OPENCV_PARALLEL_PRIORITY_LIST): OPENMP,TBB
[DEBUG:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (130) readPrioritySettings core(parallel): New backend priority: 'OPENMP' => 102000
[DEBUG:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (130) readPrioritySettings core(parallel): New backend priority: 'TBB' => 101000
[ INFO:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (72) ParallelBackendRegistry core(parallel): Updated backends priorities: TBB(101000); OPENMP(102000)
[DEBUG:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (94) ParallelBackendRegistry core(parallel): Available backends(2): TBB(101000); OPENMP(102000)
[ INFO:2@0.531] global opencv/modules/core/src/parallel/registry_parallel.impl.hpp (96) ParallelBackendRegistry core(parallel): Enabled backends(2, sorted by priority): OPENMP(102000); TBB(101000)
[DEBUG:2@0.531] global opencv/modules/core/src/parallel/parallel.cpp (65) createParallelForAPI core(parallel): trying backend: OPENMP (priority=102000)
[ INFO:2@0.531] global opencv/modules/core/src/parallel/parallel.cpp (77) createParallelForAPI core(parallel): using backend: OPENMP (priority=102000)
```

### Steps to reproduce

compile opencv with openMP
```cmake .. -DWITH_OPENMP=ON```

launch a program that uses parallel_for loop in OpenCV (i.e. samples/cpp/tutorial_code/core/parallel_backend/example-openmp.cpp), enable logs, and prioritize openMP if you have several parallel backed:
```
cd samples/cpp/tutorial_code/core/parallel_backend
# add "project(parallel_backend_example CXX)" in CMakeLists.txt if needed
mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH=...opencv_installpath... 
export OPENCV_LOG_LEVEL=DEBUG
export OPENCV_TRACE=1
export OPENCV_PARALLEL_PRIORITY_LIST=OPENMP,TBB
./opencv_example_openmp_backend
```


OpenMP will not be loaded, the log will show sthg like this :
```
[DEBUG:0@0.010] global  /modules/core/src/parallel/parallel.cpp (65) createParallelForAPI core(parallel): trying backend: OPENMP (priority=102000)
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (219) getPluginCandidates core(parallel): OPENMP plugin's glob is 'libopencv_core_parallel_openmp*.so', 1 location(s)
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (229) getPluginCandidates     -  /install/lib: 0
[DEBUG:0@0.011] global  /modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp (233) getPluginCandidates Found 0 plugin(s) for OPENMP
```

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)