在mean shift中,单位均匀核函数会经常用到。
F
(
x
)
=
{
1
∣
x
∣
<
1
0
∣
x
∣
≥
1
F(x)=\begin{cases} 1 & |x|<1 \\ 0 & |x|\ge 1 \end{cases}
F(x)={10∣x∣<1∣x∣≥1
使用matlab绘制:
R = [1 1];
[x y z] = cylinder(R, 100);
mesh(x,y,z);
hold on;
axis equal;
fill3(x(2,:),y(2,:),z(2,:),'r');
fill3([-2 -2 2 2],[-2 2 2 -2],[0 0 0 0],'b');
view(50,15);//view(az,el)给三维空间图形设置观察点的方位角az与仰角el
效果图: