frang75
February 20, 2022, 10:25am
1
Hello and thanks for supporting this fabulous library.
I have integrated OpenCV in a C++ project (as a static library). I want to use the cv::adaptiveThreshold
method, but I see that the implementation is empty
inline int hal_ni_adaptiveThreshold(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
I guess I am not correctly building the Visual Studio solution using CMake.
Any ideas?
Thank you very much!
berak
February 20, 2022, 12:04pm
2
tell us more, please,
version ? did you build it locally ? how exactly did you βintegrateβ it ?
does it throw an exeption ?
frang75
February 20, 2022, 2:16pm
3
Hi berak! Thank you very much for the fast response.
I detail all the steps:
Clone the OpenCV repository from Github
Using CMake to generate Visual Studio 2019 solution with default options except for:
[ ] BUILD_ITT (Disabled)
[ ] BUILD_IPP (Disabled)
[ ] BUILD_SHARED_LIB (Disabled) Generate static libraries
Here the CMake report and test images: https://nappgui.com/shared/OpenCV_issue.zip
The project compile correctly.
I have link the βopencv_core455.lib β and βopencv_imageproc455.lib β to my project.
I have use βcv::threshold
β with βTHRESH_BINARY
β and βTHRESH_OTSU
β and they work fine.
BUT when I use βcv::adaptiveThreshold
β the the results are very poor.
blockSize = 5, delta = 2, type = ADAPTIVE_THRESH_GAUSSIAN_C
The original and computed images are in previous .zip file. I have use my own implementation of adaptativeThreshold for compare results.
No exception has been throw.
I have debug the program and step into βcv::adaptiveThreshold
β
The line:
CALL_HAL(adaptiveThreshold, cv_hal_adaptiveThreshold, src.data, src.step, dst.data, dst.step, src.cols, src.rows,
maxValue, method, type, blockSize, delta);
is calling to a default ΒΏempty? implementation of threshold algorithm
inline int hal_ni_adaptiveThreshold(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
//! @cond IGNORED
#define cv_hal_adaptiveThreshold hal_ni_adaptiveThreshold
//! @endcond
Perhaps I need another extra flag when a compile OpenCV from sources.
Thank you very much for any kind of help!
Regards
1 Like
berak
February 20, 2022, 2:36pm
4
yea, just did the same, and, to my surprise -
no exception, (code just continues below that).
i think, if there would be anything in custom_hal.hpp
,it would have overwritten this (but there isnβt (yet?))
however - apart from the useless indirection, and the confusion from this,
not much harm done, imo.
no, this looks like it is meant to be the way it is (nothing to do on your side)