I am making a program in python that just draws a rectangle around a car. I am currently stuck on getting the coordinates of the car, here is the code: I am running in on an error with the function “cv2.detectMultiScale”. error: I have tried googling, it says to use cv2.CascadeClassifier(cv2.data.haarcascades + “cars.xml”) instead of cv2.CascadeClassifier(“cars.xml”). It didn’t work :(,
Tag: computer-vision
Luminance Correction (Prospective Correction)
When I was searching internet for an algorithm to correct luminance I came across this article about prospective correction and retrospective correction. I’m mostly interested in the prospective correction. Basically we take pictures of the scene with image in it(original one), and two other ,one bright and one dark, pictures where we only see the background of the original picture.
I’m not able to get the correct homography points
I’m trying to create homography matrix from this field: (source image with ids:) To the destination image: The points for the source points are: And the points for destination points (new image): I tried to create homography matrix with the following code: And I got the following homography matrix: I tried to check if the homography matrix is correct, so
Is there any way to detect edge in this situation?
I try to detect edge using python. There are hundreds of algorithms for edge detection, however, the image is very obscure and unclear. The most serious problem is one edge is located at the local maximum value, but the other edge is located slightly shifted from local maximum value. Through the detailed examination, I found the other edge is located
How to rotate a rectangle/bounding box together with an image
I’m working on a data augmentation and im trying to generate synthetic version of every image in my dataset. So i need to rotate images and together with bounding boxes as well in the images. im only going to rotate images by 90, 180, 270 degrees. I’m using pascal-voc annotation format as shown here. As a result i have following
How to use pt file
I’m trying to make a currency recognition model and I did so using a dataset on kaggle and colab using yolov5 and I exactly carried out the steps explained on yolov5 github. At the end, I downloaded a .pt file which has the weights of the model and now I want to use it in python file to detect and
How to find contours in dotted text captcha image
I am newbie to OpenCV. I’m trying to find the contours of the captcha image. It does not work only when my captcha image contains the dotted text. I have done following code for that: Can anyone help in this? Is there any way to find contours in this image? Answer Here is my code and output
correct shape (BS,H,W,C) not working in torchvision.utils.save_image
Let’s BS be the batch size, H the height, w the weight, and c the number of channels which is 3 in my case. When I save my image in this shape (BS,C,H,W) with it works very well but the image is unreadable since the format is wrong. But when I am reshaping my image into the right format which
Remove white borders from segmented images
I am trying to segment lung CT images using Kmeans by using code below: The problem is the segmented lung still contains white borderers like this: Segmented lung (output): Unsegmented lung (input): The full code can be found in Google Colab Notebook. code. And sample of the dataset is here. Answer For this problem, I don’t recommend using Kmeans color
Rotate polygons without cutting edges
I am writing an augmentation code to rotate annotated polygons inside images. I wrote a code but it’s not working right. Just Copy paste the code and you can get the results. Thank you for helping me out. Image: Need to rotate the image as well as a polygon for respective angle. Currently, I am not able to rotate the