필터 지우기
필터 지우기

How to code this in matlab

조회 수: 1 (최근 30일)
Poonam
Poonam 2013년 3월 26일
Given-Seed which is selected as initial seed is centre pixel of an RGB image
For grow formula we use intensity based similarity between seed and 8 neighbour pixels of the seed
The similarity index between two neighbourhood pixels of RGB intensities (x,y) and (x+i,y+j)is given by
Dist=sqrt(Dr+Dg+Db);
where
Dr=((f(x+i,y+j,1)-f(x,y,1))^2
Dg=((f(x+i,y+j,2)-f(x,y,2))^2
Db=((f(x+i,y+j,3)-f(x,y,3))^2
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2013년 3월 26일
What have you done so far?
Poonam
Poonam 2013년 3월 26일
This is what i have done for HSV image
function d=dist(f,seed,cp8)
r=rgb2hsv(f);
[m,n]=size(r);
seed=[m/2,n/2];
Dh=(r(x+i,y+j,1)-r(x,y,1)).^2;
Ds=(r(x+i,y+j,2)-r(x,y,2)).^2;
Dv=(r(x+i,y+j,3)-r(x,y,3)).^2;
d=sqrt(Dh+Ds+Dv);

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2013년 3월 26일
Calculate delta E as in my demo http://www.mathworks.com/matlabcentral/fileexchange/31118-color-segmentation-by-delta-e-color-difference. Basically that's the color difference.
Does the value of the seed change from pixel to pixel (difficult), or is it always going to be the color that you selected as the first seed point (very easy)?
  댓글 수: 2
Poonam
Poonam 2013년 3월 26일
seed point is going to be always the color which was selected as first seed point
Image Analyst
Image Analyst 2013년 3월 26일
Then my delta E app is exactly what you want. Download it and run it. If you want, you can replace imfreehand() with ginput(1) so that you pick a single pixel rather than outlining a region.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by