opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.42k stars 5.76k forks source link

Xphoto Module causes OpenCV compilation failure #3582

Closed polodroid74 closed 1 year ago

polodroid74 commented 1 year ago
System information
Detailed description

When trying to compile OpenCV 4.8.1 with opencv_contrib repository, the compilation fails due to the module Xphoto :

[ 32%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/graph_simplifier.cpp.o
/home/paul/Downloads/opencv/opencv_contrib/modules/xphoto/src/grayworld_white_balance.cpp: In function ‘void cv::xphoto::applyChannelGains(cv::InputArray, cv::OutputArray, float, float, float)’:
/home/paul/Downloads/opencv/opencv_contrib/modules/xphoto/src/grayworld_white_balance.cpp:285:26: error: no matching function for call to ‘v_shr(cv::hal_baseline::v_uint16x8, int)’
  285 |             v_sB1 = v_shr(v_mul_wrap(v_sB1, v_gainB), 8);
      |                     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/paul/Downloads/opencv/opencv-4.8.1/modules/core/include/opencv2/core/hal/intrin.hpp:217,
                 from /home/paul/Downloads/opencv/opencv_contrib/modules/xphoto/src/grayworld_white_balance.cpp:41:
/home/paul/Downloads/opencv/opencv-4.8.1/modules/core/include/opencv2/core/hal/intrin_sse.hpp:1427:16: note: candidate: ‘template<int imm> cv::hal_baseline::v_uint16x8 cv::hal_baseline::v_shr(const cv::hal_baseline::v_uint16x8&)’
 1427 | inline _Tpuvec v_shr(const _Tpuvec& a) \
      |                ^~~~~
/home/paul/Downloads/opencv/opencv-4.8.1/modules/core/include/opencv2/core/hal/intrin_sse.hpp:1437:1: note: in expansion of macro ‘OPENCV_HAL_IMPL_SSE_SHIFT_OP’
 1437 | OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint16x8, v_int16x8, epi16, _mm_srai_epi16)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/paul/Downloads/opencv/opencv-4.8.1/modules/core/include/opencv2/core/hal/intrin_sse.hpp:1427:16: note:   template argument deduction/substitution failed:
 1427 | inline _Tpuvec v_shr(const _Tpuvec& a) \

Screenshot from 2023-10-23 10-17-29

Steps to reproduce
Inside OpenCV-4.8.1 repository directory : 
rm -rf build
mkdir build
cd build 
cmake .. -DOPENCV_EXTRA_MODULES_PATH=<path_to_opencv_contrib_dir>/modules
make -j <number_of_cores>
opencv-alalek commented 1 year ago

You need to keep both opencv / opencv_contrib repositories synchronized (same tag / version / commit date). Different versions may not work.


Build / usage questions should go to Users OpenCV Q/A forum: https://forum.opencv.org/

polodroid74 commented 1 year ago

Ok, I have checkout on the 4.8.1 tag in the contrib repo and it works. Thanks !