FAQ Database Discussion Community


Camera Calibration with OpenCV: Using the distortion and rotation-translation matrix

c++,opencv,computer-vision,robotics
I am reading the following documentation: http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html I have managed to successfully calibrate the camera obtaining the camera matrix and the distortion matrix. I had two sub-questions: 1) How do I use the distortion matrix as I don't know 'r'? 2) For all the views I have the rotation and...

Detecting hand and segmenting image in Android application

android,opencv,computer-vision,image-segmentation
I have developed an android application which captures and processes images. I would like to add the following feature: Detect where a user's hand is in an image. Specifically, the app will use this to approximate where the user is pointing. Segment the image so that only the part of...

How to detect a bending person using Matlab

matlab,image-processing,computer-vision,detection,matlab-cvst
I'm facing a problem while using a computer vision system toolbox (Matlab) vision.PeopleDetector System object to detect the person when it is bending. Since this tool is to only detect upright person, it failed when the bending posture is not upright. I did try using regionprops that worked with segmented...

How could I use these local variables for object position in my main function?

c++,vector,global-variables,computer-vision,local-variables
I'm using some computer vision code in c++ that tracks an object after you draw a bounding box around it, and it can track multiple objects with multiple bounding boxes. In one of the header files there is a function that processes the frame and defines the objects center pixel...

Computer Vision Application on website

computer-vision
I want to create a website where a user can see how some Computer Vision algorithm or application wotks. For example, user uploads or gives a link to his image and clicks "RGB Decomposition", the result is 3 pictures: Red, Green and Blue channels of the original image. Please, advise...

Creating stereoParameters class in Matlab: what coordinate system should be used for relative camera rotation parameter?

matlab,computer-vision,coordinate-systems,camera-calibration,matlab-cvst
stereoParameters takes two extrinsic parameters: RotationOfCamera2 and TranslationOfCamera2. The problem is that the documentation is a not very detailed about what RotationOfCamera2 really means, it only says: Rotation of camera 2 relative to camera 1, specified as a 3-by-3 matrix. What is the coordinate system in this case ? A...

How to programatically perform image segmentation in real-time

opencv,image-processing,computer-vision,image-segmentation
I am currently trying to segment ultrasound images of blood vessels (video frames), such as the one directly below. Using a simple binary filter on the saturation channel (code below), I can get a nonsatisfactory result such as the 3rd image below. Of course, I tried to dilate the filtered...

Predict label of one single image using DeepLearnToolbox

matlab,machine-learning,computer-vision,deep-learning,conv-neural-network
I am using DeepLearnToolbox to do CNN (Convolutional Neural Networks). I have computed my network successfully and I've seen my accuracy, but my question is: how can I query one single image into the network in order to get the label predicted? The final result that I want to get...

Does OpenCV have functions to handle non-linearities in sRGB color space?

opencv,image-processing,colors,computer-vision
I am wondering whether OpenCV has functions to handle the non-linearities in the sRGB color space. Say I want to convert an JPEG image from sRGB color space into XYZ color space. As specified in this Wiki page, one needs to first undo the nonlinearities to convert to linear RGB...

why is shape-indexed-feature so effective on face alignment?

opencv,computer-vision,face-detection,face-recognition
I am implementing some face alignment algorithm recently. I have read the following papers: Supervised descent method and its applications to face alignment Face alignment by explicit shape regression Face alignment at 3000 fps via regressing local binary features All the paper mentioned a important keyword: shape-indexed-feature or pose-indexed-feature. This...

Verifying essential matrix

c++,opencv,computer-vision
I'm trying to code a simple structure from motion scenario, using only 2 images taken from the same camera. I use SIFT to find matching points between the images (total of 72 matches), out of which 62 are correct. I use OpenCV to calculate the fundamental matrix, then the essential....

How can the auto-focus of camera be explained using pinhole camera model?

camera,computer-vision,autofocus
Shifting the auto-focus in real-world camera doesn't change the focal length, rotation, or any other camera parameter in pinhole camera model. However, it does shift the image plane and affect the depth of field. How is this possible? I understand that complex mechanism of real-world camera cannot be easily explained...

Opencv getGaborKernel parameters for filter bank

c++,opencv,computer-vision,filtering
How opencv getGaborKernel function parameters related to orientation and scale parameters? I assume theta is orientation, but what refers to scale? //! returns the Gabor kernel with the specified parameters CV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd,double gamma, double psi=CV_PI*0.5, int ktype=CV_64F ); Here is example...

