Re: [問題] 高斯二次微分圖
我已經解決了
我附上檔案,大家可以討論討論
clear all;
close all;
syms x y s;
G = @(x,y,s) 1/(2*pi*s^2)*exp(-(x^2+y^2)/(2*s^2));
s1=11;
x1=-40:1:40;
y1=-40:1:40;
figure(1);
colormap('Gray')
g1=diff(diff(G(x,y,s1),y),y);
[X1,Y1]=meshgrid(x1,y1);
Z1=subs(g1,{x y},{X1 Y1});
X1=X1+40;
Y1=Y1+40;
surf(X1,Y1,Z1);
axis([0 80 0 80 -inf inf]);
figure(2);
colormap('Gray')
brighten(-0.5);
pcolor(X1,Y1,Z1);
figure(3);
colormap('Gray')
g1=diff(diff(G(x,y,s1),x),x);
[X2,Y2]=meshgrid(x1,y1);
Z2=subs(g1,{x y},{X2 Y2});
X2=X2+40;
Y2=Y2+40;
surf(X2,Y2,Z2);
axis([0 80 0 80 -inf inf]);
figure(4);
colormap('Gray')
brighten(-0.5);
pcolor(X2,Y2,Z2);
figure(5);
colormap('Gray')
g1=diff(diff(G(x,y,s1),x),y);
[X3,Y3]=meshgrid(x1,y1);
Z3=1*(subs(g1,{x y},{X3 Y3}));
X3=X3+40;
Y3=Y3+40;
surf(X3,Y3,Z3);
axis([0 80 0 80 -inf inf]);
figure(6);
colormap('Gray')
brighten(-0.4);
pcolor(X3,Y3,Z3);
figure(7);
colormap('Gray')
brighten(-0.4);
subplot(231);
surf(X1,Y1,Z1);
axis([0 80 0 80 -inf inf]);
subplot(232);
surf(X2,Y2,Z2);
axis([0 80 0 80 -inf inf]);
subplot(233);
surf(X3,Y3,Z3);
axis([0 80 0 80 -inf inf]);
subplot(234);
pcolor(X1,Y1,Z1);
axis off;
subplot(235);
pcolor(X2,Y2,Z2);
axis off;
subplot(236);
pcolor(X3,Y3,-1*Z3);
axis off;
※ 引述《Marlee (Mar)》之銘言:
: 我想畫出高斯二次微分的圖
: 就像這個http://ppt.cc/EPXm
: 確不知道該如何下手
: 所以上來問問
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.117.95.130
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):