Skip to content

Tag: opencv

Fill a rectangle area with an image

I have a code from OpenCV docs regarding template matching as follows: Right now the rectangle drawn on my image is not filled, I would like to fill the area of the cv2.rectangle with some image. How to achive this? Answer If you are filling the rectangle with the template image, then the dimensions of the te…

How do I run a video in a PyQt container?

In the QVideoWidget container on PyQt, you need to start a video from the computer, on which objects are to be searched through TensorFlow (openCV, cv2). The problem is that when the button is pressed, the video only shows one frame and nothing else. What could be the problem? Made in PyCharm, Python 3.7. Ans…

How can I make an object that follows a route?

I have a red point where I can move around and a blank background that I can edit as I want. My goal is to move this point according to the route I will draw on the background.I can take my center point, plot or detect my route, but I have no idea how this point can follow this route.

TypeError: img should be PIL Image. Got – PyTorch

I’m trying to prepare some image data for my neural to classify. As part of the image preprocessing step, I’m applying the HOG filter in my dataset class as such: After this, I define my train and validation transformation as such: and finally, I create the loaders as such: However, when I attempt…