Ask Your Question
0

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

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

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 http://www.raben.com/content/opencv-installation-ubuntu-1204 (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

Comments

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 -0600 )edit

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

THanks!

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

1 answer

Sort by » oldest newest most voted
0

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

Clausius gravatar image

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

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

Here is the code:

import cv2

cv2.namedWindow("window1")
cv2.namedWindow("window2")

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 = vc.read()
else:
    rval = False

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

cv2.destroyWindow("window1")
cv2.destroyWindow("window2")
edit flag offensive delete link more

Comments

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 -0600 )edit

Question Tools

Stats

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

Seen: 6,783 times

Last updated: Feb 24 '15