Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
dot-tracking-package/estimate_effective_dot_diameter.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
18 lines (14 sloc)
713 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function d_p = estimate_effective_dot_diameter(X, Y, D, x_p, y_p, d_default) | |
% This function estimates the effective diameter of a dot in the image | |
% using the diameter of the correlation plane | |
% INPUTS: | |
% X, Y - X and Y location of vectors from correlation [pix.] | |
% D - Diameter of the correlation peak [pix.] | |
% x_p, y_p - dot locations in the image (can be approximate) [pix.] | |
% d_default - default diameter to be assigned in case the interpolation | |
% fails [pix.] | |
% estimate dot diameter from correlation peak by interpolation | |
d_p = 1/sqrt(2) * interp2(X, Y, D, x_p, y_p, 'spline'); | |
% set nan elements to be the default diameter specified by the user | |
d_p(isnan(d_p)) = d_default; | |
end |