高斯法求像素中心及椭圆拟合
首先用生成一个象素图,然后用高斯分布算法求出象素点的中心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来重新建立这个椭圆矩阵,可fspecial是一个FILTER阿,怎么用来建立矩阵呢。。
[ 本帖最后由 eisenstange 于 2006-12-8 15:49 编辑 ]
页:
[1]