drach 发表于 2006-6-8 13:15

求教关于matlab的问题,可能有点专业。。。希望赐教

首先用生成一个象素图,然后用高斯分布算法求出象素点的中心
m=customgauss (,2,4,0,0,1,);
然后进行边缘化
a=fspecial('disk',8)*10000;
b=edge(a,'sobel')
最后进行椭圆拟合
=find(b>0)
        ergebnis=fitellip(x,y)

拟合公式如下:
% fitellip gives the 6 parameter vector of the algebraic circle fit
% to a(1)x^2 + a(2)xy + a(3)y^2 + a(4)x + a(5)y + a = 0
% X & Y are lists of point coordinates and must be column vectors.
function a = fitellip(X,Y)

   % normalize data
   mx = mean;
   my = mean;
   sx = (max-min)/2;
   sy = (max-min)/2;
   x = (X-mx)/sx;
   y = (Y-my)/sy;
   

得到了一组数据
ergebnis =

1.0e+003 *

   -0.0391
0.0000

我想问一下这组数据是什么?另外下一步我要根据这组数据重新建立一个椭圆矩阵,用fspecial或者routine来完成,该如何做?

drach 发表于 2006-6-8 14:31

知道了,这组数据是拟合的椭圆方程的系数,但如何根据这组数据写一个椭圆矩阵呢?

已知这个椭圆方程了,把它转化为矩阵岂不是很简单?。。。。

drach 发表于 2006-6-8 14:52

还有个奇怪的问题,要求用fspecial来重新建立这个椭圆矩阵,可fspecial是一个FILTER阿,怎么用来建立矩阵呢。。
页: [1]
查看完整版本: 求教关于matlab的问题,可能有点专业。。。希望赐教