computer-vision

YOLO Annotation Files for Already-Cropped Images

此生再无相见时 提交于 2021-02-20 05:15:06
问题 I'm attempting to create my own dataset for use with YOLO (You Only Look Once). Initially, I started with a large geotiff file that had pictures of landscape and animals. I was able to write a script to extract the images of the animals into separate files. I'm now at a point where I'd like to use those animal images as part of a YOLO dataset. However, all of the examples I've seen online utilize annotation files, which denote the location of an object-to-be-detected within a larger image. In

How can I put a degree symbol (º) on an OpenCv Video?

孤街浪徒 提交于 2021-02-20 04:07:49
问题 I made a program which make a HUD over a video, getting info from sensors and plotting the results on the video frames, refreshing every frame, and for representing degrees (inclination) I need to plot a degree symbol, but what I get it's 2 symbols ("??") in the video show. I search through this site and others too. I can't do it!!!! please, I don't know what to do, it's just that little thing that I can't do it. This is the beginning of my program: import cv2 from random import * import

TensorFlow: Is there a way to locate the filenames of images encoded into TFRecord files?

∥☆過路亽.° 提交于 2021-02-19 08:11:07
问题 I am wondering if the filename information of the image encoded could be encoded into a TFRecord file while creating the tfrecord files, and if so, how could this information be decoded back? When decoded, is the filename a Tensor object? 回答1: Just like fabrizioM said, you have to store the sources in the tfrecords file if you want to use them. Here is an example: #!/usr/bin/env python """Example for reading and writing tfrecords.""" import tensorflow as tf from PIL import Image import numpy

OpenCV: How to use the convertScaleAbs() function

匆匆过客 提交于 2021-02-19 06:11:06
问题 I am trying to convert an image back to greyscale after applying Sobel filtering on it. I have the following code: import numpy as np import matplotlib.pyplot as plt import cv2 image = cv2.imread("train.jpg") img = np.array(image, dtype=np.uint8) #convert to greyscale img_grey = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #remove noise img_smooth = cv2.GaussianBlur(img_grey, (13,13), 0) sobely = cv2.Sobel(img_smooth,cv2.CV_64F,0,1,ksize=9) I want to convert the image sobely back to greyscale using

How to resize a PyTorch tensor?

ぃ、小莉子 提交于 2021-02-18 23:01:34
问题 Now I have a torch.Tensor of size (5, 1, 44, 44) in Pytorch. 5 = batch size 1 = channel 44= image height 44= image width and I want to 'resize' it to shape (5, 1, 224, 224) How can I do that? What functions should I use? 回答1: It seems like you are looking for interpolate (a function in nn.functional ): import torch.nn.functional as nnf x = torch.rand(5, 1, 44, 44) out = nnf.interpolate(x, size=(224, 224), mode='bicubic', align_corners=False) If you really care about the accuracy of the

How to resize a PyTorch tensor?

一笑奈何 提交于 2021-02-18 23:00:20
问题 Now I have a torch.Tensor of size (5, 1, 44, 44) in Pytorch. 5 = batch size 1 = channel 44= image height 44= image width and I want to 'resize' it to shape (5, 1, 224, 224) How can I do that? What functions should I use? 回答1: It seems like you are looking for interpolate (a function in nn.functional ): import torch.nn.functional as nnf x = torch.rand(5, 1, 44, 44) out = nnf.interpolate(x, size=(224, 224), mode='bicubic', align_corners=False) If you really care about the accuracy of the

Microsoft Azure Cognitive Services Handwriting Detection Bounding Box Parameters

两盒软妹~` 提交于 2021-02-18 21:01:24
问题 I am currently using Microsoft Azure Cognitive Services Handwriting Detection API. The API returns a set of values for the bounding box: { "boundingBox": [ 2, 52, 65, 46, 69, 89, 7, 95 ], "text": "dog", . . . I would like to make sense of these 8 parameters. What is their significance and what do they reflect? I tried hard finding about them in Microsoft API's documentation, but of no use. Kindly help me understand what these parameters mean or link me to some place where this doubt can be

OpenCV: Fundamental matrix accuracy

主宰稳场 提交于 2021-02-18 19:21:29
问题 I am trying to calculate the fundamental matrix of 2 images (different photos of a static scene taken by a same camera). I calculated it using findFundamentalMat and I used the result to calculate other matrices (Essential, Rotation, ...). The results were obviously wrong. So, I tried to be sure of the accuracy of the calculated fundamental matrix. Using the epipolar constraint equation , I Computed fundamental matrix error. The error is very high (like a few hundreds). I do not know what is

OpenCV: Fundamental matrix accuracy

若如初见. 提交于 2021-02-18 19:21:28
问题 I am trying to calculate the fundamental matrix of 2 images (different photos of a static scene taken by a same camera). I calculated it using findFundamentalMat and I used the result to calculate other matrices (Essential, Rotation, ...). The results were obviously wrong. So, I tried to be sure of the accuracy of the calculated fundamental matrix. Using the epipolar constraint equation , I Computed fundamental matrix error. The error is very high (like a few hundreds). I do not know what is

OpenCV: Understanding warpPerspective / perspective transform

二次信任 提交于 2021-02-18 17:13:52
问题 I made a small example for myself to play around with OpenCVs wrapPerspective, but the output is not completely as I expected. My input is a bar at an 45° angle. I want to transform it so that it's vertically aligned / at an 90° angle. No problem with that. However, what I don't understand is that everything around the actual destination points is black. The reason I don't understand this is, that actually only the transformation matrix gets passed to the wrapPerspective function, not the