Hausdorff distance-distance measurement between curve/point set

Source: Internet
Author: User







With the modified version of the code, not improved version as long as the change is.

function [MHD] = Modhausdorffdist (A, B)% A, point set 1%-B, point set 2% No.  of samples of each point set May is different but the dimension of% the points must is the same.% Compute the sizes of the Input point setsasize = size (A); bsize = size (B);% Check If the points has the same dimensionsif asize (2) ~= bsize (2) error (' The dimensions of points I                    n the sets is not equal '); end% calculating the forward HDFHD = 0;          % Initialize forward distance to 0for a = 1:asize (1)% travel the set a to find Avg of D (A, b) mindist = INF; % Initialize minimum distance to Inf for b = 1:bsize (1)% travel Set B to find the Min (d (b)) TEM        Pdist = Norm (A (a,:) B (B,:));        If tempdist < mindist mindist = tempdist;    End End FHD = FHD + mindist;         % Sum The forward DISTANCESENDFHD = fhd/asize (1);                    % Divide by the total no to get average% calculating the reverse HDRHD = 0; % Initialize reverse distance to 0for B = 1:bsize (1)% travel the set B to find Avg of D (b,a) mindist = INF; % Initialize minimum distance to Inf for a = 1:asize (1)% travel set A to find the Min (d (b,a)) Tempdist = n        ORM (A (a,:)-B (B,:));        If tempdist < mindist mindist = tempdist;    End end RHD = RHD + mindist;         % Sum the reverse DISTANCESENDRHD = rhd/bsize (1); % Divide by the total No.         To get AVERAGEMHD = max (FHD,RHD); % Find the minimum of FHD/RHD as% the MoD Hausdorff distend



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Hausdorff distance-distance measurement between curve/point set

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.