Code covered by the BSD License
-
[BH,mean_dist]=sc_compute(Bsa...
[BH,mean_dist]=sc_compute(Bsamp,Tsamp,mean_dist,nbins_theta,nbins_r,r_inner,r_outer,out_vec);
-
[C,T]=hungarian(A)
% HUNGARIAN Solve the Assignment problem using the Hungarian method.
-
aco_matching(Y1, Y2, Dist1, D...
% Compute a matching between two shapes using the ACO algorithm
-
area_normalize(old_c)
% This function normalizes the area enclosed by a closed 2D contour
-
bipartite_matching(Y1, Y2, S)
% Compute the bipartite matching between two shapes according to the
-
construct_matching(G, S, Dist...
% This function constructs a matching for the ACO algorithm
-
contour_area(c)
% This function computes the area enclosed by a closed 2D contour.
-
contour_length(X)
% This function computes the length of a contour
-
dist2(x, c)
DIST2 Calculates squared distance between two sets of points.
-
distance_matrix(Y)
% Compute the pairwise distances between vertices/points of a 2D shape
-
evaluate_matching(G, S, Dist1...
% This function computes the cost for a given matching
-
extract_descriptor(Y, descrip...
% Compute a shape descriptor for a given shape
-
extract_shape_context(Y)
% Compute shape context descriptor
-
order_preserving_matching(Y1,...
% Compute an order preserving matching between two shapes according to
-
pairwise_geodesic_dist(Y, ope...
% Compute pairwise geodesic distances for an open or closed 2D contour
-
shape_matching(Y1, Y2, vararg...
% Compute the matching between two 2D shapes (contours or general sets
-
show_contour(c, varargin)
% This function plots a contour specified by a list of 2D points
-
signed_triangle_area(A, B, C)
% This function returns the *signed* area of a triangle
-
simmat_chisquare(g1, g2)
% This function returns a similarity matrix for two sets of
-
simmat_euclidean(g1, g2)
% This function returns a similarity matrix for two sets of
-
update_pheromones(G, matching...
% This function updates the pheromone matrix according to a set of
-
valid_range(vertex, matching,...
% This function computes the range of valid assignments for a vertex,
-
viz_matching(Y1, Y2, K, varar...
% This function uses numerical labelling to show the correspondence
-
set_global.m
-
View all files
from
Contour Correspondence via Ant Colony Optimization
by Oliver van Kaick
Computes a correspondence between two shapes based on ant colony optimization (ACO).
|
| valid_range(vertex, matching, n2) |
%
% This function computes the range of valid assignments for a vertex,
% according to order preservation.
%
% Input -
% - vertex: index of vertex on first contour that should be matched to
% vertices on the second contour
% - matching: matching that has been computed so far: vertices that
% are still unassigned are matched to 0
% - n2: size of second contour
%
% Output -
% - inrange: array of valid ranges: inrange(i) is 1 if vertex i of the
% second contour is in the valid range of assignments for vertex
%
function inrange = valid_range(vertex, matching, n2)
%
% Copyright (c) 2007 Oliver van Kaick <ovankaic@cs.sfu.ca>
%
% Get first contour size
n1 = size(matching, 1);
% Init valid range
inrange = zeros(n2, 1);
% Find left vertex
left_vertex = find(matching(1:(vertex-1)), 1, 'last');
% If not found, loop around
if isempty(left_vertex)
left_vertex = find(matching((vertex+1):n1), 1, 'last');
left_vertex = vertex + left_vertex;
end
% Find right vertex
right_vertex = find(matching((vertex+1):n1), 1, 'first');
% If not found, loop around
if isempty(right_vertex)
right_vertex = find(matching(1:(vertex-1)), 1, 'first');
else
% Get actual position on the vector
right_vertex = vertex + right_vertex;
end
% Find corresponding vertices
left_vertex = matching(left_vertex);
right_vertex = matching(right_vertex);
% Create vector with valid range information
if left_vertex == right_vertex
inrange(left_vertex) = 1;
elseif left_vertex < right_vertex
% A standard inverval
inrange((left_vertex+1):right_vertex) = 1;
else
% A broken interval (contains the origin of the contour)
inrange((left_vertex+1):n2) = 1;
inrange(1:right_vertex) = 1;
end
|
|
Contact us at files@mathworks.com