Category "computer-vision"

How to get rid of the KeyError: 'names'

I was trying to make a program that can make classification between runway and taxiway using mask rcnn. after importing custom dataset in json format I am getti

Projective transformations no longer available in TensorFlow 2.0 what can I do?

My team are switching to TensorFlow 2.0. I'm working on a data augmentation pipeline. TensorFlow 1.X had tf.contrib.image.transform that allows for projective t

I need to measure the gap between railway switch and track using python

I need to predict the gap in railway switch using python. Switch image:

How to determine travel distance of an object between frames, using a moving object and camera

If you have a video file with a moving object, as well as a moving camera, is it possible to track the distance that the object moved between 10 or 20 frames? I

Filling contour won't work using drawContours() thickness=-1 [duplicate]

I am trying to fill a contour which was obtained by separately thresholding 3 color channels. image_original = cv2.imread(original_image_pat

Reinforcement Learning applications in computer vision?

As I continued to study computer vision, I felt that RL (reinforcement learning) was used relatively less frequently in computer vision tasks, compared to the i

How to convert road lane coordinates to tensors in Python?

I am trying to develop a Lane Detector using PyTorch. Basically, I'm reading the video frame by frame using cv2, then finding edges using Canny Edge Detector an

Compare two images and find all pixel coordinates that differ

I have designed a program that compares two images and gives you the coordinates of the pixels that are different in both images and plots the using pygame. I d

TypeError: __call__() takes 2 positional arguments but 3 were given. To train Raccoon prediction model using FastRCNN through Transfer Learning

from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from engine import train_one_epoch, evaluate import utils import torchvision.transfor

Why do edge detection filters sum to 0 whereas blur filters sum to 1?

I am now learning about filters in computer vision. I can see that the elements of the kernel for edge detection sum to 0, whereas for blurring sum to 1. I am w

CNN Prediction output to masked image

Given an output prediction of shape [1,21,388,88] from my Unet. How can I plot it as a masked image? I am using PASCAL dataset. Thanks!

Python save numpy array set_printoptions

I have an image which I've read in with cv2 and python. - I think I'm going to 'store' the image as a nparray in my db for later processing, easy retrieval etc.

How to convert cv2.rectangle bounding box to YoloV4 annotation format (relative x,y,w,h)?

I have trained a Yolo4 network and it is giving me bounding boxes as: img_array = cv2.cvtColor(cv2.imread('image.png'), cv2.COLOR_BGR2RGB) classes, scores, bbox

SLIC Superpixel number of superpixels is smaller than the requested

When using the SLIC Superpixel segmentation, sometimes the resulting number of Superpixels is smaller than the requested, is this because of enforced connectivi

Understanding contour hierarchies: How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

I am unable to differentiate between the below two contours. cv2.contourArea() is giving the same value for both. Is there any function to distinguish them in P

How to recalculate the coordinates of a point after scaling and rotation?

I have the coordinates of 6 points in an image (170.01954650878906, 216.98866271972656) (201.3812255859375, 109.42137145996094) (115.70114135742188, 210.427291

Estimating distance from camera to ground plane point

How can I calculate distance from camera to a point on a ground plane from an image? I have the intrinsic parameters of the camera and the position (height, p

How to detect corners of a square with Python OpenCV?

In the image below, I am using OpenCV harris corner detector to detect only the corners for the squares (and the smaller squares within the outer squares). Howe

Errors/Empty video after using write() from cv2.VideoWriter

I am performing template matching and everything seems to be working fine in cv2.imshow(). I want to write a video with all frames resulting from the template m

Darknet stopping after calculating mAP

I'm currently facing a weird issue. I have recently trained a couple of different yolov4 models using the following command: darknet.exe detector train datapath