Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

(Python) ASSERT: “false” in file qasciikey.cpp

Dear all,

I'm on lubuntu 16.04, using OpenCV 3.2.0, Python 2.7 and encountering this error after a brief moment of imshow() displaying a window with my camera stream.

ASSERT: "false" in file qasciikey.cpp, line 495 Aborted (core dumped)

My code appended below:

import numpy as np
import cv2

redcross_cascade = cv2.CascadeClassifier('rcrosscascade.xml')

cap = cv2.VideoCapture(2)

cv2.namedWindow('Haar', cv2.WINDOW_NORMAL)

while 1:
    ret, img = cap.read()
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    redcross = redcross_cascade.detectMultiScale(gray, 50, 50)

    for (x,y,w,h) in redcross:
        cv2.rectangle(img,(x,y),(x+w,y+h),(255,255,0),2)

    cv2.imshow('Haar',img)
    key = cv2.waitKey(1) & 0xff
    if key == 27:
        break

cap.release()
cv2.destroyAllWindows()

Would appreciate any assistance on this matter, thank you!

(Python) ASSERT: “false” in file qasciikey.cpp

Dear all,

I'm on lubuntu 16.04, using OpenCV 3.2.0, Python 2.7 and encountering this error after a brief moment of imshow() displaying a window with my camera stream.

ASSERT: "false" in file qasciikey.cpp, line 495 Aborted (core dumped)

My code appended below:

import numpy as np
import cv2

redcross_cascade = cv2.CascadeClassifier('rcrosscascade.xml')

cap = cv2.VideoCapture(2)

cv2.namedWindow('Haar', cv2.WINDOW_NORMAL)

while 1:
    ret, img = cap.read()
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    redcross = redcross_cascade.detectMultiScale(gray, 50, 50)

    for (x,y,w,h) in redcross:
        cv2.rectangle(img,(x,y),(x+w,y+h),(255,255,0),2)

    cv2.imshow('Haar',img)
    key = cv2.waitKey(1) & 0xff
    if key == 27:
        break

cap.release()
cv2.destroyAllWindows()

Would appreciate any assistance on this matter, thank you!

EDIT: I have identified the trigger for this error - movement from my usb optical mouse. Disconnecting the mouse prevents the error from resurfacing but I've yet to find a reason for this occurrence.