Problem with imshow in opencv 2.4.5 and ubuntu 13.04 [closed]

asked 2013-05-07 22:43:22 -0600

jluzwick gravatar image

I just updated to ubuntu 13.04 and I'm having problems running opencv 2.4.5. I first built opencv with Qt support and I was able to see windows pop up but no image was being displayed. I then rebuilt opencv with just gtk and I am now unable to see any window screens pop up or display images. For reference, here are the parameters CMake output during the building of makefiles.

jim@ubuntu:~/Downloads/opencv-2.4.5/build/bin$ cmake ..
-- Detected version of GNU GCC: 47 (407)
-- Found OpenEXR: /usr/lib/i386-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
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
-- Could NOT find OPENCL (missing:  OPENCL_LIBRARY OPENCL_INCLUDE_DIR) 
-- 
-- General configuration for OpenCV 2.4.5 =====================================
--   Version control:               unknown
-- 
--   Platform:
--     Host:                        Linux 3.8.0-19-generic i686
--     CMake:                       2.8.10.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 4.7.3)
--     C++ flags (Release):         -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):           -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 -ggdb3
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -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):             -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 -ggdb3
--     Linker flags (Release):      
--     Linker flags (Debug):        
--     Precompiled headers:         YES
-- 
--   OpenCV modules:
--     To be built:                 core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree stitching superres ts videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 androidcamera java ocl python
-- 
--   GUI: 
--     QT 4.x:                      NO
--     GTK+ 2.x:                    YES (ver 2.24.17)
--     GThread :                    YES (ver 2.36.0)
--     GtkGlExt:                    NO
--     OpenGL support:              NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/i386-linux-gnu/libz.so (ver 1.2.7)
--     JPEG:                        /usr/lib/i386-linux-gnu/libjpeg.so (ver )
--     PNG:                         /usr/lib/i386-linux-gnu/libpng.so (ver 1.2.49)
--     TIFF:                        /usr/lib/i386-linux-gnu/libtiff.so (ver 42 - 3.9.7)
--     JPEG 2000:                   /usr/lib/i386-linux-gnu/libjasper.so (ver 1.900.1 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Mathieu Barnachon
close date 2013-06-11 23:41:12.373585

Comments

2

Maybe your image wasn't loaded? Check if it is empty:

Mat im = imread(...);
if (im.empty())
    cout &lt;&lt; "Empty";
Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2013-05-08 01:32:00 -0600 )edit

It was. Sorry for the question. Along with my upgrade I also refactored a bit and forgot to move my cv::waitKey() over... Doh. Sorry for anyone that attempted to help.

jluzwick gravatar imagejluzwick ( 2013-05-11 15:56:37 -0600 )edit

If someone with enough rep can close my question, that would be great. Thanks.

jluzwick gravatar imagejluzwick ( 2013-05-11 15:59:23 -0600 )edit