camera extrinsic calibration

computer-vision,camera-calibration,extrinsic-parameters
I have a fisheye camera, which I have already calibrated. I need to calculate the camera pose w.r.t a checkerboard just by using a single image of said checkerboard,the intrinsic parameters, and the size of the squares of the checkerboards. Unfortunately many calibration libraries first calculate the extrinsic parameters from...

Haar Cascade classifier does not detect faces in simple frontal pictures

python,opencv,computer-vision
Trying to do some simple face detection using opencv + python using Haar Cascade Classifier. Below code perfectly detects faces in image1, image2 but fails to detect in image3 Kindly help me understand what are the reasons for non-detection of face in image3 import numpy as np import cv2 face_cascade...

Matlab: How can I store the output of “fitcecoc” in a database

matlab,machine-learning,computer-vision,classification,matlab-cvst
In Matlab help section, there's a very helpful example to solve classification problems under "Digit Classification Using HOG Features". You can easily execute the full script by clikcing on 'Open this example'. However, I'm wondering if there's a way to store the output of "fitcecoc" in a database so you...

Unexpected output when finding variance of an image in OpenCV -Python

python,opencv,image-processing,computer-vision,variance
My program finds the varaince values of an image at each window of a gridded image. The problem is when I print the values they don't match with what is shown in the ouput image. I have included an example image below. Here is my code: #import packages import numpy...

ORB - object needs to be very close to camera

opencv,camera,computer-vision,object-recognition,orb
I have a program that takes a video feed from RSTP and checks for an object. The only problem is that the object needs to be about 6" from the camera but when I use a wired webcam the object can be a few feet away. Both camera are transmitting...

Saving bounding box coordinates for each frame in a video

machine-learning,computer-vision,vision
I have a video from a camera with humans on the scene. I need to go through each frame of that video and manually save the coordinates (go through each frame and draw the square around each human) of the bounding box of the detected humans on the scene and...

Extract a page from a uniform background in an image

image,matlab,image-processing,computer-vision
If I have an image, in which there is a page of text shot on a uniform background, how can I auto detect the boundaries between the paper and the background? An example of the image I want to detect is shown below. The images that I will be dealing...

Detecting set of planes from point cloud

c++,image-processing,computer-vision,point-clouds
I have a set of point cloud, and I would like to test if there is a corner in a 3D room. So I would like to discuss my approach and if there is a better approach or not in terms of speed, because I want to test it on...

Generating a bounding box around a fragmented silhouette in matlab

matlab,image-processing,computer-vision,bounding-box
Hello I am working with matlab. I am trying to generate a bounding box around a silhouette. The problem here is that the silhouette is fragmented as shown here The code i tried is BW=bwconncomp(image); STATS = regionprops(BW, 'FilledArea','BoundingBox'); which gives me a bounding box around a part of the...

HOG Feature Extraction of Arabic Line Images

image-processing,machine-learning,computer-vision
I am doing a project on Writer Identification. I want to extract HOG features from Line Images of Arabic Handwriting. And than use Gaussian Mixture Model for Classification. The link to the database containing the line Images is : http://khatt.ideas2serve.net/ So my questions are as follows; There are three folders...

finding low contrast edges

image-processing,computer-vision
How can I find the low contrast edges in the following image: Here are the results for the DOG detector in GIMP: All of the algorithms I've tried (canny, sobel, laplace, dog, etc) miss the almost vertical edge in the upper right corner as well as most of the diagonal...

tracking boundary using opencv

c++,opencv,image-processing,computer-vision,opencv3.0
I am trying to track/ trace boundary points in sequence from the following binary image: I am using OpenCV (python). I am using three ways: Apply Canny edge detection to detect edge. Problem is how to get the sequence of points? It's work fine but it's very hard to get...

Select complex colour range for skin-colour detection in OpenCV with Python

python,opencv,numpy,computer-vision,image-recognition
I am trying to make skin-colour detection program. Basically, it takes video from webcamera, and then creates a mask, after which only the skin should be visible. I have found a criterium for detecting skin-colour ranges in a paper. It looks like this: The skin colour at uniform daylight illumination...

Calculating dispersion in Human Tracking

computer-vision,tracking
I am currently trying to track human heads from a CCTV. I am currently using colour histogram and LBP histogram comparison to check the affinity between bounding boxes. However sometimes these are not enough. I was reading through a paper in the following link : paper where dispersion metric is...

