zikai1 / HGMMEllFit

Robust ellipse fitting, hierarchical Gaussian mixture models (HGMM), outliers, noise.
13 stars 2 forks source link

How to get the result as eyefit #1

Closed xjrelc closed 1 month ago

xjrelc commented 3 years ago

I try like this but the result emmm

f=imread('eye.png'); g=im2bw(f,graythresh(f));%图像二值化 g = edge(g); [r, c] = find(g == 1); rc = [r c]; figure plot(rc(:,1),rc(:,2),'k.'); axis equal; title('Input data points'); %parameter setting N=50; R=10; %start ellipse fitting by HGMM [FittedEllipse]=HGMM_fit(rc,N,R); figure plot(rc(:,1),rc(:,2),'k.'); axis equal; hold on; title("HGMM-ellipse fitting"); [~,~,tx,ty]=gen_elp([FittedEllipse 0 60 0]); plot(tx',ty','r-','Linewidth',2);

zikai1 commented 3 years ago

Hi,   bugua, you need to remove some unrelated edge segments after the edge detection. Could you please let me see your images, i.e., eye.png. Maybe I could find something. 

Best and sincere wishes, Mingyang

------------------ 原始邮件 ------------------ 发件人: "zikai1/HGMMEllFit" @.>; 发送时间: 2021年5月11日(星期二) 下午3:22 @.>; @.***>; 主题: [zikai1/HGMMEllFit] How to get the result as eyefit (#1)

I try like this but the result emmm

f=imread('eye.png'); g=im2bw(f,graythresh(f));%图像二值化 g = edge(g); [r, c] = find(g == 1); rc = [r c]; figure plot(rc(:,1),rc(:,2),'k.'); axis equal; title('Input data points'); %parameter setting N=50; R=10; %start ellipse fitting by HGMM [FittedEllipse]=HGMM_fit(rc,N,R); figure plot(rc(:,1),rc(:,2),'k.'); axis equal; hold on; title("HGMM-ellipse fitting"); [,,tx,ty]=gen_elp([FittedEllipse 0 60 0]); plot(tx',ty','r-','Linewidth',2);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xjrelc commented 3 years ago

I wanna use it to fit a simple shape of ship in pic1,and i think this job may be can used in medical like the pic2 000231_3 insitu7545

zikai1 commented 3 years ago

Hi,   bugua, I can not see the pic1 very clearly. As for the pic2, you may need to increase the pixel number N and the neighborhood radius R. Of course, removing some unrelated edge segments will improve the fitting speed. I will test your images.

Regards, Mingyang.

------------------ 原始邮件 ------------------ 发件人: "zikai1/HGMMEllFit" @.>; 发送时间: 2021年5月12日(星期三) 上午8:47 @.>; @.**@.>; 主题: Re: [zikai1/HGMMEllFit] How to get the result as eyefit (#1)

I wanna use it to fit a simple shape of ship in pic1,and i think this job may be can used in medical like the pic2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

zikai1 commented 1 month ago

If you have no further questions at this time, I will conclude our session. Please feel free to reach out if any additional queries arise in the future.