Skip to content

Black background plate bitwise loop not working #106

@dominique-AR

Description

@dominique-AR

I want to perform OCR in black background plate, to do so i want to implement this code in order to check it and if so to inverse the result of cv2.threshold but it doesn't work.

background = np.mean(thresh)
if int(background) < 100:
thresh = cv2.bitwise_not(thresh)
else:
pass

I didn't figure out where i'm wrong, can anyone help please!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions