简体   繁体   中英

How to fix opencv/modules/objdetect/src/cascadedetect.cpp:1698: error: (-215:Assertion failed) !empty() in function 'detectMultiScale'^?

Goal is to be able to use lbp cascade classifier for recognizing faces but facing this problem. h264@0x2774710 error while decoding MB 6 14, bytestream -7

This is for an opencv v3.4.4 application running on rpi3.

cap = cv2.VideoCapture(rtsp_url)

while (True):

    ret, img = cap.read()
    if ret:
        # convert to gray scale of each frames
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

        # Detects faces of different sizes in the input image
        faces = face_cascade.detectMultiScale(gray, 1.3, 5)

Expected result: grayscale frames, followed by rectangle over face. Actual result: frozen frame after face appears.

Thanks Oliort. Both were issues but I resolved the assertion issue. Only getting this error [h264 @ 0x14c4770] error while decoding MB 26 28, bytestream -11() exactly when a face is detected by the face_cascade.detectMultiScale function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM