How to find minimum and maximum values of the motion blur angle from cepstrum and Initialize the accumulator array?
Show older comments
This is the algorithm i followed to estimate angle from hough transform but, im not getting the proper result as shown in reference
(input=lena image) reference output for length=10 and theta=60.
(input=lena image) reference output for length=10 and theta=60.Algorithm:
1. Convert blurred RGB image ( ) to gray level image ( ).
2. Perform Hann windowing over the image to remove boundary artefacts.
3. Compute the Fourier transform F(u, v) of step2 image.
4. Compute the log spectrum of F(u,v).
5. Compute the inverse Fourier transform of log spectrum.
6. Find the edge map of the cepstral of step 5.
7. Let α min and the α max be the minimum and maximum values of the motion blur angle.
8. Initialize the accumulator array A(r,α) to zero.
9. Repeat for each edge point (xi, yi)
Repeat for α = αmin to αmax
{
r = xi cos α + yi sin α
A(r,α) = A(r,α) + 1
α = α +1
}
10. Find the peak in Hough transform (the maximum value in accumulator array) which is perpendicular to the motion blur angle.
Code:
img = rgb2gray( imread('C:\Users\OneDrive\Desktop\lena.png'));
theSpectrum = abs(fftshift(fft2(img)));
Cepstrumm = MakeCepstrum ( img );
[H,T,R] = hough(Cepstrumm);
imshow(imadjust(mat2gray(H)), [], 'XData',T, 'YData',R, ...
'InitialMagnification','fit')
xlabel('\theta (degrees)'), ylabel('\rho')
axis on, axis normal, hold on
colormap(hot), colorbar
kindly help me to plot the same. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Cepstral Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!