Intersection-over-union between two detections

computer-vision,matlab-cvst
I was reading through the paper : Ferrari et al. in the "Affinity Measures" section. I understood that Ferrari et al. tries to obtain affinity by : Location affinity - using area of intersection-over-union between two detections Appearance affinity - using Euclidean distances between Histograms KLT point affinity measure However,...

Optical flow and finger tracking

opencv,computer-vision
I am using opencv to implement finger tracking system And also use calcOpticalFlowPyrLK(pGmask,nGmask,fingers,track,status,err); to perform a LK tracker. The concept I am not clear, after I implement the LK tracker, how should I detect the movement of fingers? Also, the tracker get the last frame and current frame, how to...

Annotation - Enforce a square using imrect

matlab,computer-vision
I have a Matlab program that asks the user to draw a rectangle around a human on the scene (I later extract that region using imcrop). I need to enforce the user to draw a square. I am using the imrect function, but I am unable to force a square,...

MATLAB vision.ShapeInserter() function gives warning about CustomBorderColor attribute

matlab,computer-vision,matlab-cvst
I am trying to create two shapes for inserting into a video frame. Whenever blueBox = vision.ShapeInserter('Shape','Rectangles',... 'BorderColor','Custom',... 'CustomBorderColor',uint8([0 0 255])); greenCircle = vision.ShapeInserter('Shape','Circles',... 'BorderColor','Custom',... 'Fill', true,... 'CustomBorderColor',uint8([200 255 50])); Whenever I run the script MATLAB warns me about CustomBorderColor property. The strange point is that it gives warning message...

why UIImageToMat neglect the third argument when being called?

ios,objective-c,iphone,opencv,computer-vision
In openCV library, specifically, in ios.h, the UIImageToMat is declared as: void UIImageToMat(const UIImage* image, cv::Mat& m, bool alphaExist = false); but When UIImageToMat is called, why people neglect the third argument? for example: UIImageToMat(image, cvImage); ...

Displaying tracks using MATLAB

matlab,computer-vision,bounding-box,matlab-cvst
I am currently trying to track head using MATLAB. Currently at each frame I have bounding boxes of heads, where each set of heads throughout the frame correspond to a unique ID (of a unique person). In a frame a bbox can only be correlated with 1 person. Question :...

knnMatch in OpenCV version 2.4.10

opencv,image-processing,computer-vision
Anyone know how to call knnMatch in version 2.4.10? I used it in this way, but it doesn't work and met errors. Anyone know how to use it? std::vector< DMatch > matches; BFMatcher matcher(NORM_L2, true); Mat mask; matcher.knnMatch(descriptors_1, descriptors_2, matches, 2, mask, false); // Find two nearest matches The error...

OpenCV Error: Assertion failed (s >= 0) in setSize - while trying to place an image over a webcam feed

python,opencv,computer-vision,webcam,webcam-capture
I am trying to overlay an image of a hat over the head in a webcam feed and I get the error in the following line - hat = cv2.resize(imghat, (hatWidth,hatHeight), interpolation = cv2.INTER_AREA) The program runs, but quickly exits and gives the above error. The code segment is given...

What does MATLAB's estimateUncalibratedRectification do expressed mathematically ? What does it calculate exactly?

matlab,geometry,computer-vision,matlab-cvst,projection-matrix
What does MATLAB's estimateUncalibratedRectification do in mathematical/geometrical terms ? What does it calculate exactly ? As far as I understand, if the camera parameters are unknown then only the fundamental matrix can be computed from two images, not the essential matrix. So, as far as I understand, estimateUncalibratedRectification's result should...

How do I pixelate/blur detected face in MATLAB?

matlab,computer-vision,matlab-cvst
I need to automate blurring/pixelation of faces in a video. I did this using a MATLAB script. I have the R2013a version, so functions like readFrame and hasFrame don't work, hence the weird code. The code currently annotates the face using a box. I need to pixelate this area, or...

Detect geometric object on video stream and reconstruct its contours

c++,opencv,image-processing,computer-vision
I'm trying to detect a plastic object on video stream using OpenCV 2.4.9 on C++. The object has six angles and its contour looks like :. For each frame I'm doing some kind of segmentation and edges detection. After these operations i got some binary image containing corrupted contours of...

OpenCv subtract same image but from different sources

