Home > SaliencyToolbox > winnerToImgCoords.m

winnerToImgCoords

PURPOSE ^

winnerToImgCoords - converts winner location from map to image coordinates.

SYNOPSIS ^

function winImgCo = winnerToImgCoords(winner,params)

DESCRIPTION ^

 winnerToImgCoords - converts winner location from map to image coordinates.

 winImgCo = winnerToImgCoords(winner,salParams)
    Converts the winner location from saliency map coordinates
    to image coordinates, based on the pyramid type and
    the map level specified in salParams.

 See also defaultLevelParams, evolveWTA.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % winnerToImgCoords - converts winner location from map to image coordinates.
0002 %
0003 % winImgCo = winnerToImgCoords(winner,salParams)
0004 %    Converts the winner location from saliency map coordinates
0005 %    to image coordinates, based on the pyramid type and
0006 %    the map level specified in salParams.
0007 %
0008 % See also defaultLevelParams, evolveWTA.
0009 
0010 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2013
0011 % by Dirk B. Walther and the California Institute of Technology.
0012 % See the enclosed LICENSE.TXT document for the license agreement.
0013 % More information about this project is available at:
0014 % http://www.saliencytoolbox.net
0015 
0016 function winImgCo = winnerToImgCoords(winner,params)
0017 
0018 if (params.useRandom)
0019   winner = winner + rand(size(winner));
0020 end
0021 
0022 mLevel = params.levelParams.mapLevel - 1;
0023 switch params.pyramidType
0024   case 'dyadic'
0025     winImgCo = round((winner - 1) * 2^mLevel + 1);
0026   case 'sqrt2'
0027     winImgCo = round((winner - 1) * 2^(mLevel/2) + 1);
0028   otherwise
0029     error(['Unknown pyramidType: ' params.pyramidType]);
0030 end
0031

Generated on Thu 18-Jul-2013 06:10:46 by m2html © 2005