namedWindow function doesn't create window - c++

I am using the following code to display a sample image but no windows shows up despite imread actually returns a cv::Mat object. After debugging I realized namedWindow actually doesn't create any window and gives no error message in the terminal.
cv::Mat dst;
dst=imread("/home/user/catkin_ws/sample.jpg");
std::cout << cv::getBuildInformation() << std::endl;
cv::namedWindow("test");
cv::imshow("test", dst);
Here is the configuration information of my OpenCV
General configuration for OpenCV 2.4.8 =====================================
Version control: unknown
Platform:
Host: Linux 3.2.0-58-generic x86_64
CMake: 2.8.12.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/x86_64-linux-gnu-g++ (ver 4.8.2)
C++ flags (Release): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNDEBUG
C++ flags (Debug): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/x86_64-linux-gnu-gcc
C flags (Release): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNDEBUG
C flags (Debug): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
Linker flags (Debug): -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
Precompiled headers: YES
OpenCV modules:
To be built: core flann imgproc highgui features2d calib3d ml objdetect video contrib legacy photo gpu java ocl python stitching superres ts videostab
Disabled: world
Disabled by dependency: -
Unavailable: androidcamera dynamicuda
GUI:
QT: NO
GTK+ 2.x: YES (ver 2.24.22)
GThread : YES (ver 2.39.90)
GtkGlExt: YES (ver 1.2.0)
OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so)
Media I/O:
ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.50)
TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.3)
JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 1.6.1)
Video I/O:
DC1394 1.x: NO
DC1394 2.x: YES (ver 2.2.1)
FFMPEG: YES
codec: YES (ver 54.35.0)
format: YES (ver 54.20.3)
util: YES (ver 52.3.0)
swscale: YES (ver 2.1.1)
gentoo-style: YES
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
PvAPI: NO
GigEVisionSDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: Using libv4l (ver 1.0.1)
XIMEA: NO
Xine: NO
Other third-party libraries:
Use IPP: NO
Use Eigen: YES (ver 3.2.0)
Use TBB: YES (ver 4.2 interface 7000)
Use OpenMP: NO
Use GCD NO
Use Concurrency NO
Use C=: NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Use AMD FFT: NO
Use AMD BLAS: NO
Python:
Interpreter: /usr/bin/python2 (ver 2.7.6)
Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6)
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.0.dev-95f7a46)
packages path: lib/python2.7/dist-packages
Java:
ant: /usr/bin/ant (ver 1.9.3)
JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include
Java tests: NO
Documentation:
Build Documentation: YES
Sphinx: /usr/bin/sphinx-build (ver 1.2.1)
PdfLaTeX compiler: /usr/bin/pdflatex
Tests and samples:
Tests: NO
Performance tests: YES
C/C++ Examples: YES
Install path: /usr
cvconfig.h is in: /build/buildd/opencv-2.4.8+dfsg1/obj-x86_64-linux-gnu
-----------------------------------------------------------------

You have to call cv::waitKey() after cv::imshow to make OpenCV manage GUI events and actually create the window and wait until a new event arrives.
cv::waitKey() will return after pressing a key. If it is the last statement of your program, as in your example code, the program will finish and the window will close.

Related

C++ openCV - createFisherFaceRecognizer was not declared in this scope

