필터 지우기
필터 지우기

How to call a function and show output of an image

조회 수: 1 (최근 30일)
Ntiranyibagira Lionel
Ntiranyibagira Lionel 2019년 10월 9일
I am trying to learn Hough transform for circle. How can I read an image and use the written function (call the function) to finally display the output? Here is the code
%Hough Transform for Circles
function acc = houghcircle1(inputimage)
%image size
[rows,columns]=size(inputimage);
%accumulator
acc=zeros(rows,columns);
%image
for x=1:columns
for y=1:rows
if(inputimage(y,x)==0)
for ang=0:360
t=(ang*pi)/180;
x0=round(x-a*cos(t));
y0=round(y-r*sin(t));
if(x00 && y00)
acc(y0,x0)=acc(y0,x0)+1;
end
end
end
end
end
end
I tried to read an image I have in my directory and call the function but cannot display the output to see if the code work.
I=imread('screw.jpg');
houghcircle1(I)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by