image,opencv,computer-vision,subtract
I need to subtract two images: img1 is original image act as objectObject Image (img1) img2 is clicked using camera act as sceneScene Image (img2) Result Image: drive.google.com/open?id=0B0IUdCi6RzGcRENDSEdoa3dRN2c&authuser=0 (I cannot add more than two links) Before calling subtract method following steps are performed: object image (img1) is located in scene...

How to separate the patches in the image?

image,matlab,image-processing,computer-vision,vision
I want to initialize the dictionary of this image. The image is the same as this one: image source The size of the grey image is 320*512 double. I want to separate the 40 brain image patches in this grey image. I have two questions 1) how to get the...

Matlab: RGB to HSV Values of specific pixels not working

matlab,image-processing,computer-vision
I have been trying to get HSV values of few RGB pixels using the following code im = imread('peppers.png'); %// example image c = [12 146 410]; %// column coordinates of desired pixels r = [104 156 129]; %// row coordinates of desired pixels pixels = impixel(im,c,r); %// rgb values...

Matlab cpselect with RGB fixed image

image,matlab,image-processing,computer-vision,image-registration
I would like to be able to use the cpselect matlab tool (or a similar one) with the capability of showing both images (moving image and reference image) in RGB (I only managed to see moving image in RGB and reference image in grayscale). Could someone point me to an...

OpenCV find contours of close objects

c++,opencv,computer-vision
I am writing a C++ Application using the OpenCV library to detect objects in images. These images look like this: http://fs1.directupload.net/images/150311/my6uczfn.png The upper part of the image, which is black, can be ignored. I know, that every pixel, which is not part of a desired object, will be colored in...

MATLAB ConnectedComponentLabeler does not work in for loop

image,matlab,image-processing,computer-vision,matlab-cvst
I am trying to get a set of binary images' eccentricity and solidity values using the regionprops function. I obtain the label matrix using the vision.ConnectedComponentLabeler function. This is the code I have so far: files = getFiles('images'); ecc = zeros(length(files)); %eccentricity values sol = zeros(length(files)); %solidity values ccl =...

Core dump - 32S, 32F, 8U

c++,opencv,computer-vision
I'm trying to run this sequence of code: DescriptorMatcher * matcher = new BFMatcher(NORM_HAMMING); vector<DMatch> matches; matcher -> match(descriptorsImage1, descriptorsImage2, matches); It's resulting in this error: OpenCV Error: Assertion failed ((type == CV_8U && dtype == CV_32S) || dtype == CV_32F) in batchDistance, file /home/.../OpenCV/opencv-2.4.10/modules/core/src/stat.cpp, line 2480 terminate called after...

Linear interpolation how to insert points in a feature matrix in order to make them of equal size

matlab,computer-vision,linear-interpolation
In a lip reading project. I have a data set of not equal number of frames for each video a feature matrix was extracted where the number of rows is the number of frames and the columns is the value of the feature extracted. The problem is that the videos...

Error using MarkerInserter in Matlab

matlab,computer-vision,matlab-cvst,video-tracking
I'm working on a project where I'm supposed to write a program that tracks an object in a video. The program is going to be written in Matlab. The problem I have is that I can't figure out a way to give the function vision.MarkerInseter the location coordinates for the...

How to convert a RGB image to a two dimensional image in Matlab

image,matlab,image-processing,computer-vision,vision
I have a RGB image called imrgb, the size of which is 320*512*3. I want to know how to convert it to a two dimensional image? I saw some colorful images, but they are still two dimensional instead of three dimensional. Can anyone tell me how to convert it to...

Maximum Supported Resolution Capable by OpenCV VideoCapture

c++,opencv,computer-vision
I'm wondering whether there is OpenCV documentation on VideoCapture lists compatible sensor configurations e.g. Resolution < 640x480 || FPS < 1e100. Basically I am wondering whether the class is compatible with large resolutions such as 1960x1080 or even 2304x1536, and whether there are run-time implications of this even if the...

Image foveation in Python

python,opencv,image-processing,numpy,computer-vision
I would like to be able to foveate an image with focal point at the center of the image in Python. My input image can be represented as a 2D Numpy array. I'd like to get an output image with high resolution at the center, but blurry at the sides....

converting greyscale image from RGB to YUV gives non-zero U and V

