Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7784061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:01:51+00:00 2026-06-01T20:01:51+00:00

i am trying to apply SURF algorithm, which is the algo to find the

  • 0

i am trying to apply SURF algorithm, which is the algo to find the key points and matches corresponding two images, but the problem is that in my case , i want to apply that algo with two images, but they are of different dimension and so it fails to work, could you please tell what shall i do so that both images become equal dimensions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:01:53+00:00Added an answer on June 1, 2026 at 8:01 pm

    That depends on your problem. If the images have the same resolution, I suggest you either crop one image or extend one image (with zeros?) to match the number of pixels.

    Otherwise I suggest you interpolate the images so that they are defined at the same points, for example with interp2.

    Can you give a minimum working code example of what you are trying to do?

    Edit:

    The code example you gave starts with loading to images.

    % Example 2, Corresponding points
    % Load images
    I1=imread('TestImages/lena1.png');
    I2=imread('TestImages/testc2.png');
    

    Here are a few examples of how you can make the images match. You have to decide which one of these makes sense in your case.

    Method 1: crop both images

    nrows = min(size(I1,1), size(I2,1));
    ncols = min(size(I1,2), size(I2,2));
    
    % The + floor( ... ) is only for centering the bounding box
    croppedI1 = I1( (1:nrows) + floor((size(I1,1)-nrows)/2), ...
      (1:ncols)+floor((size(I1,2)-ncols)/2), ...
      :);
    
    croppedI2 = I2( (1:nrows) + floor((size(I2,1)-nrows)/2, ...
      (1:ncols) + floor((size(I2,2)-ncols)/2), ...
      :);
    
    I1=croppedI1;
    I2=croppedI2;
    

    Method 2: Extend the images with zeros until they match

    nrows = max(size(I1,1), size(I2,1));
    ncols = max(size(I1,2), size(I2,2));
    nchannels = size(I1,3);
    
    extendedI1 = [ I1, zeros(size(I1,1), ncols-size(I1,2), nchannels); ...
      zeros(nrows-size(I1,1), ncols, nchannels)];
    
    extendedI2 = [ I2, zeros(size(I2,1), ncols-size(I2,2), nchannels); ...
      zeros(nrows-size(I2,1), ncols, nchannels)];
    
    I1=extendedI1;
    I2=extendedI2;
    

    Method 3: Scale the second image to the size of the first one (which destroys the aspect ratio)

    % Scale the coordinates so that they range from 0 to 1 each.
    [X1, Y1]=meshgrid( linspace(0, 1, size(I1,2)), linspace(0, 1, size(I1,1)));
    [X2, Y2]=meshgrid( linspace(0, 1, size(I2,2)), linspace(0, 1, size(I2,1)));
    nchannels = size(I1,3);
    
    % interpolate each color plane separately
    for k=1:nchannels
      scaledI2(:,:,k)=interp2(X2, Y2, double(I2(:,:,k)), X1, Y1); 
    end
    
    %I1=I1;
    I2=scaledI2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying apply two background images for an entire table row. One background
I'm trying to apply the simplified algorithm in Prolog, but I'm not a Prolog
I am trying to apply some transformations on images using a CGContextRef. I am
I am trying to apply a method to an existing object which involves using
I'm trying to apply a tooltip to a foreach loop, but I need the
I'm trying to apply a custom RGB color to background, but it is not
I am trying to apply this sticky footer pattern to my template: http://ryanfait.com/sticky-footer/ But
I am trying apply blue theme on my spree website but I am unable
I'm trying to apply some CSS to the last .topic-wrapper div (which is inside
Im trying to apply the state pattern on a multi threaded application.The problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.