필터 지우기
필터 지우기

Hough Transform source code explanation

조회 수: 1 (최근 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개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by