Info

This question is locked. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

the 2d convolution result dosen't match my expectation

조회 수: 37 (최근 30일)
MatLaBGuYSomewhere
MatLaBGuYSomewhere 2018년 10월 26일
Locked: Rena Berman 2025년 10월 24일 11:25
%i
x = 1:317;
y = 1:317;
[xx,yy] = meshgrid(x,y);
z = (xx-158.5).^2+(yy-158.5).^2;
circle = zeros(317,317);
for i = 1:317
for j = 1: 317
if z(j,i) < 158.5^2
circle(j,i) = 1;
end
end
end
c = conv2(circle,circle);
c = c./max(c);
imshow(c)
I use simple code, simple object. However the result isn't correct.
Why did this result come out?
p.s. The second image is square and square case.
  댓글 수: 1
Rena Berman
Rena Berman 2025년 10월 23일 18:33
(Answers Dev) Restored question with images as attachments

채택된 답변

Bruno Luong
Bruno Luong 2018년 10월 26일
편집: Bruno Luong 2018년 10월 26일
Not sure what is your expectation, and intention but shooting on the dark, try to replace
c = c./max(c);
with
c = c./max(c(:));
  댓글 수: 1
Bruno Luong
Bruno Luong 2018년 10월 26일
Please accept the answer if it resolves your question. Thanks

추가 답변 (0개)

This question is locked.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by