0

I am trying to display sift keypoints from 4 concurrent video frames onto one image. I have been able to determine the keypoints of each image however would like to display all of these sets of keypoints on the last image instead of 4 separate images in order to track the movement of the Truck that is being displayed. The code I have written is as follows:

I1 = imread('6.jpg');     
g = rgb2gray(I1);    
imwrite(g, '10.png','PNG');    
[I1, D, L] = sift('C:\Users\Xaiver\Documents\MATLAB\10.png');    
showkeys(I1, L)    
I2 = imread('7.jpg');    
g = rgb2gray(I2);    
imwrite(g, '11.png','PNG');    
[I2, D, L] = sift('C:\Users\Xaiver\Documents\MATLAB\11.png');    
showkeys(I2, L)    
I3 = imread('8.jpg');    
g = rgb2gray(I3);    
imwrite(g, '12.png','PNG');    
[I3, D, L] = sift('C:\Users\Xaiver\Documents\MATLAB\12.png');    
showkeys(I3, L)    
I4 = imread('9.jpg');    
g = rgb2gray(I4);    
imwrite(g, '13.png','PNG');    
[I4, D, L] = sift('C:\Users\Xaiver\Documents\MATLAB\13.png');    
showkeys(I4, L)

How do I get SIFT Keypoints from Images I1,I2,I3, & I4 displayed only on image I4?

Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104
  • Please don't use all-caps titles and format your questions. I've done so for you now. Have a look at the difference. – Bart May 24 '12 at 02:40
  • haha thanks! sorry guys, no shouting intended. – user1413957 May 24 '12 at 02:42
  • I think you'll have to open the source of showkeys() and fiddle with it yourself. Look in the matlab docs for 'figure' and 'hold on' in particular. – Alex May 24 '12 at 03:22
  • Hello all... I finally figured it out. I had to edit the showkeys() function and my code. Thanks. – user1413957 May 25 '12 at 04:03

1 Answers1

0

Well, I have no idea on how showkeys procedure works, since you didn't supply the code, but something tells me that you can use hold on between calls and it will work:

[I1, D, L1] = sift('C:\Users\Xaiver\Documents\MATLAB\10.png');
[I2, D, L2] = sift('C:\Users\Xaiver\Documents\MATLAB\11.png');
[I3, D, L3] = sift('C:\Users\Xaiver\Documents\MATLAB\12.png');
[I4, D, L4] = sift('C:\Users\Xaiver\Documents\MATLAB\13.png');
showkeys(I1, L1);
hold on;
showkeys(I2, L1);
showkeys(I3, L1);
showkeys(I4, L1);
Andrey Rubshtein
  • 20,795
  • 11
  • 69
  • 104
  • Andrey, the suggestion you made doesnt work. The closest I have able to get is to write: showkeys(I4, L) showkeys(I4, M) showkeys(I4, N) showkeys(I4, O) This gives each of the key points from the images displayed only on image I4 however, it brings up 4 separate images of I4 with keypoints, not just one single image with all the points displayed at one time. Let me know if you have any other suggestions. Thanks! – user1413957 May 24 '12 at 16:22
  • showkeys(image, locs) This function displays an image with SIFT keypoints overlayed. Input parameters: image: the file name for the image (grayscale) locs: matrix in which each row gives a keypoint location (row, column, scale, orientation – user1413957 May 24 '12 at 16:44