theAIGuysCode / yolov4-custom-functions

A Wide Range of Custom Functions for YOLOv4, YOLOv4-tiny, YOLOv3, and YOLOv3-tiny Implemented in TensorFlow, TFLite, and TensorRT.
MIT License
602 stars 370 forks source link

Black background plate bitwise loop not working #106

Open dominique-AR opened 1 year ago

dominique-AR commented 1 year ago

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!