makeRedGreenPyramid - creates a red-green opponency pyramid [rgPyr,rPyr,gPyr] = makeRedGreenPyramid(image,type) Creates a gaussian pyramid from a red-green opponency map (rgPyr) of image and, if requested, also the separate red (rPyr) and green (gPyr) pyramids. Image - Image structure for the input image. type - 'dyadic' or 'sqrt2' For a dicussion of the particular definitions of color opponency used here, see appendix A.2 of Dirk's PhD thesis: Walther, D. (2006). Interactions of visual attention and object recognition: Computational modeling, algorithms, and psychophysics. Ph.D. thesis. California Institute of Technology. http://resolver.caltech.edu/CaltechETD:etd-03072006-135433. See also makeBlueYellowPyramid, getRGB, makeGaussianPyramid, makeFeaturePyramids, dataStructures.
0001 % makeRedGreenPyramid - creates a red-green opponency pyramid 0002 % 0003 % [rgPyr,rPyr,gPyr] = makeRedGreenPyramid(image,type) 0004 % Creates a gaussian pyramid from a red-green opponency map (rgPyr) 0005 % of image and, if requested, also the separate red (rPyr) 0006 % and green (gPyr) pyramids. 0007 % Image - Image structure for the input image. 0008 % type - 'dyadic' or 'sqrt2' 0009 % 0010 % For a dicussion of the particular definitions of color opponency used here, 0011 % see appendix A.2 of Dirk's PhD thesis: 0012 % Walther, D. (2006). Interactions of visual attention and object recognition: 0013 % Computational modeling, algorithms, and psychophysics. Ph.D. thesis. 0014 % California Institute of Technology. 0015 % http://resolver.caltech.edu/CaltechETD:etd-03072006-135433. 0016 % 0017 % See also makeBlueYellowPyramid, getRGB, makeGaussianPyramid, makeFeaturePyramids, dataStructures. 0018 0019 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2007 0020 % by Dirk B. Walther and the California Institute of Technology. 0021 % See the enclosed LICENSE.TXT document for the license agreement. 0022 % More information about this project is available at: 0023 % http://www.saliencytoolbox.net 0024 0025 function [rgPyr,rPyr,gPyr] = makeRedGreenPyramid(image,type) 0026 0027 declareGlobal; 0028 0029 im = loadImage(image); 0030 [r,g,b,in] = getRGB(im); 0031 0032 rg = safeDivide((r-g),in); 0033 0034 if (nargout >= 1) 0035 map.origImage = image; 0036 map.label = 'Red/Green'; 0037 map.data = rg; 0038 map.date = timeString; 0039 rgPyr = makeGaussianPyramid(map,type); 0040 end 0041 0042 if (nargout >= 2) 0043 map.origImage = image; 0044 map.label = 'Red'; 0045 rr = clamp(rg,0); 0046 map.data = rr; 0047 map.date = timeString; 0048 rPyr = makeGaussianPyramid(map,type); 0049 end 0050 0051 if (nargout >= 3) 0052 map.origImage = image; 0053 map.label = 'Green'; 0054 gg = clamp(-rg,0); 0055 map.data = gg; 0056 map.date = timeString; 0057 gPyr = makeGaussianPyramid(map,type); 0058 end