c#,.net,image-processing,graphics,computer-vision
I've read that if image is greyscale then it shouldn't have B and R component in RGB and no U and V in YUV color spaces. Does it mean they should be equal to 0? I'm using this code to get YUV values: var px = (this.canvas.Image as Bitmap).GetPixel(i, j);...

How to add HOG features into matrix (matlab)

matlab,image-processing,matrix,computer-vision,matlab-cvst
After extracting HOG features of folder of images, I want to add all this results in one matrix. How I can do this? this is my code in matlab: training_female = 'E:\Training Set\Female Images'; % read all images with specified extention, its jpg in our case filenames = dir(fullfile(training_female, '*.jpg'));...

Image correction in visual odometry

matlab,computer-vision,camera-calibration,matlab-cvst
I am trying to implement visual odometry algorithm via matlab. According to step 2 in http://en.wikipedia.org/wiki/Visual_odometry. I need to do image correction before feature detection, matching and motion estimation. I think I need to undistort image like the function (here) in matlab. Can I use the original intrinsic and extrinsic...

De-blur an image in matlab - Error in image dimensions

image,matlab,image-processing,computer-vision
I am trying to do deblurr an image in matlab. this is my code im = im2double(imread('C:\Users\adhil\Desktop\matlab pics\test.JPG')); figure, imshow (G1); % FFT for B1 G_1 = fftshift(G1); G_1 = fft2(G_1); G_1 = ifftshift(G_1); h_1 = fspecial( 'gaussian', [130 221] , 1.0 ); % Fourier Transform of 2D Gaussian H_1...

GPU rendering images with Python cv2 on Raspberry Pi

python,opencv,computer-vision,gpu
I am using the Raspberry Pi 2 to load large resolution images using opencv. I have sketch running, but without apparent "OpenGL" support as the opencv library states that it is not supported: OpenCV Error: no OpenGL support (Library was built without openGL support) I attempted to install pyOpenGL, but...

Annotating video frames with a label based on state

python,matlab,video,annotations,computer-vision
I have a bunch of videos and depthmaps showing human poses from the Microsoft Kinect. I can get a skeleton of the human in the video but what I want to do is recognize a certain pose from this skeleton data. To do that I need to annotate each frame...

How to match the resulting “map” with the given “color_map”?

image,matlab,image-processing,computer-vision,vision
I have a RGB image called imrgb, the size of which is 320*512*3 double.And I also have the color_map = 64*3 double. I use the following code: [X, map] = rgb2ind(imrgb, 256) the resulting X= 320*512 uint8, and the resulting map = 65*3 double. The resulting "map" is totally different...

FastFeatureDetector opencv C++ filtering results

c++,opencv,computer-vision
I am developing a game bot and using opencv and I am trying to make it detect spikes. The spikes look like this : What I tried was using a FastFeatureDetector to highlight keypoints , the result was the following : The spikes are horizontal and change colors.the operation is...

How to draw 3D Coordinate Axes with OpenCV for face pose estimation?

opencv,image-processing,3d,computer-vision,camera-calibration
Suppose I have got the face euler angles (pitch, yaw, roll) now. How can draw the 3D Coordinate Axes which show the face pose. Here is an exmaple from here: ...

Image Histogram Comparison

matlab,image-processing,computer-vision
I was trying to do histogram image comparison between two RGB images which includes heads of the same persons and non-heads to see the correlation between them. The reason I am doing this is because after performing scanning using HOG to check whether the scanning window is a head or...

Surface normal on depth image

c++,opencv,computer-vision
How to estimate the surface normal of point I(i,j) on a depth image (pixel value in mm) without using Point Cloud Library(PCL)? I've gone through (1), (2), and (3) but I'm looking for a simple estimation of surface normal on each pixel with C++ standard library or openCV. ...

OpenCV SVM training dataset

opencv,dataset,computer-vision,svm,training-data
Lets say I have a dataset of about 350 positive images and more than 400 negative images. They aren't the same size. Also their size is bigger than 640x320. What should I do to create a better dataset? Do I need the images to be smaller? If yes, why? Should...

Drawing 3D boxes on chessboard - OpenCV, LibGdx and java

java,opencv,libgdx,computer-vision,augmented-reality
I'm new to opencv. I'm working with it in java, which is a pain, since most of the example and resources around the internet is in C++. Currently my project involves recognizing a chessboard and then be able to draw on specific parts of the board. I've gotten so far...

OpenCV with Python - Placing an image of a hat over the head of a webcam feed

