Ask Your Question

adn's profile - activity

2017-03-16 15:25:19 -0600 commented question ERROR using opencv_contrib with Python 3.x

Try the -D BUILD_NEW_PYTHON_SUPPORT=ON option. Was having problems last time compiling OpenCV with python3, and that one helped.

2017-03-16 14:08:05 -0600 commented answer Missing ts from Release build

No, it wasn't installed. I copy it manually to the /usr/local/lib path and ran ldconfig again, but it didn't work. Maybe the library needs to now that it was installed through the cmake configuration?

2017-03-16 13:48:07 -0600 commented answer Missing ts from Release build

That is the strange part. I see the [ 23%] Built target opencv_ts message in the build log, but it is not in the install log. Also, tried by changing find_package ( OpenCV REQUIRED opencv_ts ), assuming that the name of the module may be different, but that didn't work either. Maybe I need an install flag on the cmake?

2017-03-16 13:15:35 -0600 commented answer Missing ts from Release build

I added it to the question, including the flags I used to build OpenCV

2017-03-16 11:48:31 -0600 commented answer Missing ts from Release build

I actually tried with BUILD_TESTS=ON before, but still cmake didn't find it. I tried with BUILD_opencv_ts=ON now, and cmake says that there is not ts inside the library. I see that the cmake output says that ts will be built, but I don't see any related message in the building or linking logs related to ts (maybe it has a different name?). Also, I'm following the pattern in the previous link, find_package ( OpenCV REQUIRED ts ), could it be that the name of the module is different for some reason?

2017-03-16 07:30:20 -0600 asked a question Missing ts from Release build

I'm testing the unit test framework of OpenCV, as instructed in here: quentin.bonnard.eu/blog/2013/10/16/Using-OpenCV_s_test_framework_with_CMake/.

However, when I want to test the examples the ts module is not found in my installation:

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find OpenCV (missing: ts) (found version "3.2.0")
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/OpenCV/OpenCVConfig.cmake:260 (find_package_handle_standard_args)
test/CMakeLists.txt:5 (find_package)

I compile OpenCV myself. I was wondering if there are any options I need to give to cmake to build or include ts module on the final libraries. Note that I'm building it with RELEASE option.

CMake Output

cmake \
  -D CMAKE_BUILD_TYPE=RELEASE \
  -D ENABLE_PRECOMPILED_HEADERS=OFF \
  -D CMAKE_INSTALL_PREFIX=/usr/local \
  -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
  -D BUILD_NEW_PYTHON_SUPPORT=ON \
  -D WITH_TBB=ON \
  -D WITH_QT=ON \
  -D WITH_OPENGL=ON \
  -D BUILD_TIFF=ON \
  -D BUILD_SHARED_LIBS=ON \
  -D BUILD_EXAMPLES=ON \
  -D BUILD_opencv_ts=ON \
  ..


-- Detected version of GNU GCC: 62 (602)
-- FP16: Feature disabled
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/user/bin/opencv/build/3rdparty/ippicv/ippicv_lnx
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Caffe:   NO
-- Protobuf:   YES
-- Glog:   NO
-- freetype2:   YES
-- harfbuzz:    YES
-- Could NOT find HDF5 (missing:  HDF5_LIBRARIES HDF5_INCLUDE_DIRS) 
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- freetype2:   YES
-- harfbuzz:    YES
-- Checking for modules 'tesseract;lept'
--   No package 'tesseract' found
--   No package 'lept' found
-- Tesseract:   NO
-- Check contents of vgg_generated_48.i ...
-- Check contents of vgg_generated_64.i ...
-- Check contents of vgg_generated_80.i ...
-- Check contents of vgg_generated_120.i ...
-- Check contents of boostdesc_bgm.i ...
-- Check contents of boostdesc_bgm_bi.i ...
-- Check contents of boostdesc_bgm_hd.i ...
-- Check contents of boostdesc_binboost_064.i ...
-- Check contents of boostdesc_binboost_128.i ...
-- Check contents of boostdesc_binboost_256.i ...
-- Check contents of boostdesc_lbgm.i ...
-- 
-- General configuration for OpenCV 3.2.0-rc =====================================
--   Version control:               3.2.0-rc
-- 
--   Extra modules:
--     Location (extra):            /home/user/bin/opencv_contrib/modules
--     Version control (extra):     3.2.0-rc
-- 
--   Platform:
--     Timestamp:                   2017-03-16T16:40:39Z
--     Host:                        Linux 4.8.0-40-generic x86_64 ...
(more)
2017-03-15 16:42:05 -0600 received badge  Scholar (source)
2017-03-15 16:41:59 -0600 answered a question Linking error when building OpenCV 3.2.0 with Python support

Is not entirely a solution for the 3.2.0 tag, but by changing the branch to 3.2.0-rc it was solved.

Probably there are some extra configuration on the normal branch that is not straightforward to get.

2017-03-08 13:53:32 -0600 commented question Linking error when building OpenCV 3.2.0 with Python support

Is this related to this other problem http://stackoverflow.com/questions/11643666/python-importerror-undefined-symbol-for-custom-c-module (http://stackoverflow.com/questions/11...) Maybe the order in the Makefile that links the libraries?

2017-03-08 13:17:22 -0600 received badge  Editor (source)
2017-03-08 06:49:27 -0600 asked a question Linking error when building OpenCV 3.2.0 with Python support

I build OpenCV 3.2.0 from the sources (including the contrib modules) using the 3.2.0 branch. And when I import it within python, through import cv2, I get an undefined symbol error. That in my experience seems like a linking error.

$ python
Python 2.7.12+ (default, Sep 17 2016, 12:08:02) 
[GCC 6.2.0 20160914] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python2.7/dist-packages/cv2.so: undefined symbol: _Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_
>>> 
$ python3
Python 3.5.2+ (default, Sep 22 2016, 12:18:14) 
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.5/dist-packages/cv2.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_
>>>

My gcc

$ gcc --version
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My flags in cmake are as follows:

cmake \
  -D CMAKE_BUILD_TYPE=RELEASE \
  -D ENABLE_PRECOMPILED_HEADERS=OFF \
  -D CMAKE_INSTALL_PREFIX=/usr/local \
  -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
  -D BUILD_NEW_PYTHON_SUPPORT=ON \
  -D WITH_TBB=ON \
  -D WITH_QT=ON \
  -D WITH_OPENGL=ON \
  -D BUILD_TIFF=ON \
  -D BUILD_SHARED_LIBS=OFF \
  -D BUILD_EXAMPLES=ON \
  ..

I see in other posts that the problem my be due to the sharing libraries, and so I tried with -D BUILD_SHARED_LIBS=OFF but that doesn't work either. My system is

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:  Ubuntu 16.10
Release:  16.10
Codename: yakkety

Let me know if you need more information. Any help is appreciated.