Category : opencv

I used a code at stackoverflow to mask my image that turned into mask but when I want to apply it at line 31 I get a error that I never saw in my life. here is the error File "main.py", line 31, in <module> masked = cv2.bitwise_and(img_to_mask,img_to_mask,mask = img_mask) cv2.error: OpenCV(4.4.0) C:UsersappveyorAppDataLocalTemppip-req-build-6sxsq0tpopencvmodulescoresrcarithm.cpp:250: error: (-215:Assertion ..

Read more

I have an image with some points, and I need to draw the line of best fit on the image. The points would make a polynomial line. This is what I’ve got so far: #The coordinates are filled in earlier (self.lx, self.ly) z = np.polyfit(self.lx, self.ly, 2) lspace = np.linspace(0, 100, 100) draw_x = lspace ..

Read more

I’m trying to follow a tuto on youtube where i try to recognize license plate with an image path. I’m using open cv ans easyocr. the code : import cv2 from matplotlib import pyplot as plt import numpy as np import imutils import easyocr img = cv2.imread(‘C:/Users/perri/OneDrive/Bureau/visage_detect/plaque_imma.jpg’) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) plt.imshow(cv2.cvtColor(gray, cv2.COLOR_BGR2RGB)) The problem ..

Read more

I trained a YoloV4 model and used opencv-contrib because openCv does not support YoloV4 yet. You can use it with yolov3. Thee are 2 problems with the code: When the final image is seen using cv2.imshow, it shoes the traingle as Yellow instead of blue. I need to extract that triangle and pass to some ..

Read more