Skip to content
Advertisement

Tag: opencv

Could not perform object detection using GPU (darknet)

I just set up my specifications for object detection. This what I have built: OpenCV from source (OpenCV tutorial) Build darknet (Build Darknet) The specifications of my laptop are: Windows 10 Pro RTX 3060Ti (CUDA 11.1, CUDNN 8.6) Python 3.7.9 After compiled, I tested the darknet based on the tutorial, it detects my GPU, the picture is as below: Success,

Detect rectangles in an image with Python

I have a large collection of binary images like these ones: On each image I need to detect the white rectangle. The rectangles have different dimensions and orientations and sometimes they are interrupted by a black line (see image 2). I think the problem is easy to solve if one could remove the noisy background. Thus, I tried first using

numpy image float array, to int 0..255 value

I got 3 NumPy data arrays r,g,b represented as a 2D float64 array (720×1024) Essentially per row, each channel is a bunch of floats: What I would like to to do is making it a channel that I can use in cv2.merge((r,g,b)) So that the float64 values per row get multiplied by 255 and something that cv2.merge() accepts. I think

Avoid recursion error with cv2 and mouse callback

I have a class for opening up an image and drawing circles. The entire code can be found here: p1 and p2 store diametrically opposing points on a circle. These are capture with click and drag actions in _on_mouse_interact. It can be run with My issue is that I get Where is the recursion here? Answer Found some time… Apparently,

Is there a method for connecting the detected corners in python?

I want to connect the detected corners that belong to the same object draw like a triangle around that. the following is my code it works I just want to add this functionality. Answer You can use cv2.line() method to draw a line between two points. Here is the documentation shows you how to use this method: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html

Drawing a simple image, displaying it, and closing it

I am trying to do some simple drawings. I wanted to use opencv (cv2) because on a second project I have to display a small animation (rectangle, size depending on a variable; updated every X seconds). However, I do not have experience with image processing libraries and opencv. I am running into a lot of problems, one of which is

Advertisement