.


:




:

































 

 

 

 





. bwtraceboundary, .

1: . 2: . 3: . 4: . 5: . 6: . 7: . 8: . 9: . 1: . gantrycrane.jpg . . RGB=imread('gantrycrane.png');imshow(RGB);text(size(RGB, 2), size(RGB, 1)+15, 'Image courtesy of Jeff Mather',... 'FontSize', 7, 'HorizontalAlignment', 'right');line([300 328], [85 103], 'color', [1 1 0]);line([268 255], [85 140], 'color', [1 1 0]);text(150, 72, ' ', 'Color', 'y',... 'FontWeight', 'bold');

2: . , , . .

% ,% imviewstart_row=34;start_col=208;cropRGB=RGB(start_row:163, start_col:400,:);imshow(cropRGB)offsetX=start_col-1;offsetY=start_row-1;

3: . . bwtraceboundary.

I=rgb2gray(cropRGB);threshold=graythresh(I);BW=im2bw(I, threshold);BW=~BW; % ( )imshow(BW)

4: . bwtraceboundary . . bwtraceboundary , . dim=size(BW);% col1=4;row1=min(find(BW(:, col1)));% row2=12;col2=min(find(BW(row2,:))); 5: .

bwtraceboundary . . . .

boundary1=bwtraceboundary(BW, [row1, col1], 'N', 8, 70);% - , boundary2=bwtraceboundary(BW, [row2, col2], 'E', 8, 90,'counter');imshow(RGB); hold on;% plot(offsetX+boundary1(:, 2), offsetY+boundary1(:, 1), 'g', 'LineWidth', 2);plot(offsetX+boundary2(:, 2), offsetY+boundary2(:, 1), 'g', 'LineWidth', 2);





:


: 2015-10-01; !; : 523 |


:

:

, , .
==> ...

1873 - | 1505 -


© 2015-2024 lektsii.org - -

: 0.012 .