Prev: testing a dataset
Next: Control points_algoritm
From: michael scheinfeild on 20 Feb 2010 03:52 hi i want to implement fourier descriptor of shape the problem i recive the shape as original when reconstructed and cant have for round corners. if i use rectangle in back reconstruction i recive recuntungle without round corner i use the http://www.tsi.enst.fr/tsi/enseignement/ressources/mti/descript_fourier/Part1.html http://www.tsi.enst.fr/tsi/enseignement/ressources/mti/descript_fourier/Part2.html in case i use for rectangle d=2 , i recive first two points instead recive circle in back reconstruction. i use fft and ifft also i try to use the fftshift here is my function ============================== % image_edged is binary image 1,0 of border % n size of fft function [border_fft,border_restored]=make_fft(image_edged,n) [a,b]=size(image_edged); % finde indexes of edge f=find(image_edged); [ii,jj]=ind2sub(size(image_edged),f); border_cmplx=ii+j*jj; border_fft =(fft(border_cmplx,n)); % i try also fftshift(fft(... ? border_ifft = (ifft(border_fft,n));% i try also length(f) ? f=find(abs(border_ifft)>0.1);% im not sure here .... rifftt=border_ifft(f); border_restored = zeros(size(image_edged)); xx=real(rifftt);yy=imag(rifftt); hind=sub2ind(size(border_restored),round(yy),round(xx));%here do i need the %round border_restored(round(hind))=1; =================== %here is how i call it[m is rectangle] m=zeros(15); m(4:8,4)=1;m(4:8,9)=1; m(4,4:8)=1;m(9,4:9)=1; figure,imshow(m) border_fft,border_restored]=make_fft(m,32);% i try 1,2,4,8 % it behave starnge
|
Pages: 1 Prev: testing a dataset Next: Control points_algoritm |