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

  • Home
  • SEARCH
  • 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 8807515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:23:09+00:00 2026-06-14T02:23:09+00:00

I am doing vlfeat in Matlab and I am following this question here .

  • 0

I am doing vlfeat in Matlab and I am following this question here.

These below are my simple testing images:

Left Image:

L

Right Image:

R

I did a simple test with 2 simple images here (the right image is just rotated version of the left), and I got the result accordingly:

test

It works, but I have one more requirement, which is to match the SIFT points of the two images and show them, like this:

likethis

I do understand that vl_ubcmatch returns 2 arrays of matched indices, and it is not a problem to map them for which point goes to which point on two images. However, I am currently stuck in matlab’s procedure. I found this. But that only works if the subplot stays that way. When you add an image into the subplot, the size changes and the normalization failed.

Here is my code: (im and im2 are images. f, d and f2, d2 are frames and descriptors from vl_sift function from 2 images respectively)

    [matches score] = vl_ubcmatch(d,d2,threshold);%threshold originally is 1.5

if (mode >= 2)%verbose 2

    subplot(211);
    imshow(uint8(im));
    hold on;
    plot(f(1,matches(1,:)),f(2,matches(1,:)),'b*');

    subplot(212);
    imshow(uint8(im2));
    hold on;
    plot(f2(1,matches(2,:)),f2(2,matches(2,:)),'g*');

end

if (mode >= 3)%verbose 3

     [xa1 ya1] = ds2nfu(  f(1,matches(1,:)),  f(2,matches(1,:)));
     [xa2 ya2] = ds2nfu( f2(1,matches(2,:)), f2(2,matches(2,:)));

    for k=1:numel(matches(1,:))

        xxa1 = xa1(1, k);
        yya1 = ya1(1, k);
        xxa2 = xa2(1, k);
        yya2 = ya2(1, k);

        annotation('line',[xxa1 xxa2],[yya1 yya2],'color','r');
    end
end

The code above yields this:

an

I think subplot isn’t a good way to go for something like this. Is there a better method for this in Matlab? If possible, I want something like an empty panel that I can draw my image, draw lines freely and zoom freely, just like drawing 2D games in OpenGL style.

  • 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-14T02:23:10+00:00Added an answer on June 14, 2026 at 2:23 am

    From zplesivcak’s suggestion, yes, it is possible, and not that problematic after all. Here is the code:

    %  After we have applied vl_sift with 2 images, we will get frames f,f2, 
    %  and descriptor d,d2 of the images. After that, we can apply it into 
    %  vl_ubcmatch to perform feature matching:
    
    [matches score] = vl_ubcmatch(d,d2,threshold); %threshold originally is 1.5
    
    % check for sizes and take longest width and longest height into
    % account
    if (size(im,1) > size(im2,1))
        longestWidth = size(im,1);       
    else
        longestWidth = size(im2,1);
    end
    
    if (size(im,2) > size(im2,2))
        longestHeight = size(im,2);
    else
        longestHeight = size(im2,2);
    end
    
    
    % create new matrices with longest width and longest height
    newim = uint8(zeros(longestWidth, longestHeight, 3)); %3 cuz image is RGB
    newim2 = uint8(zeros(longestWidth, longestHeight, 3));
    
    % transfer both images to the new matrices respectively.
    newim(1:size(im,1), 1:size(im,2), 1:3) = im;
    newim2(1:size(im2,1), 1:size(im2,2), 1:3) = im2;
    
    % with the same proportion and dimension, we can now show both
    % images. Parts that are not used in the matrices will be black.
    imshow([newim newim2]);
    
    hold on;
    
        X = zeros(2,1);
        Y = zeros(2,1);
    
        % draw line from the matched point in one image to the respective matched point in another image.
        for k=1:numel(matches(1,:))
    
            X(1) = f(1, matches(1, k));
            Y(1) = f(2, matches(1, k));
            X(2) = f2(1, matches(2, k)) + longestHeight; % for placing matched point of 2nd image correctly.
            Y(2) = f2(2, matches(2, k));
    
            line(X,Y);
    
        end
    

    Here is the test case:

    tc

    By modifying the canvas width and height of one of the images from the question, we see that the algorithm above will take care of that and display the image accordingly. Unused area will be black. Furthermore, we see that the algorithm can match the features of two images respectively.

    EDIT:

    Alternatively, suggested by Maurits, for cleaner and better implementation, check out Lowe SIFT matlab wrappers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Doing a search around I've found this kind of question being asked in the
Doing the getting started of Sinatra. I get this error: ./sinatra.rb:5: undefined method `get'
Doing an ajax get request works as expected using the following code: $.ajax({ type:
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
Doing some homework here (second assignment, still extremely green...). The object is to read
Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried:
Doing this: @resp = Net::HTTP.get_response(api.something.com, /feed/v1/offers.json?#{@params_api_string}) I get this response in @resp: #<Net::HTTPOK:0x7f451e9d3ef0> How
Doing this works in IE7: <a href= target=_blank>Link</a> But in IE8 it open a
Doing a code review I've stumbled over GWM in Java-Spring-GWT web-application. As this product

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.