getpecscores2

PURPOSE ^

PECSCORES2 gets the frequency score for each point.

SYNOPSIS ^

function scores=getpecscores2(angleVector,rangeMatrix,laserDivisor)

DESCRIPTION ^

 PECSCORES2 gets the frequency score for each point.
 
 PECSCORES2 gets the frequency score for each point. The frequency is
 calculated using bins whose size depends of 'laserDivisor'.
 
 INPUTS:
     angleVector: 1xN vector; angleVector lists the angles for the ranges
     in rangeMatrix.
 
     rangeMatrix: MxN array; Each row in rangeMatrix contains a laser scan
     with ranges at the angles specified in angleVector.
 
     laserDivisor: scalar indicating the resolution of the laser at the
     time of capture.
 
 OUTPUTS:
     scores: MxN array with the score for each laser point.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function scores=getpecscores2(angleVector,rangeMatrix,laserDivisor)
0002 % PECSCORES2 gets the frequency score for each point.
0003 %
0004 % PECSCORES2 gets the frequency score for each point. The frequency is
0005 % calculated using bins whose size depends of 'laserDivisor'.
0006 %
0007 % INPUTS:
0008 %     angleVector: 1xN vector; angleVector lists the angles for the ranges
0009 %     in rangeMatrix.
0010 %
0011 %     rangeMatrix: MxN array; Each row in rangeMatrix contains a laser scan
0012 %     with ranges at the angles specified in angleVector.
0013 %
0014 %     laserDivisor: scalar indicating the resolution of the laser at the
0015 %     time of capture.
0016 %
0017 % OUTPUTS:
0018 %     scores: MxN array with the score for each laser point.
0019 
0020 
0021 % pecscores2 gives a score corresponding to the score of range bins
0022 
0023 noscans=size(rangeMatrix,1);
0024 
0025 pre=10/laserDivisor; % m, precision
0026 hx=0:pre:9; % histogram vector
0027 
0028 h=hist(rangeMatrix,hx)./noscans; % normalize
0029 
0030 % get pecularity score number 2
0031 rindcs=round(rangeMatrix./pre)+1;
0032 aindcs=meshgrid(1:length(angleVector),1:noscans);
0033 scores=h(sub2ind(size(h),rindcs,aindcs));
0034 scores=1-scores;

Generated on Thu 08-Apr-2010 14:35:09 by m2html © 2005