Questions tagged [computer-vision]

Use this tag for questions related to Computer Vision -- any aspect of software that enables computers to perceive, understand and react to their environment using cameras. For questions related to image filtering and quantification, use the tag [image-processing] instead.

Computer vision enables images, or sequences of images, to be processed by a computer using algorithms. There are many aspects to computer vision, including mathematics, physics (especially optics), imaging hardware, , and .

Some basic techniques used in computer vision are:

  • Image acquisition
  • Pre-processing
  • Feature Extraction
  • Detection/Segmentation
  • High-Level processing
  • Decision making
15559 questions
55
votes
10 answers

Sobel filter kernel of large size

I am using a sobel filter of size 3x3 to calculate the image derivative. Looking at some articles on the internet, it seems that kernels for sobel filter for size 5x5 and 7x7 are also common, but I am not able to find their kernel values. Could…
Aarkan
  • 3,811
  • 6
  • 40
  • 54
54
votes
2 answers

What is the difference between feature detection and descriptor extraction?

Does anyone know the difference between feature detection and descriptor extraction in OpenCV 2.3? I understand that the latter is required for matching using DescriptorMatcher. If that's the case, what is FeatureDetection used for?
54
votes
2 answers

Custom loss function in Keras

I'm working on a image class-incremental classifier approach using a CNN as a feature extractor and a fully-connected block for classifying. First, I did a fine-tuning of a VGG per-trained network to do a new task. Once the net is trained for the…
Eric
  • 1,108
  • 3
  • 11
  • 25
53
votes
6 answers

Writing robust (color and size invariant) circle detection with OpenCV (based on Hough transform or other features)

I wrote the following very simple python code to find circles in an image: import cv import numpy as np WAITKEY_DELAY_MS = 10 STOP_KEY = 'q' cv.NamedWindow("image - press 'q' to quit", cv.CV_WINDOW_AUTOSIZE); cv.NamedWindow("post-process",…
memyself
  • 11,907
  • 14
  • 61
  • 102
53
votes
5 answers

How to predict input image using trained model in Keras?

I trained a model to classify images from 2 classes and saved it using model.save(). Here is the code I used: from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Conv2D,…
ritiek
  • 2,477
  • 2
  • 18
  • 25
53
votes
11 answers

proportions of a perspective-deformed rectangle

Given a 2d picture of a rectangle distorted by perspective: I know that the shape was originally a rectangle, but I do not know its original size. If I know the pixel coordinates of the corners in this picture, how can I calculate the original…
51
votes
1 answer

What is the definition of a "disparity map"?

I've been asked to implement an edge-based disparity map, but I fundamentally don't understand what a disparity map is. What is the definition of a "disparity map"?
51
votes
7 answers

Use pytesseract OCR to recognize text from an image

I need to use Pytesseract to extract text from this picture: and the code: from PIL import Image, ImageEnhance, ImageFilter import pytesseract path = 'pic.gif' img = Image.open(path) img = img.convert('RGBA') pix = img.load() for y in…
Smith John
  • 1,035
  • 1
  • 10
  • 19
51
votes
17 answers

OpenCV Error: (-215)size.width>0 && size.height>0 in function imshow

I am trying to make a face tracker that combines Haar Cascade Classification with Lucas Kanade good feature detection. However, I keep getting an error that I cannot figure out what it means nor how to solve it. Can anyone help me here? Error: line…
user3377126
  • 2,091
  • 4
  • 32
  • 39
50
votes
1 answer

What is the difference between UpSampling2D and Conv2DTranspose functions in keras?

Here in this code UpSampling2D and Conv2DTranspose seem to be used interchangeably. I want to know why this is happening. # u-net model with up-convolution or up-sampling and weighted binary-crossentropy as loss func from keras.models import…
49
votes
7 answers

Computing camera pose with homography matrix based on 4 coplanar points

I have 4 coplanar points in a video (or image) representing a quad (not necessarily a square or rectangle) and I would like to be able to display a virtual cube on top of them where the corners of the cube stand exactly on the corners of the video…
JimN
  • 713
  • 1
  • 6
  • 8
49
votes
11 answers

Add padding to images to get them into the same shape

l have a set of images of different sizes (45,50,3), (69,34,3), (34,98,3). l want to add padding to these images as follows: Take the max width and length of the whole images then put the image in that size import os import glob import…
vincent
  • 1,558
  • 4
  • 21
  • 34
48
votes
4 answers

Explain Hough Transformation

I am just being adventurous and taking my first baby step toward computer vision. I tried to implement the Hough Transformation on my own but I just don't get the whole picture. I read the wikipedia entry, and even the original "use of the hough…
48
votes
3 answers

Normalizing images in OpenCV produces black image?

I wrote the following code to normalize an image using NORM_L1 in OpenCV. But the output image was just black. How to solve this? import cv2 import numpy as np import Image img = cv2.imread('img7.jpg') gray_image =…
N.Chandimali
  • 799
  • 1
  • 8
  • 23
48
votes
2 answers

What is a feature descriptor in image processing (algorithm or description)?

I get often confused with the meaning of the term descriptor in the context of image features. Is a descriptor the description of the local neighborhood of a point (e.g. a float vector), or is a descriptor the algorithm that outputs the description?…