function [ corr ] = pointmatchfun( points, labels, maxpoints )
%  this function is to calculate the point match correspondance

% get the points number and labels number
[points_num point_colomn] = size(points);
[label_num label_colomn] = size(labels);
%%   get the A matrix
[size_u col_u] = size(points);
[size_v col_v] = size(labels);
size_A = size_u * size_v;
A = zeros(size_A,size_A);
for i = 1 : size_u
    for j = 1 : size_v
        for m = 1 : size_u
            for n = 1 : size_v
                A((i-1)*size_v+j,(m-1)*size_v+n) = pairValue(points(i,:),points(m,:),labels(j,:),labels(n,:));
            end
        end
    end
end
for i = 1 : size_A
    A(i,i) = 0;
end
%% end of calculate A

%% use the iterator method to get the good result
corr = zeros(size_u,1);

X = (1/size_A)* ones(size_A,1);

X = iterGetX(A,X);

corr = GetPair( X, corr,points_num, label_num, maxpoints)
corr = corr';
end

