PREVAILING_ORIENTATION-determinetheprevailingorientation(strongestorientedsinwavesignal)ofanimage[THETA,IM_OUT]=PREVAILING_ORIENTATION(IM)Performsa2DfouriertransformontheimageIMandidentifiestheprevailingimageorientationbyfindingthepeaknon-DCsinusoidalcomponent.THETAistheorientationinradians.Thisfunctionwilllikelyworkpoorlyondatathatisnotasimplesinusoidorthatlacksadominantsinusoid.If2outputargumentsarespecified,arotatedversionoftheimageisreturnedusingIMROTATEandbilinearinterpolation.Developer's note: this function takes the peak in the 2-d fourier space as evidence ofthephase.Thisresultsinasmallerrorforsomelowspatialfrequencies.Thefunctioncouldbeimproved.Seealso:FFT2,IMROTATEExample:[x,y]=meshgrid([-100:100],[-100:100]);im=sin(0.3*x+0.1*y);[theta,im_out]=vlt.image.prevailing_orientation(im);figure;subplot(2,2,1);imagesc(im);subplot(2,2,2);imagesc(im_out);