Code covered by the BSD License  

Highlights from
Image Rectification

4.0

4.0 | 1 rating Rate this file 13 Downloads (last 30 days) File Size: 5.22 KB File ID: #42209

Image Rectification

by

 

M. Pollefeys, R. Koch and L. Van Gool, A simple and efficient rectification method for general motio

| Watch this File

File Information
Description

This is my implementation of Pollefeys rectification work. Not very well tested, please take it "AS IS". Let me know if you encounter problems.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
31 Oct 2013 Adam

Hello,
I would like to try your implementation. Unfortunately, if I call main method returns me an error (bellow). Could you please give me some hint what I am doing wrong.

Code:
i1 = rgb2gray(imread('left.JPG'));
i2 = rgb2gray(imread('right.JPG'));

blobs1 = detectSURFFeatures(i1, 'MetricThreshold', 2000);
blobs2 = detectSURFFeatures(i2, 'MetricThreshold', 2000);

[features1, validBlobs1] = extractFeatures(i1, blobs1);
[features2, validBlobs2] = extractFeatures(i2, blobs2);

indexPairs = matchFeatures(features1, features2, 'Metric', 'SAD', 'MatchThreshold', 5);

P1 = validBlobs1(indexPairs(:,1),:);
P2 = validBlobs2(indexPairs(:,2),:);

[F] = estimateFundamentalMatrix(P1,P2);

[i1_rect,i2_rect] = rect_pollefeys(i1,i2,F);

Error:
Undefined function 'svd' for input arguments of type 'uint8'.

Error in null (line 67)
[~,S,V] = svd(A,0);

Error in rect_pollefeys (line 23)
e1 = null(F);

15 Oct 2013 Alex Kreimer

Please ask your question on stackoverflow.com and send me the link to alex.kreimer at gmail. You'd probably need to provide more detail than you just did.

15 Oct 2013 vipil vinod

hey alex i need to find the depth map of roated and translated image.i have found out the epipolar line..since its not parrellel i cant find the corresponding points..can u pls help me??

08 Jul 2013 Dave

Hi Alex,
Thanks for the update. I downloaded again but still can't see the get_ps( ) function. Which file is it meant to be in?

Thanks
Dave

30 Jun 2013 Alex Kreimer

Hi Dave, I've updated the submission with the missing file. I will take a look at the issue you're having, probably within a week or so.

29 Jun 2013 Dave

Also seems to be missing a function get_ps which is invoked from rect_pollefeys at lines 54 and 55. Where can I find this one ?

Thanks
D

29 Jun 2013 Dave

The issue seems to be with handling the epipole when it's in the image bounds, i.e. in quadrant 5. The error comes at the end of epip_quadrant when the bounding vertices are assigned to P.

It should be possible (in terms of the algorithm) to assign both bounds to the same vertex but not sure if the remainder of the code will handle this.
D

29 Jun 2013 Dave

Hi Alex,

Thanks for posting this, I've built a C implementation of this code and have been looking for something to benchmark against for some time.

I'm having issues running the code at the moment and am about to try debugging but on the off chance you have already found the problem, I'm getting:

??? Attempted to access ii_c(1); index out of bounds because numel(ii_c)=0.

Error in ==> epip_quadrant at 62
p(:,1) = im_corners(:,ii_c(1));

Error in ==> get_theta at 8
p = epip_quadrant(e,dim);

Error in ==> get_theta_bounds at 3
[theta1,~] = get_theta(e1,dim);

Error in ==> rect_pollefeys at 29
thetas = get_theta_bounds(e1,e2,F,[w,h]);

My F is:
0.0000 -0.0001 0.0090
0.0001 0.0000 -0.0121
-0.0123 0.0094 0.4394

and image sizes are 320 rows x 180 columns

Will let you know if I find a fix.

Cheers
Dave

15 Jun 2013 wj  

Contact us