I am trying to make a facerecognizer in C++ using openCV. But keep getting the following errors:
1) cv::face::createFisherFaceRecognizer(int, double), but this gives:
main.cpp:(.text+0x6a8): undefined reference to`cv::face::createFisherFaceRecognizer(int, double)'
2)face::FisherFaceRecognizer::create(), but this gives:
error: ‘cv::face::FisherFaceRecognizer’ has not been declared
None of those work, what is the correct way so I can run my code (none of those commented lines worked...)?
I even reinstalled everything, because no one could help me out. This is the current situation:
General configuration for OpenCV 3.2.0 =====================================
Version control: unknown
Extra modules:
Location (extra): /home/yalishanda/Downloads/opencv_contrib-3.2.0/modules
Version control (extra): unknown
Platform:
Timestamp: 2017-07-04T08:29:50Z
Host: Linux 4.8.0-36-generic x86_64
CMake: 3.5.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 5.4.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -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 -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -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 -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: YES
Extra dependencies: /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so gtk-x11-2.0 gdk-x11-2.0 pangocairo-1.0 atk-1.0 cairo gdk_pixbuf-2.0 gio-2.0 pangoft2-1.0 pango-1.0 gobject-2.0 fontconfig freetype gthread-2.0 glib-2.0 dl m pthread rt
3rdparty dependencies: libjpeg libwebp libtiff libjasper IlmImf libprotobuf
OpenCV modules:
To be built: core flann imgproc ml photo reg surface_matching video dnn freetype fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo tracking videostab xfeatures2d ximgproc aruco optflow phase_unwrapping stitching structured_light
Disabled: world contrib_world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz cnn_3dobj cvv hdf matlab sfm
GUI:
QT: NO
GTK+ 2.x: YES (ver 2.24.30)
GThread : YES (ver 2.48.2)
GtkGlExt: NO
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
JPEG: libjpeg (ver 90)
WEBP: build (ver 0.3.1)
PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
GDCM: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
Aravis SDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: NO/YES
XIMEA: NO
Xine: NO
gPhoto2: NO
Parallel framework: pthreads
Other third-party libraries:
Use IPP: 9.0.1 [9.0.1]
at: /home/yalishanda/Downloads/opencv-3.2.0/build/3rdparty/ippicv/ippicv_lnx
Use IPP Async: NO
Use VA: NO
Use Intel VA-API/OpenCL: NO
Use Lapack: NO
Use Eigen: NO
Use Cuda: NO
Use OpenCL: YES
Use OpenVX: NO
Use custom HAL: NO
OpenCL: <Dynamic loading of OpenCL library>
Include path: /home/yalishanda/Downloads/opencv-3.2.0/3rdparty/include/opencl/1.2
Use AMDFFT: NO
Use AMDBLAS: NO
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.12)
Python 3:
Interpreter: /usr/bin/python3 (ver 3.5.2)
Python (for build): /usr/bin/python2.7
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Matlab: Matlab not found or implicitly disabled
Documentation:
Doxygen: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: NO
Install path: /usr/local
cvconfig.h is in: /home/yalishanda/Downloads/opencv-3.2.0/build
-----------------------------------------------------------------
This is the command with which I compile: (https://pastebin.com/raw/1EB7jXZd)
g++ src/faceDetection.cpp src/faceRecognition.cpp main.cpp -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core -o main
sort of speaking already linking almost every library that exists in openCV.... What else can I add?
createFisherFaceRecognizer() must be declared before being used. Most likely you are missing an header file (.h). I couldn't understand from the doc which one is it. You must find which one declares this function.

OpenCV waitKey() function always returns 255 on mac

I tested the OpenCV waitKey() function on Mac (version 10.12.2) but it didn't seem to work correctly. It always return 255 when no keys pressed as well as any key pressed! I'm wondering whether it's incorrectly installed or it's a bug in OpenCV itself. Any idea to fix it would be appreciated.
Here the source code of my program:
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
int main() {
int ch;
cv::namedWindow("Test waitKey()", cv::WINDOW_AUTOSIZE);
cv::Mat image = cv::Mat(100,100,CV_8U, cv::Scalar(0));
cv::imshow("Test waitKey()", image);
for (;;){
ch = cv::waitKey(1000);
std::cout << ch << std::endl; // always return 255
// and this if statement will never be executed!
if (ch == 'q') break;
}
return 0;
}
And here the output of cv::getBuildInformation() function:
General configuration for OpenCV 3.2.0
=====================================
Version control: unknown
Platform:
Timestamp: 2017-01-14T14:50:25Z
Host: Darwin 16.3.0 x86_64
CMake: 3.7.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: RELEASE
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ (ver 8.0.0.8000042)
C++ flags (Release): -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 -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -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 -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
C flags (Release): -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 -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -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 -Wno-comment -fdiagnostics-show-option -Wno-long-long -Qunused-arguments -Wno-semicolon-before-method-body -fno-omit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: NO
Extra dependencies: -framework OpenCL -framework Cocoa -framework AVFoundation -framework CoreGraphics -framework CoreMedia -framework CoreVideo -framework QuartzCore -framework Accelerate
3rdparty dependencies: libjpeg libwebp libpng libtiff libjasper IlmImf zlib
OpenCV modules:
To be built: core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab python2
Disabled: world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz
GUI:
QT: NO
Cocoa: YES
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.8)
JPEG: build (ver 90)
WEBP: build (ver 0.3.1)
PNG: build (ver 1.6.24)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
GDCM: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
avcodec: NO
avformat: NO
avutil: NO
swscale: NO
avresample: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
Aravis SDK: NO
AVFoundation: YES
V4L/V4L2: NO/NO
XIMEA: NO
gPhoto2: NO
Parallel framework: GCD
Other third-party libraries:
Use IPP: 9.0.1 [9.0.1]
at: /Users/ngoclinhng/opencv/release/3rdparty/ippicv/ippicv_osx
Use IPP Async: NO
Use VA: NO
Use Intel VA-API/OpenCL: NO
Use Lapack: YES (-framework Accelerate)
Use Eigen: NO
Use Cuda: NO
Use OpenCL: YES
Use OpenVX: NO
Use custom HAL: NO
OpenCL: <Link with OpenCL library>
Link libraries: -framework OpenCL
Use AMDFFT: NO
Use AMDBLAS: NO
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.10)
Libraries: /usr/lib/libpython2.7.dylib (ver 2.7.10)
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.8.0rc1)
packages path: lib/python2.7/site-packages
Python 3:
Interpreter: /Users/ngoclinhng/anaconda/bin/python3 (ver 3.5.2)
Python (for build): /usr/bin/python2.7
Java:
ant: NO
JNI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers
Java wrappers: NO
Java tests: NO
Matlab: Matlab not found or implicitly disabled
Documentation:
Doxygen: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: NO
Install path: /usr/local
cvconfig.h is in: /Users/ngoclinhng/opencv/release
-----------------------------------------------------------------
You should use cvWaitKey(n) instead~
After OpenCV 3.1, cv::waitKey(n) return value changed from -1 to 255 when no keydown during the n millis.
You normally have to and the result with 255 to mask extraneous bits out:
key = cv::waitKey(1000) & 255;
Extraneous bits might be the shift or control key etc. They are OS-dependent.
The keypresses being detected also depends on which window you have selected - you need to have the image window selected (having the focus) IIRC for keypresses to be detected - rather than the Terminal window from which you launched your program.

How to know which flags have been set for OpenCV 2.3.1 built on Ubuntu 12.04?

I need to work on a computer, not mine, where OpenCV is already built. However, I would like to know which flags have been set when it was built, e.g. WITH_TBB= , WITH_CUDA= , and so on. Is there a way to get this information from some file?
Just run this:
#include <opencv2/opencv.hpp>
#include <iostream>
int main()
{
// Get build information
std::cout << cv::getBuildInformation();
}
It produces output like this:
General configuration for OpenCV 3.0.0 =====================================
Version control: unknown
Platform:
Host: Darwin 15.0.0 x86_64
CMake: 3.3.2
CMake generator: Unix Makefiles
CMake build tool: /usr/local/Library/ENV/4.3/gmake
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/local/Library/ENV/4.3/clang++ (ver 7.0.0.7000176)
C++ flags (Release): -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 -DNDEBUG
C++ flags (Debug): -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 -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/local/Library/ENV/4.3/clang
C flags (Release): -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 -DNDEBUG
C flags (Debug): -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 -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
Precompiled headers: NO
Extra dependencies: -framework OpenCL -framework Cocoa /usr/local/opt/jpeg/lib/libjpeg.dylib /usr/local/lib/libwebp.dylib /usr/local/lib/libpng.dylib /usr/local/lib/libtiff.dylib /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib /usr/lib/libz.dylib -framework QTKit -framework QuartzCore -framework AppKit
3rdparty dependencies: ippicv
OpenCV modules:
To be built: hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab python2
Disabled: world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz
GUI:
QT: NO
Cocoa: YES
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /usr/lib/libz.dylib (ver 1.2.5)
JPEG: /usr/local/opt/jpeg/lib/libjpeg.dylib (ver 80)
WEBP: /usr/local/lib/libwebp.dylib (ver encoder: 0x0202)
PNG: /usr/local/lib/libpng.dylib (ver 1.6.18)
TIFF: /usr/local/lib/libtiff.dylib (ver 42 - 4.0.6)
JPEG 2000: NO
OpenEXR: /usr/local/lib/libImath.dylib /usr/local/lib/libIlmImf.dylib /usr/local/lib/libIex.dylib /usr/local/lib/libHalf.dylib /usr/local/lib/libIlmThread.dylib (ver 2.2.0)
GDAL: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
codec: NO
format: NO
util: NO
swscale: NO
resample: NO
gentoo-style: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
QuickTime: NO
QTKit: YES
V4L/V4L2: NO/NO
XIMEA: NO
gPhoto2: NO
Other third-party libraries:
Use IPP: 8.2.1 [8.2.1]
at: /tmp/opencv320151102-4718-8kzykk/opencv-3.0.0/3rdparty/ippicv/unpack/ippicv_osx
Use IPP Async: NO
Use Eigen: YES (ver 3.2.6)
Use TBB: NO
Use OpenMP: NO
Use GCD YES
Use Concurrency NO
Use C=: NO
Use pthreads for parallel for:
NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: static
libraries: -framework OpenCL
Use AMDFFT: NO
Use AMDBLAS: NO
Python 2:
Interpreter: /usr/bin/python (ver 2.7.10)
Libraries: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (ver 2.7.10)
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include (ver 1.8.0rc1)
packages path: lib/python2.7/site-packages
Python 3:
Interpreter: NO
Python (for build): /usr/bin/python
Java:
ant: NO
JNI: /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers /System/Library/Frameworks/JavaVM.framework/Headers
Java wrappers: NO
Java tests: NO
Matlab:
mex: NO
Documentation:
Doxygen: NO
PlantUML: NO
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: NO
Install path: /usr/local/Cellar/opencv3/3.0.0
cvconfig.h is in: /tmp/opencv320151102-4718-8kzykk/opencv-3.0.0/macbuild
-----------------------------------------------------------------

failure in compiling opencv with cap_gstreamer error

I am trying to compile opencv on Slackware 4.1. However I encountered the following error each time.
In file included from /usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:29:0,
from /tmp/SBo/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp:65:
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:35:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererStreamInfoClass;
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:83:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererContainerInfoClass;
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:104:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererAudioInfoClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:129:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererVideoInfoClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:159:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererSubtitleInfoClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/gstdiscoverer.h:202:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstDiscovererInfoClass;
^
In file included from /tmp/SBo/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp:65:0:
/usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:47:9: error: 'GstMiniObjectClass' does not name a type
typedef GstMiniObjectClass GstEncodingProfileClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:66:9: error: 'GstEncodingProfileClass' does not name a type
typedef GstEncodingProfileClass GstEncodingContainerProfileClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:85:9: error: 'GstEncodingProfileClass' does not name a type
typedef GstEncodingProfileClass GstEncodingVideoProfileClass;
^
/usr/include/gstreamer-0.10/gst/pbutils/encoding-profile.h:104:9: error: 'GstEncodingProfileClass' does not name a type
typedef GstEncodingProfileClass GstEncodingAudioProfileClass;
^
/tmp/SBo/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp: In member function 'virtual bool CvCapture_GStreamer::grabFrame()':
/tmp/SBo/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp:232:57: error: 'gst_app_sink_pull_sample' was not declared in this scope
sample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
^
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_gstreamer.cpp.o] Error 1
The configuration report for the compilation is as follows:
-- General configuration for OpenCV 2.4.11 =====================================
-- Version control: unknown
--
-- Platform:
-- Host: Linux 3.10.17 i686
-- CMake: 2.8.12
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/gmake
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.8.2)
-- C++ flags (Release): -O2 -march=i486 -mtune=i686 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -O2 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -O2 -march=i486 -mtune=i686 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -O2 -march=i486 -mtune=i686 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -O2 -DNDEBUG -DNDEBUG
-- C flags (Debug): -O2 -march=i486 -mtune=i686 -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: NO
--
-- OpenCV modules:
-- To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera dynamicuda java python viz
--
-- GUI:
-- QT 4.x: YES (ver 4.8.5 EDITION = OpenSource)
-- QT OpenGL support: NO
-- OpenGL support: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib/libz.so (ver 1.2.8)
-- JPEG: /usr/lib/libjpeg.so (ver 80)
-- PNG: /usr/lib/libpng.so (ver 1.4.12)
-- TIFF: /usr/lib/libtiff.so (ver 42 - 3.9.7)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.2)
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- gentoo-style: NO
-- GStreamer:
-- base: YES (ver 0.10.36)
-- video: YES (ver 0.10.36)
-- app: YES (ver 0.10.36)
-- riff: YES (ver 0.10.36)
-- pbutils: YES (ver 0.10.36)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l1 (ver 0.9.5) / libv4l2 (ver 0.9.5)
-- XIMEA: NO
-- Xine: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use Eigen: NO
-- Use TBB: NO
-- Use OpenMP: NO
-- Use GCD NO
-- Use Concurrency NO
-- Use C=: NO
-- Use Cuda: NO
-- Use OpenCL: YES
--
-- OpenCL:
-- Version: dynamic
-- Include path: /tmp/SBo/opencv-2.4.11/3rdparty/include/opencl/1.2
-- Use AMD FFT: NO
-- Use AMD BLAS: NO
--
-- Python:
-- Interpreter: /usr/bin/python2 (ver 2.7.5)
--
-- Java:
-- ant: NO
-- JNI: /usr/lib/java/include /usr/lib/java/include/linux /usr/lib/java/include
-- Java tests: NO
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: /usr/share/texmf/bin/pdflatex
-- Doxygen: YES (/usr/bin/doxygen)
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- C/C++ Examples: NO
--
-- Install path: /usr
--
-- cvconfig.h is in: /tmp/SBo/opencv-2.4.11/build
I looked through the opencv requirement from below link
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
That I need ffmpeg or libav packages, which I cannot find under standard slackware 14.1 packages. But I installed gstreamer completely instead (gstreamer, gst-pluigns-base, and good) and the error I encountered above definitely has something to do with gstreamer.
I got this fixed by installing libgstreamer-plugins-base1.0-dev. Before that CMake detected GStreamer version 0.10.36, after that - 1.4.5.
It worked for me after I set WITH_GSTREAMER_0_10 to ON
I am using Ubuntu 12.04 but got the same error.
This can be avoided by using the -D WITH_GSTREAMER=OFF parameter.
As advised here and here.
Then here they advise to update gstreamer, but this didn't fix it for me.
I still want to verify this with a fresh installation.
If anybody still have problem with that,
try to install gstreamer1.0 properly with all that packages
Example for Fedora OS:
dnf install gstreamer1-devel gstreamer1-plugins-base-tools
gstreamer1-devel-docs gstreamer1-plugins-base-devel
gstreamer1-plugins-base-devel-docs
gstreamer1-plugins-good gstreamer1-plugins-good-extras
gstreamer1-plugins-ugly gstreamer1-plugins-ugly-devel-docs
gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel
gstreamer1-plugins-bad-free-extras
Here is comprehensive installation guide for your system: official link.

Can not grab image from VideoCapture OpenCV with Asus Xtion Pro Live

I just installed OpenCV 2.4.7 with OpenNI and primesense Sensor as it can be seen in the following build information.
I have problems grabbing from a VideoCapture object. For instance, if I run the openni_capture example, I get "Can not grab images." but I get info about the depth and RGB cameras, so I think I'm getting the VideoCapture object properly opened, but by the time it tries to grab an image, the grab function returns 0.
I am using an Asus Xtion Pro Live and OpenNI and Sensor are working properly since I am able to run examples such as NiViewer.
I would appreciate some help with this problem.
Thank you!
General configuration for OpenCV 2.4.7 =====================================
Version control: unknown
Platform:
Host: Linux 3.5.0-47-generic x86_64
CMake: 2.8.9
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 4.7.2)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler: /usr/bin/gcc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):
Linker flags (Debug):
Precompiled headers: YES
OpenCV modules:
To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib java python stitching superres ts videostab
Disabled: world
Disabled by dependency: -
Unavailable: androidcamera
GUI:
QT: NO
GTK+ 2.x: YES (ver 2.24.13)
GThread : YES (ver 2.34.1)
GtkGlExt: NO
OpenGL support: NO
Media I/O:
ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.7)
JPEG: libjpeg (ver 62)
PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.49)
TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.2)
JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
Video I/O:
DC1394 1.x: NO
DC1394 2.x: YES (ver 2.2.0)
FFMPEG: YES
codec: YES (ver 53.35.0)
format: YES (ver 53.21.1)
util: YES (ver 51.22.2)
swscale: YES (ver 2.1.0)
gentoo-style: YES
GStreamer:
base: YES (ver 0.10.36)
app: YES (ver 0.10.36)
video: YES (ver 0.10.36)
OpenNI: YES (ver 1.5.7, build 10)
OpenNI PrimeSensor Modules: YES (/usr/lib/libXnCore.so)
PvAPI: NO
GigEVisionSDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: Using libv4l (ver 0.8.8)
XIMEA: NO
Xine: NO
Other third-party libraries:
Use IPP: NO
Use Eigen: YES (ver 3.0.93)
Use TBB: NO
Use OpenMP: NO
Use GCD NO
Use Concurrency NO
Use C=: NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Include path: /home/xxx/imageproc/opencv-2.4.7/3rdparty/include/opencl/1.2
Use AMD FFT: NO
Use AMD BLAS: NO
Python:
Interpreter: /usr/bin/python2 (ver 2.7.3)
Libraries: /usr/lib/libpython2.7.so (ver 2.7.3)
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.2)
packages path: lib/python2.7/dist-packages
Java:
ant: /usr/bin/ant (ver 1.8.2)
JNI: /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include
Java tests: YES
Documentation:
Build Documentation: NO
Sphinx: NO
PdfLaTeX compiler: /usr/bin/pdflatex
Tests and samples:
Tests: YES
Performance tests: YES
C/C++ Examples: YES
Install path: /usr/local
cvconfig.h is in: /home/xxx/imageproc/opencv-2.4.7/release
I instantiate the videocapture and try to grab an image as follows:
VideoCapture capture;
capture.open(CV_CAP_OPENNI);
if ( !capture.isOpened() )
{
cout << "Error opening capture" << endl;
return -1;
}
if( !capture.grab() )
{
cout << "Can not grab image" << endl;
}
Based on your code my guess is that will use the kinect openni driver as opposed to the asus openni driver
How about this:
VideoCapture capture;
capture.open(CV_CAP_OPENNI_ASUS);
if ( !capture.isOpened() )
{
cout << "Error opening capture" << endl;
return -1;
}
if( !capture.grab() )
{
cout << "Can not grab image" << endl;
}
I have managed to use two asus xtion pro sensors with opencv in the past, you can see my test code here.
Also, these are the values from the highui types header, with comments:
CV_CAP_OPENNI =900, // OpenNI (for Kinect)
CV_CAP_OPENNI_ASUS =910, // OpenNI (for Asus Xtion)