Hough Transform source code explanation

2 ビュー (過去 30 日間)
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2017 年 4 月 22 日
回答済み: Walter Roberson 2017 年 4 月 22 日
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

採用された回答

Walter Roberson
Walter Roberson 2017 年 4 月 22 日
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 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by