如何修复opencv / modules / objdetect / src / cascadedetect.cpp:1698:错误:(-215:断言失败)!empty()在函数'detectMultiScale'^中?

时间:2019-03-29 22:37:50

标签: python python-3.x opencv

目标是能够使用lbp级联分类器来识别人脸,但面临此问题。 解码MB 6 14时,h264 @ 0x2774710错误,字节流-7

这是针对在rpi3上运行的opencv v3.4.4应用程序的。

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)

预期结果:灰度框架,然后是矩形。 实际结果:面部出现冻结帧后。

1 个答案:

答案 0 :(得分:0)

感谢Oliort。两者都是问题,但我解决了断言问题。仅在face_cascade.detectMultiScale函数检测到一张脸时,才在解码MB 26 28,字节流-11()时仅出现此错误[h264 @ 0x14c4770]错误。