"expected Ptr<cv::Umat> for argument 'points'" error

Asked

Viewed 12 times

-2

I downloaded a open source code for Detecting car Plates but I’m runing into a Lot of errors so if someone could help I’d appreciate .

def check_plate(self, input_img, contour):
        min_rect = cv2.minAreaRect(contour)
        if self.validateRatio(min_rect):
            x, y, w, h = cv2.boundingRect(contour)
            after_validation_img = input_img[y:y + h, x:x + w]
            after_clean_plate_img, plateFound, coordinates = self.clean_plate(after_validation_img)
            if plateFound:
                characters_on_plate = self.find_characters_on_plate(after_clean_plate_img)
                if (characters_on_plate is not None and len(characters_on_plate) == 8):
                    x1, y1, w1, h1 = coordinates
                    coordinates = x1 + x, y1 + y
                    after_check_plate_img = after_clean_plate_img
                    return after_check_plate_img, characters_on_plate, coordinates
        return None, None, None

and it is Giving this error

    min_rect = cv2.minAreaRect(contours)
cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'minAreaRect'
> Overload resolution failed:
>  - points is not a numpy array, neither a scalar
>  - Expected Ptr<cv::UMat> for argument 'points'```

  • Questions with text in Portuguese ....

  • Please clarify your specific problem or provide Additional Details to Highlight Exactly what you need. As it’s Currently Written, it’s hard to Tell Exactly what you’re asking.

  • Please click on [Edit] and translate the question into English (after all, this site is the [pt.]). Take the opportunity to give more details - we need a [mcve] <-- read this link, have tips to improve the question

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.