Ask Your Question

Assertion error from qasciikey.cpp while running application in C++ using opencv

asked 2013-04-11 13:03:55 -0500

I am running simple program written in C++ which grabs images from camera and displays them on the screen. Many times my application unexpectedly crashes after some time. It happened also in many other simple programs.

I am getting error ASSERT: "false" in file qasciikey.cpp, line 501

I suppose it has something with Qt library which opencv use for displaying windows with images.

I am running Kubuntu 12.04, OpenCV library version is 2.4.3. I have installed opencv on my system together with Qt library using this instructions (opencv is build with -D WITH_QT=ON switch)

Is there some way how to suppress calling of that qasciikey? I am Qt noob and don't know what can be reason of calling that assert. Should I recompile something?

edit retag flag offensive close merge delete


Basically, without knowing which line of code creates the error or where it is comming from, solving errors is quite hard. Can you provide us some more information? Maybe show your code so that we can look for errors?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-12 03:07:23 -0500 )edit

Sorry guys! But did you find the error about this?


cesarhcq gravatar imagecesarhcq ( 2018-04-07 05:36:43 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2015-02-24 13:37:14 -0500

Clausius gravatar image

updated 2015-02-24 13:38:14 -0500

I have the same problem, happens when I try to create 2 separate windows with cv2.namedWindow("...").

Here is the code:

import cv2


vc = cv2.VideoCapture(0)

cv2.moveWindow("window1", 0, 0)
cv2.moveWindow("window2", 641, 0)

if vc.isOpened(): # try to get the first frame
    rval, frame =
    rval = False

while rval:
    key = cv2.waitKey(20)
    cv2.imshow("window1", frame)
    cv2.imshow("window2", frame)
    rval, frame =
    if key == 27: # Exit on ESC

edit flag offensive delete link more


You are placing your waitKey operator before your imshow and thus your paint operation has no time to actually do something usefull. Could you please put the waitKey behind the imshows?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-25 03:23:28 -0500 )edit

Question Tools


Asked: 2013-04-11 13:03:55 -0500

Seen: 4,133 times

Last updated: Feb 24 '15