Rev | Line | |
---|
[37] | 1 | % By Philip Torr 2002
|
---|
| 2 | % copyright Microsoft Corp.
|
---|
| 3 | %% to test the Harris corner detector
|
---|
| 4 | %torr_cor_script.m
|
---|
| 5 |
|
---|
| 6 | %clear all
|
---|
| 7 | %profile on
|
---|
| 8 | figure
|
---|
| 9 | i1 = imread('j1.bmp','bmp');
|
---|
| 10 | %imshow(i1)
|
---|
| 11 | if length(size(i1)) == 3
|
---|
| 12 | g1 = rgb2gray(i1);
|
---|
| 13 | else
|
---|
| 14 | g1 = i1;
|
---|
| 15 | end
|
---|
| 16 | %imshow(g1);
|
---|
| 17 | d1 = double(g1);
|
---|
| 18 |
|
---|
| 19 | ncorners = 500
|
---|
| 20 | width = 4
|
---|
| 21 | sigma = 1
|
---|
| 22 | subpixel = 0
|
---|
| 23 |
|
---|
| 24 | [ccr1] = torr_charris(d1, ncorners, width, sigma, subpixel);
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | %imshow(c1);
|
---|
| 28 | %figure;
|
---|
| 29 | imshow(g1);
|
---|
| 30 | %display corners
|
---|
| 31 | hold on
|
---|
| 32 | % plot(c_col, c_row, '+');
|
---|
| 33 | plot(ccr1(:,1), ccr1(:,2), 'g+');
|
---|
| 34 | % plot(ccr2(:,1), ccr2(:,2), 'r+');
|
---|
| 35 | hold off
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 | %figure;
|
---|
| 39 | %imshow(c1);
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | %i2 = imread('msr2.bmp','bmp');
|
---|
| 43 | %g2 = rgb2gray(i2);
|
---|
| 44 | %d2 = double(g2);
|
---|
| 45 | %[c2,ccr2, c_patches2] = iharris(d2,500);
|
---|
| 46 |
|
---|
| 47 | %matches12 = corn_matcher(c_patches1, c_patches2, ccr1, ccr2);
|
---|
| 48 |
|
---|
| 49 | %[x,y] = showcorners(c,20);
|
---|
| 50 | %hold on;
|
---|
| 51 | %plot(x,y,'sw');
|
---|
| 52 | %x
|
---|
| 53 | %y
|
---|
| 54 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.