Hough Transform source code explanation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ba Ba Black Sheep!
el 22 de Abr. de 2017
Respondida: Walter Roberson
el 22 de Abr. de 2017
I couldn't understand the following code's for loop.
What is the purpose of the for loop here?
Why is for iterating from 7 to 7?
And, why is num_peak = 3?
clc
close all
clear all
imageCaption = sprintf('scratchedImage.jpg');
inputOriginalImage = imread(imageCaption);
inputOriginalImageGrayscale = rgb2gray(inputOriginalImage);
completelyPreprocessedImage = Preprocessing( inputOriginalImage );
N = 12;
bandpassFilteredImage = BandpassFiltering(completelyPreprocessedImage, N);
[ROWS, COLS, k] = size(bandpassFilteredImage);
homomorphicFilteredImage = HomomorphicFiltering(bandpassFilteredImage, N);
num_peak=3;
length_line=[];
for n=7:7
inputImageForHaughtTransform = bwareaopen( homomorphicFilteredImage(:,:,n),20);
[houghtTransformMatrix, theta, rho] = hough(inputImageForHaughtTransform);
imshow(houghtTransformMatrix,[],'XData',theta,
'YData',rho,'InitialMagnification','fit');
xlabel('\theta'), ylabel('\rho');
axis on, axis normal, hold on;
peaks = houghpeaks(houghtTransformMatrix,3,'threshold',
ceil(0.3*max(houghtTransformMatrix(:))));
x = theta(peaks(:,2));
y = rho(peaks(:,1));
plot(x,y,'s','color','white');
foundLinesInHoughOperation = houghlines(inputImageForHaughtTransform,
theta, rho, peaks,'FillGap',
5,'MinLength',7);
figure, imshow(completelyPreprocessedImage), hold on
MarkLines(foundLinesInHoughOperation, COLS, x, y);
end
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Abr. de 2017
We do not know. The routines Preprocessing(), BandpassFiltering(), and HomomorphicFiltering() are not Mathworks routines, and they do not appear to be anywhere in a File Exchange contribution either. We do not know what they do.
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!