python,opencv,computer-vision,webcam
I am trying to place a png image of a hat over the head of a webcam feed. I am trying to detect a face and place the image above it. This is my code so far - import cv2 import numpy as np face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_default.xml') imghat = cv2.imread('hat.png',...

OpenCV hamming distance between FLANN matches

c++,opencv,computer-vision
Is there a way to get the hamming distance between two matched descriptors when using the flann matcher without manually calculating it? (i.e. looping through the descriptors matched, XORing each element, then counting). I am matching descriptors computed by ORB like so: FlannBasedMatcher flannMatcher; flannMatcher.match(des1, des2, matches); If I check...

Template matching from a screenshot of a window

c++,opencv,computer-vision,gdi,template-matching
What I've done I have a small template image which is meant to be used to find coordinates of matching subimages within a larger screenshot image. The screenshot itself is captured into a memory DC with the help of BitBlt, then converted into a cv::Mat via GetDIBits, like so: HDC...

Saving images with more than 8 bits per pixel in matlab

image,matlab,image-processing,computer-vision
I need to save a set of pre-processing images in matlab, resulting in grayscale images. The problem is the fact that these pre-processed images have pixel values higher than 255. If I save them with imwrite() as, for instance, .PNG files, does matlab normalize the values to be in [0,255]...

OpenCV Error through calibration tutorial (solvePnPRansac)

python,computer-vision,camera-calibration,opencv3.0,pose-estimation
Can anyone know what is going on with this opencv error ? cv2.error: /home/desktop/OpenCV/opencv/modules/core/src/matrix.cpp:2294: error: (-215) d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) in function create Line code which raise it is : rvecs, tvecs, inliers = cv2.solvePnPRansac(objp, corners2, cameraMatrix, dist) I...

MATLAB vision.TextInserter does not insert text

matlab,computer-vision,matlab-cvst
I am trying to insert text message into an image. It does not display and I get no error. close all clear all clc hVideoPlayer = vision.VideoPlayer; hVideoFileReader = vision.VideoFileReader; hVideoFileReader.Filename = 'img1.jpg'; frame = step(hVideoFileReader); hcsc = vision.ColorSpaceConverter; hcsc.Conversion = 'RGB to intensity'; frame = step(hcsc, frame); at...

Bag of Words Representation [closed]

matlab,image-processing,machine-learning,computer-vision,image-segmentation
I would like to implement bag of words representation for my project. I computed the codebook of visual words of images by using their features and descriptors.Then, I obtained cluster centers using k-means. For the bag of words representation part, it is asked that you should use manually labeled segments...

how to translate and scale the image?

image,matlab,image-processing,computer-vision,vision
My image looks like this: The given imrgb = 320*512*3 double; color_map = 64*3 double; after using [X, map] = rgb2ind(imrgb, color_map); I get X = 320*512 uint8. The image is too big for the further processing. My question is how to translate and scale the image to a standard...

KLT Tracker for human tracking in CCTV

matlab,computer-vision,matlab-cvst
I am trying to use a KLT tracker for human tracking in a CCTV footage. The people are very close to the CCTV. I noticed that some time people change the orientation of the heads and also the frame rate is slightly slow. I have read from Rodrigues et al....

Calculating real world co-ordinates using stereo images in Python and OpenCV

python,opencv,computer-vision,coordinates,stereo-3d
I'm working on calculating the real world coordinates of an object in a scene by using a pair of stereo images. The images are simulations of perfect pinhole cameras so there is no distortion to correct and there is no rotation. I know OpenCV has a bunch of functions to...

No video output OpenCV Python

python,opencv,video,image-processing,computer-vision
I am trying to convert my code that works on images to video. My program takes in an image, works out the mean RGB of each 9*9 window and outputs an image: Input Image: Output Image: Here is my code that has an image as input/output: import numpy as np...

Filter out minimum area rectangles - Python OpenCV

python,opencv,image-processing,computer-vision
I am trying to get the coordinates of the 4 vertices of minimum area rectangles constructed around some objects of similar characteristics in an image, ignore if they are equal to a certain set of values, and if they are not, add them to a list. Here is how I...

Non local maxima suppression in python

python,opencv,numpy,computer-vision
Goal: To input an image (2d numpy array) and a window size, and output the same array with the local maxima remaining, but 0 elsewhere. What I am struggling with: I think I made a stupid mistake in my code, maybe a few typos in my loop but I am...

