在图像中检测椭圆的M代码

[i1,map1] = imread('J:/ep_image/im1.jpg');
imshow(im1)
imshow(i1)
colormap(map1);
image(i1)
axis equal;
g1 = rgb2gray(i1);
BW = edge(g1,'sobel');
[r,l]=find(BW==1);
plot(r,l,'r+')
image(i1)
hold on;plot(l,185-r,'r+')
figure;imshow(BW)
figure;image(BW)
image(i1)
hold on;image(BW)
image(i1)
hold on;plot(l,r,'r+')
Data = cat(2,l,r);
size(Data)
Parameter = [4 0 1 -8 -2 1]';est_reslt=LMedS(Parameter,Data,5,1555,2000)
f = est_reslt.theta;
[lat,lon]=plotconic(f);
plot(lat,lon,'b');

你可能感兴趣的:(image,process)