exception in cvWaitKey function (libopencv_highgui library)

asked 2014-07-06 09:59:14 -0500

Amin Abouee gravatar image

updated 2014-07-06 10:00:07 -0500

Hi guys, I have opencv 2.4.9 in my mac. I installed it with homebrew package manager and with qt, c++11 and tbb dependencies ("Built from source with: --c++11, --with-qt, --with-tbb"). I don't know why from previous week, It throws an exception due to cvWaitKey and Qtcore when I want to show a video or an image.

0   CoreFoundation                      0x00007fff90a4a25c __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x00007fff8c8e0e75 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff90a4a10c +[NSException raise:format:] + 204
3   AppKit                              0x00007fff83972d14 -[NSCarbonMenuImpl _createMenuRef] + 62
4   AppKit                              0x00007fff839726ea -[NSCarbonMenuImpl _instantiateCarbonMenu] + 143
5   AppKit                              0x00007fff83970eb2 -[NSApplication finishLaunching] + 876
6   AppKit                              0x00007fff83970813 -[NSApplication run] + 128
7   QtGui                               0x0000000105335065 _ZN26QEventDispatcherMacPrivate22ensureNSAppInitializedEv + 97
8   QtGui                               0x0000000105334949 _ZN19QEventDispatcherMac13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 559
9   QtCore                              0x0000000105f7ce4d _ZN16QCoreApplication13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 81
10  libopencv_highgui.2.4.dylib         0x00000001039537f7 cvWaitKey + 191
11  inversekinematics-d                 0x000000010304c241 _ZN13MarkerTracker10findMarkerERN2cv3MatERNSt3__16vectorI6MarkerNS3_9allocatorIS5_EEEEid + 13697
12  inversekinematics-d                 0x0000000103046276 main + 1174
13  libdyld.dylib                       0x00007fff8363e5fd start + 1

In this duration In never changed the libraries that may be corrupted opencv. I also installed the opencv and qt again but the problem has preserved. I'm confused, Can anyone help me ??

edit retag flag offensive close merge delete

Comments

I am wondering why you are using C++ combined with functions like cvWaitKey, which is C-API. The correct function you are looking for is waitKey. Probably changing this will lead to a correct working system since the C-API is getting removed bit by bit.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-07 07:27:55 -0500 )edit

StevenPuttemans: obviously I'm not using of cvWaitKey. I used of C++ wrapper and this wrapper converts data to C_API in runtime. It means, finally you run the cvWaitKey not waitKey. for more details, you can see the C++ wrapper of highgui in trunk.

Amin Abouee gravatar imageAmin Abouee ( 2014-07-08 07:00:42 -0500 )edit