Detecting circles and shots from paper target

image,opencv,image-processing,computer-vision,artificial-intelligence
I'm making a small project where i have to detect points scored from a given image of paper target. Something similar to TargetScan app for iPhone. I'm using openCV for processing image and basically i have two parts for this, one is to detect circles from a target(which works pretty...

Illuminant variant image in road recognition

image-processing,computer-vision,image-segmentation
Recently I've been doing some study on the topic Road Recognition. There is a problem that if you have illuminant variant images, the recognition results will not be satisfactory if you just use the normal segmentation approach. Here, shadow removal will improve the results a lot, but for the image,...

How to force detectMultiScale search on 1:1 scale?

opencv,computer-vision,object-detection
How to force OpenCV CascadeClassifier::detectMultiScale function search only on 1:1 scale? How many scales used by default? UPD: Found relate code: https://github.com/Itseez/opencv/blob/cc92cd07e8d6a54dfd57d5f74c3d4e05b1d956af/modules/objdetect/src/cascadedetect.cpp for( double factor = 1; ; factor *= scaleFactor ) { Size originalWindowSize = getOriginalWindowSize(); Size windowSize( cvRound(originalWindowSize.width*factor), cvRound(originalWindowSize.height*factor) ); if( windowSize.width > maxObjectSize.width || windowSize.height >...

Using Local Binary Patterns with a Circular Mask

image-processing,machine-learning,computer-vision,background-subtraction
In order to extract texture-based features; LBPs (Local Binary Patterns) are used in many background-foreground detection algorithms. It is easy to understand why those features are tolerant against the illumination. However; there is one of their structural properties that i could not comprehend. What is the exact reason for using...

Which feature descriptors to use and why?

opencv,computer-vision,feature-detection,sift,object-detection
I do like to do compute the position and orientation of a camera in a civil aircraft cockpit. I do use LEDs as fixed points. My plan is to save their X,Y,Z Position associated with the LED. How can I detect and identify my LEDs on my images? Which feature...

GigE Camera/MIL Library - Part of image gets cut

c++,image-processing,computer-vision
I am currently working on a software which uses a GigE Camera to record light spectra and do some analysis with them. But because this analysis is time-consuming, part of it is already done on an FPGA. One record of the camera has a format of 320 x 256 (320...

OpenCV algorithm of contours searching and creation of bounding rectagle

python,algorithm,opencv,computer-vision,contour
Hi to the whole programmers society! It has become habitual to me to get acknowledgement of every algorithm I employ in projects. And not long ago I implemented OpenCV library methods to detect contours within input frame as well as to draw bounding rectangle around detected object. So I came...

Frame Rate For Tracking People

computer-vision,tracking
I am trying to track people in an airport area, where the distance of the people from the camera range from 0m - roughly 2m. Currently I am using a CCTV with 25Hz. However, sometimes it seems a little low as a framerate as people tend to jump from one...

Plotting spherical harmonics in matlab

matlab,computer-vision,opticalflow
i want to plot spherical harmonics of zero order in Cartesian Coordinates, but output from Matlab is different is not sphere. x11 = linspace(-1,1,100); x22 = linspace(-1,1,100); x33 = linspace(-1,1,100); [x1 ,x2, x3]= meshgrid(x11,x22,x33); G = (exp((-1)*(x1.^2 + x2.^2 + x3.^2))); isosurface(G); can someone suggest where i am wrong and...

VLFeat: computation of number of octaves for SIFT

image-processing,computer-vision,sift,vlfeat
I am trying to go through and understand some of VLFeat code to see how they generate the SIFT feature points. One thing that has me baffled early on is how they compute the number of octaves in their SIFT computation. So according to the documentation, if one provides a...

Calculating gradient with prewitt operator [duplicate]

computer-vision,gradient
This question already has an answer here: Is it possible to implement the following in MATLAB? 1 answer I am new and trying to learn about it. I searched all kinds of links on Google but there was something about I would be happy if you could tell me...

How to detect if two successive video frames are identical or not?

c++,computer-vision,video-capture
I'm working on a computer vision project on a video. I want to detect if any two successive frames are identical or not. This is my code. capture >> currentFrame; previousFrame = currentFrame; do{ capture >> currentFrame; cvtColor( currentFrame, g1, CV_BGR2GRAY ); cvtColor( previousFrame, g2, CV_BGR2GRAY ); cv::absdiff(g1,g2,diff); int eq...

Using Python OpenCV, How would you extract an image area inside a particular color bounding box?

python,image,opencv,computer-vision
Given a photo that I have manually drawn a colored bounding box, I want to copy / crop the image content, to keep the content inside the bounding box. The goal is to detect that color bounding box, and then use that to tell the script where to copy/crop. I...

Why is SIFT not available in Matlab?

matlab,image-processing,computer-vision,feature-detection,sift
SIFT is an important and useful algorithm in computer vision but it seems that it is not part of Matlab or any of its toolboxes. Why ? Does Matlab offer something better or equivalent ? ...

Kinectv2 normalizing depth values

c#,opencv,computer-vision,kinect,kinect-sdk
I am using Kinect v2 to capture the depth frames. I saw Kinect SDK 1.x codes in C++, they used this BYTE depth = 255 - (BYTE)(256*realDepth/0x0fff); I want to know, what is the purpose of this command and do I need to use this also for Kinect v2? If...

solvePnP: Obtaining the rotation translation matrix

c++,opencv,matrix,computer-vision,transform
I am trying to image coordinates to 3D coordinates. Using the solvePnP function (in C++)has given me 3X1 rotation matrix and 3X1 translation matrix. But isn't the [R|t] matrix supposed to be 3X4? Any help will be greatly appreciated!...

how to access the disparity value in opencv

opencv,computer-vision,stereo-3d
Which of the option is correct disparity.at<short>(X,Y) disparity.at<uchar>(X,Y) Do we have to divide the disparity by 16.0 to get the correct disparity. some people in their blog uses 1. Some have used 2 .The type is of short using the function disparity.type(). The disparity value which I am getting by...

Camera calibration and conversion of coordinates(OpenCV)

c++,opencv,c++11,computer-vision
I am trying to map the 2D pixel coordinates in an image to real world 3D coordinates with respect to a fixed webcam. The calibration tutorial on the OpenCV page (http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html) has given me the following xml file: <?xml version="1.0"?> <opencv_storage> <calibration_Time>"Wed Jun 17 12:02:01 2015"</calibration_Time> <nrOfFrames>25</nrOfFrames> <image_Width>640</image_Width> <image_Height>480</image_Height>...

How do I display the contours of an image using OpenCV Python?

python,opencv,image-processing,computer-vision
I followed this tutorial from official documentation. I run their code: import numpy as np import cv2 im = cv2.imread('test.jpg') imgray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(imgray,127,255,0) contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(img, contours, -1, (0,255,0), 3) That is ok: no errors, but nothing is displayed.I want to display the result they...

Can the validation error of a dataset be higher than the test error during the whole process of training a neural network?

machine-learning,computer-vision,neural-network,deep-learning,pylearn
I'm training a convolutional neural network using pylearn2 library and during all the ephocs, my validation error is consistently higher than the testing error. Is it possible? If so, in what kind of situations?

Estimating pose of one camera given another with known baseline

opencv,computer-vision
I am a beginner when it comes to computer vision so I apologize in advance. Basically, the idea I am trying to code is that given two cameras that can simulate a multiple baseline stereo system; I am trying to estimate the pose of one camera given the other. Looking...

computing Histogram of oriented gradients on log polar bins [closed]

matlab,opencv,image-processing,computer-vision,emgucv
I want to compute histogram of oriented gradient on my image. But I don't want to divide the image to regular square blocks. I'm going to divide the image to uniform log polar bins(like bins in shape context or bins like here ) and then on each bin(block) the histogram...

What is the difference between using an A0 and an A4 camera calibration board ? Is there any ? If yes, what and why?

matlab,opencv,computer-vision,camera-calibration,matlab-cvst
What is the difference between using an A0 and an A4 camera calibration board ? Is there any ? If yes, what and why ? For example, here they use A3 board http://se.mathworks.com/help/vision/ref/estimatecameraparameters.html but here a much larger board : http://se.mathworks.com/help/vision/examples/stereo-calibration-and-scene-reconstruction.html . Why not simply always use a small A4...

How to calculate signed and unsigned Gradient orientations in Matlab

matlab,computer-vision,feature-descriptor
When calculating the gradient orientation for using it in HOG descriptor extraction, we can either choose to use gradient orientations between 0-180 or 0-360, how can we produce such angles using Matlab? i have the following code: Im=imread('cameraman.tif'); // reading the image Im=double(Im); // converting it to double hx =...