Rev | Line | |
---|
[37] | 1 | % By Philip Torr 2002
|
---|
| 2 | % copyright Microsoft Corp.
|
---|
| 3 |
|
---|
| 4 | %a function to display the images matches
|
---|
| 5 | %matches, figure, display_numbers
|
---|
| 6 | function f1 = torr_display_matches(matches,display_numbers,f1)
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | if nargin < 2
|
---|
| 11 | display_numbers = 0;
|
---|
| 12 | end
|
---|
| 13 |
|
---|
| 14 | if nargin < 3
|
---|
| 15 | m1 = max(max(matches));
|
---|
| 16 | m2 = min(min(matches));
|
---|
| 17 | m2 = -m2;
|
---|
| 18 | g = max(m1,m2);
|
---|
| 19 | f1 = figure
|
---|
| 20 | axis([-g g -g g])
|
---|
| 21 | else
|
---|
| 22 | figure(f1)
|
---|
| 23 | hold on
|
---|
| 24 | end
|
---|
| 25 |
|
---|
| 26 | x1 = matches(:,1);
|
---|
| 27 | y1 = matches(:,2);
|
---|
| 28 | x2 = matches(:,3);
|
---|
| 29 | y2 = matches(:,4);
|
---|
| 30 |
|
---|
| 31 | u1 = x2 - x1;
|
---|
| 32 | v1 = y2 - y1;
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | plot (matches(:,1), matches(:,2),'r+');
|
---|
| 37 | hold on
|
---|
| 38 | plot (matches(:,3), matches(:,4),'r+');
|
---|
| 39 | if display_numbers
|
---|
| 40 | mat_index1 = 1:length(matches);
|
---|
| 41 | mat_index1 = mat_index1';
|
---|
| 42 | mat_index = num2str(mat_index1);
|
---|
| 43 | text(matches(:,1), matches(:,2),mat_index)
|
---|
| 44 | end
|
---|
| 45 |
|
---|
| 46 | quiver(x1, y1, u1, v1, 0)
|
---|
| 47 | hold off
|
---|
Note: See
TracBrowser
for help on using the repository browser.