gusucode.com > KLT Tracking源码程序matlab > InsidePolygon.m

    function [Inside] = InsidePolygon(polygon, pt)
% directory in which the C++ tracked feature list are stored
polygon=5;
pt=8;
dir = '.\Walk1\';
% directory in which the pgm format frame images are stored
dir2 = '.\Walk1Frames\';

% the file name of frame image as well as feature list
% It is assumed the file name format will be
%         [fileStart1 num2str(frameNum) '.txt'] for feature list
%         [fileStart1 num2str(frameNum) '.pgm'] for frame image
fileStart1 = 'Walk1Frame';

% the spread of the ellipse on the start frame
h = [71 71];
% the center location of ellipse on the start frame
y = [268 227];
% orientation of the ellipse
angle = 0;

% the frame sequence to use
startFrame = 260;
endFrame = 354;

% KLT feature tollerance, all feature values less than TOL are ignored
TOL = 945;

% the time window in which to check if no motion occurs in the KLT feature
% If there are no motion for TIME_WINDOW frames then the feature point is
% omitted from the feature points being tracked.
TIME_WINDOW = 7;

SHOW_FIG = 1;
Inside = 0.4869;