When configuring opencv with opencv_contrib, the configure fails on the dnn and xfeatures2d modules. The CMake files use FILENAME in the call to ocv_download, but should use PACKAGE as specified in the opencv. This generates the following errors. I've replicated this on Mac OS X and on Windows 7 using CMake-gui.
Downloading ...
_CMake Error at /Users/Documents/opencv/source/opencv-3.2.0/cmake/OpenCVUtils.cmake:1045 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/CMakeLists.txt:5 (include)_
_CMake Error at /Users/Documents/opencv/source/opencv-3.2.0/cmake/OpenCVUtils.cmake:1049 (message):
Failed to download . Status=
Call Stack (most recent call first):
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/CMakeLists.txt:5 (include)_
Files that use FILENAME instead of PACKAGE:
opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
opencv_contrib-master/modules/xfeatures2d/cmake/download_boostdesc.cmake
opencv_contrib-master/modules/xfeatures2d/cmake/download_vgg.cmake
Using cmake-gui
Great thanks! I am stuck with this issue for hours today. This solves my problem.
opencv-3.2.0/cmake/OpenCVUtils.cmake:1045
This is non fresh OpenCV code.
opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake
Looks like, this is the latest opencv_contib code.
You should keep codebases synchronized.
alalek,
My codebase is synchronized; I grabbed opencv_contrib directly from GitHub, which is the only way to get the opencv_contrib as far as I can tell, since there aren't any binaries available. I'm only using the git repository because there is no other options. The OpenCV 3.2.0 is the latest package available from the OpenCV downloads. I don't even want to compile the darn things, but that's the only way to get the contrib stuff included.
I grabbed opencv_contrib directly from GitHub
The OpenCV 3.2.0 is the latest package available from the OpenCV downloads.
This configuration is not synchronized.
1) You should checkout "opencv_contrib" to 3.2.0 (git checkout 3.2.0 command). Also you can get it as ZIP archive by "tag": https://github.com/opencv/opencv_contrib/archive/3.2.0.zip .
2) Or you should use "opencv" repository from GitHub "master" branch too.
Where do you even see the tags at?? Nevermind, I'll find a github book. The ZIP link is what I needed, I guess; I wish it were more prominent, like being able to download ZIPs from the OpenCV site. Thanks for that; I'll close the defect and try to learn more about Git. Too many VCS's to learn.
@alalek Thanks. How can I synchronize the configuration?
Thanks. very useful.
I also needed to modify in the same way
opencv_contrib-master/modules/dnn_modern/CMakeLists.txt
System information
OpenCV = 3.2.0
Operating System => Windows 10 64 Bit
Compiler => Visual Studio 2013, CMake 3.8.0
in opencv_contrib/modules/dnn_modern/CMakeLists.txt, there is an ocv_download, too. ALSO NEED TO CHANGE FILENAME TO PACKAGE
Master is broken and this is BAD! Try to download master and you'll reproduce the issue,
@Mogikan Nightly regular builds for master branch.
@alalek OK, seems like I now understand what is the problem. I use different sources codebase for open cv and contrib library. Thanks.
I used opencv 3.2.0, ubuntu 14.04, lastest opencv_contrib.
And I used command: cmake -DOPENCV_EXTRA_MODULES_PATH=~/opencv-3.2.0/opencv_contrib/modules/ -DBUILD_opencv_legacy=OFF ~/opencv-3.2.0/
But still error:
-- Downloading ...
CMake Error at cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)
Can you tell me why? or how to check. Thanks
opencv 3.2.0
lastest opencv_contrib
Incompatible configuration.
You should change opencv to the latest version or opencv_contrib to 3.2.0. Keep these codebases synchronized with the same version.
@alalek
I download opencv 3.2 from http://opencv.org/releases.html
and clone opencv_contrib: git clone https://github.com/opencv/opencv_contrib
Can you tell me where "Incompatible configuration."?
You should clone not master but tag 3.2 from github.
git checkout tag/3.2.0 to checkout by tag
Most helpful comment
You should clone not master but tag 3.2 from github.