Info

This question is locked. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

the 2d convolution result dosen't match my expectation

25 Ansichten (letzte 30 Tage)
MatLaBGuYSomewhere
MatLaBGuYSomewhere am 26 Okt. 2018
Locked: Rena Berman am 24 Okt. 2025 um 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 Kommentar
Rena Berman
Rena Berman am 23 Okt. 2025 um 18:33
(Answers Dev) Restored question with images as attachments

Akzeptierte Antwort

Bruno Luong
Bruno Luong am 26 Okt. 2018
Bearbeitet: Bruno Luong am 26 Okt. 2018
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 Kommentar
Bruno Luong
Bruno Luong am 26 Okt. 2018
Please accept the answer if it resolves your question. Thanks

Weitere Antworten (0)

This question is locked.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by