| 
 | 
 
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册 
 
 
 
×
 
首先用生成一个象素图,然后用高斯分布算法求出象素点的中心 
m=customgauss ([50,50],2,4,0,0,1,[5,10]); 
然后进行边缘化 
a=fspecial('disk',8)*10000; 
b=edge(a,'sobel') 
最后进行椭圆拟合 
[x,y]=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来重新建立这个椭圆矩阵,可fspecial是一个FILTER阿,怎么用来建立矩阵呢。。 
 
[ 本帖最后由 eisenstange 于 2006-12-8 15:49 编辑 ] |   
 
 
 
 |