Skip to content

[OS X] xphoto issue #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Oct 29, 2016 · 3 comments
Closed

[OS X] xphoto issue #159

ghost opened this issue Oct 29, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 29, 2016

Hi guys. I'm using OS X Sierra 10.12.1. I have install OpenCV with brew by the following command:

brew install opencv3 --with-contrib --with-ffmpeg --without-numpy --HEAD

When installing torch-opencv with the command:

OpenCV_DIR=/usr/local/Cellar/opencv3/HEAD-ecb8fb9_4/share/OpenCV luarocks install cv

I encountered the following error:

Installing https://raw.githubusercontent.com/torch/rocks/master/cv-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cv-scm-1.rockspec... switching to 'build' mode
Cloning into 'torch-opencv'...
remote: Counting objects: 202, done.
remote: Compressing objects: 100% (180/180), done.
remote: Total 202 (delta 40), reused 76 (delta 19), pack-reused 0
Receiving objects: 100% (202/202), 2.03 MiB | 252.00 KiB/s, done.
Resolving deltas: 100% (40/40), done.
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/taurandat/frameworks/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/taurandat/frameworks/torch/install/lib/luarocks/rocks/cv/scm-1";
make

-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /Users/taurandat/frameworks/torch/install
CMake Warning at CMakeLists.txt:55 (MESSAGE):
  BUILD_CUDA is ON, but OpenCV CUDA interface wasn't found.  Won't build
  OpenCV-CUDA wrappers.


-- Modules to wrap: xphoto, stitching, ximgproc, calib3d, objdetect, video, videoio, superres, photo, optflow, ml, imgproc, flann, features2d, highgui, imgcodecs,
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/luarocks_cv-scm-1-4163/torch-opencv/build
Scanning dependencies of target Common
[  2%] Building CXX object CMakeFiles/Common.dir/src/Common.cpp.o
[  5%] Linking CXX shared library lib/libCommon.dylib
[  5%] Built target Common
Scanning dependencies of target xphoto
[  8%] Building CXX object CMakeFiles/xphoto.dir/src/xphoto.cpp.o
/tmp/luarocks_cv-scm-1-4163/torch-opencv/src/xphoto.cpp:8:17: error: no member
      named 'autowbGrayworld' in namespace 'cv::xphoto'
    cv::xphoto::autowbGrayworld(src.toMat(), dst_mat, thresh);
    ~~~~~~~~~~~~^
/tmp/luarocks_cv-scm-1-4163/torch-opencv/src/xphoto.cpp:18:17: error: no member
      named 'balanceWhite' in namespace 'cv::xphoto'
    cv::xphoto::balanceWhite(src.toMat(), dst_mat.mat, algorithmType, in...
    ~~~~~~~~~~~~^
/tmp/luarocks_cv-scm-1-4163/torch-opencv/src/xphoto.cpp:27:17: error: no member
      named 'balanceWhite' in namespace 'cv::xphoto'
    cv::xphoto::balanceWhite(src.toMat(), dst_mat.mat, sigma, psize);
    ~~~~~~~~~~~~^
3 errors generated.
make[2]: *** [CMakeFiles/xphoto.dir/src/xphoto.cpp.o] Error 1
make[1]: *** [CMakeFiles/xphoto.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.

Please help.

@shrubb
Copy link
Contributor

shrubb commented Oct 29, 2016

Hi!

The bindings are targeted at OpenCV 3.1.0. autowbGrayworld is absent in trunk but present in 3.1.0. So, there are 2 solutions:

  • use OpenCV 3.1.0 stable: invoke brew without --HEAD
  • don't generate xphoto bindings: do OpenCV_DIR="...your opencv dir" DONT_WRAP=xphoto luarocks install cv

@ghost
Copy link
Author

ghost commented Oct 30, 2016

Thanks shrubb!

  1. I cant reinstall it with the following command:

brew install opencv3 --with-contrib --with-ffmpeg --with-python3 --without-numpy

That yield some errors.

[ 45%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o
cd /tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/macbuild/modules/videoio && /usr/local/Homebrew/Library/Homebrew/shims/super/clang++   -DCVAPI_EXPORTS -DVIDEOIO_EXPORTS -D__OPENCV_BUILD=1 -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_osx/include -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/macbuild -isystem /usr/local/include/eigen3 -isystem /usr/local/Cellar/ffmpeg/3.1.5/include -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/videoio/include -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/videoio/src -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/macbuild/modules/videoio -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/core/include -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/imgproc/include -I/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/imgcodecs/include  -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mavx -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -DNDEBUG  -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fPIC   -o CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o -c /tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/videoio/src/cap_qtkit.mm
/tmp/opencv3-20161030-1645-1bezk23/opencv-3.1.0/modules/videoio/src/cap_qtkit.mm:46:9: fatal error: 'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
        ^
1 error generated.
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
  1. The second solution worked like a charm.

@shrubb
Copy link
Contributor

shrubb commented Oct 30, 2016

Glad it helped!

@shrubb shrubb closed this as completed Oct 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant