Boundary Tracking (bwtraceboundary function). m

Source: Internet
Author: User
%11. Boundary tracking (bwtraceboundary function) CLC; Clear I=imread (' e:\role0\003i.bmp '); figure;imshow (i); title (' Original image '); I1=rgb2gray (i)                ; % Convert color image to grayscale image Threshold=graythresh (I1);        % calculates the threshold BW=IM2BW (I1, threshold) required to convert a grayscale image to a two-value image;       % convert grayscale image to two value image Figure imshow (BW); title (' Binary image ');d im=size (BW); Col=round (Dim (2)/2) -90;         % calculates the starting point column coordinates row=find (BW (:, col), 1);          % calculates the starting point line coordinate connectivity=8; Num_points=180;contour=bwtraceboundary (Bw,[row,col], ' N ', connectivity,num_points); % extraction Boundary Figure imshow (I1); hold On;plot (Contour (:, 2), Contour (:, 1), ' G ', ' linewidth ', 2); title (' Boundary tracking image ');

Boundary Tracking (bwtraceboundary function). m

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.