The truth value of an array with more than one element is ambigous when trying to index an array

前端 未结 3 2073
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 05:58

I am trying to put all elements of rbs into a new array if the elements in var(another numpy array) is >=0 and <=.1 . However when I try the following code I get this err

3条回答
  •  自闭症患者
    2020-11-29 06:52

    # draw the previous original bounding boxes
    if rectsPersist != None:
        for (x, y, w, h) in rectsPersist:
            cv2.rectangle(orig, (x, y), (x + w, y + h), (0, 0, 255), 2)
    
    # draw the previous final bounding boxes
    if pickPersist != None:
        for (xA, yA, xB, yB) in pickPersist:
            cv2.rectangle(image, (xA, yA), (xB, yB), (0, 255, 0), 2)
    
    if not count % 1:
        count = 0
        image = imutils.resize(image, width=min(700, image.shape[1]))
    

    if rectsPersist != None: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

提交回复
热议问题