필터 지우기
필터 지우기

Hi for the past 2 days i am working on a code to get a binary image of my rice samples through edge detection technique.I have used Sobel and Canny but the problem that i face is that at some points the edges are not that sharp kindly help me.

조회 수: 2 (최근 30일)
Hi for the past 2 days i am working on a code to get a binary image of my rice samples through edge detection technique.I have used Sobel and Canny but the problem that i face is that while using canny filter as it provide a better result over Sobel, at some points the edges are not that sharp and due to that some grains are missing in the final binary image kindly help me. Result that i get

채택된 답변

Matt J
Matt J 2018년 1월 31일
편집: Matt J 2018년 1월 31일
This seems to work
A=double(rgb2gray(imread('ricesam6.jpg'))); A=A/max(A(:));
B=imtophat((entropyfilt(A,ones(11))) ,strel('disk',21));
C=(medfilt2(double(B>.8),[1,1]*11));
result=bwpropfilt(C>0,'MajorAxisLength',[120,inf]);
  댓글 수: 4
Matt J
Matt J 2018년 2월 25일
You're welcome, but please click "Accept" to certify that it solved your problem.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by