Creates multiple, slightly jittered versions of an image. Takes an image I, and generates a number of images that are copies of the original image with slight translation and rotation applied. The original image also appears in the final set. The parameter jsiz controls the size of the cropped images. If jsiz gives a size that's substantially smaller than I then all data in the the final set will come from I. However, if this is not the case then I may need to be padded first. The way this is done is with padarray with the 'replicate' method. If jsiz is not specified, it is set to be the size of the original image. A warning appears if the image needs to be grown. Rotations and translations are specified by giving a range and a maximum value for each. For example, if maxphi=10 and nphis=5, then the actual rotations applied are [-10 -5 0 5 10]. Uses: linspace( -maxphi, maxphi, nphis ); Likewise if maxtrans=3 and ntrans=3 then the translations are [-3 0 3]. Each translation is applied in the x direction as well as the y direction. Each combination of rotation, translation in x, and translation in y is used (for example phi=5, transx=-3, transy=0), so the total number of images generated is R=ntrans*ntrans*nphis). This function works faster if all of the translation end up being integer valued. If the input image is actually a MxNxK stack of images then applies op to each image in stack and returns an MxNxKxR where R=(ntrans*ntrans*nphis) set of images. USAGE function IJ = jitterImage( I, nphis, maxphi, ntrans, maxtrans, ... [jsiz], [reflFlag], [scales] ) INPUTS I - BW image (MxN) or images (MxNxK), must have odd dims nphis - number of rotations maxphis - max value for rotation ntrans - number of translations maxtrans - max value for translation jsiz - [] Final size of each image in IJ reflFlag - [0] if true then also adds reflection of each image scales - [1 1] nscalesx2 array of vert/horiz scalings OUTPUTS IJ - MxNxR or MxNxKxR set of images where R=(ntrans*ntrans*nphis*nscales) EXAMPLE load trees; I=imresize(ind2gray(X,map),[41 41]); clear X caption map % creates 7^2*2 images of slight trans with reflection (but no rotation) IJ = jitterImage( I, 0, 0, 7, 3, [35 35], 1 ); montage2(IJ); % creates 5 images of slight rotations (no translations) IJ = jitterImage( I, 5, 25, 0, 0, size(I) ); montage2(IJ); % creates 45 images of both rot and slight trans IJ = jitterImage( I, 5, 10, 3, 2 ); montage2(IJ); % additionally create multiple scaled versions IJ = jitterImage( I, 1, 0, 1, 0, [], [], [1 1; 2 1; 1 2; 2 2] ); montage2(IJ) See also JITTERVIDEO Piotr's Image&Video Toolbox Version 2.0 Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] Please email me if you find bugs, or have suggestions or questions! Licensed under the Lesser GPL [see external/lgpl.txt]