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).
|
| update_pheromones(G, matchings, costs) |
%
% This function updates the pheromone matrix according to a set of
% matchings and their costs
%
% Input -
% - G: bipartite graph containing pheromone levels: G(i,j) denotes the
% level of pheromone on the edge between vertex i on the first
% contour/set and vertex j on the second contour/set
% - matchings: a set of matchings: matchings(i, j) represents the
% matching of the second contour/set of vertex i on the first contour.
% j is the index of the matching
% - costs: cost of each matching: cost(1, j) represents the cost of
% matching j
%
% Output -
% - Gout: the new pheromone matrix
%
function Gout = update_pheromones(G, matchings, costs)
%
% Copyright (c) 2007 Oliver van Kaick <ovankaic@cs.sfu.ca>
%
% Get global variables
global pheromone_persistency;
global pheromone_deposit;
global minimum_pheromone;
% Get contour size
n1 = size(G, 1);
% Evaporate pheromone
G = G * pheromone_persistency;
% Deposit new pheromone
for ant = 1:size(costs, 2)
pheromone_delta = pheromone_deposit/costs(1, ant);
indices = sub2ind(size(G), 1:size(matchings, 1), matchings(:,ant)');
G(indices) = G(indices) + pheromone_delta;
end
% Control minimum level of pheromone
G(G < (minimum_pheromone/n1)) = (minimum_pheromone/n1);
% Return modified graph
Gout = G;
|
|
Contact us at files@mathworks.com