rods and disk image

조회 수: 4 (최근 30일)
Hasan alomari
Hasan alomari 2013년 12월 30일
편집: Image Analyst 2013년 12월 31일
I have an image of rods and disk and i need to suppurate the rods only using morphological processing i need the mean steps only

채택된 답변

Image Analyst
Image Analyst 2013년 12월 30일
You forgot to post your image. I don't know how you define "mean steps". Please explain.
If the image looks like what I'm imagining, something like pencils and coins, or this:
Then I'd threshold and call regionprops and look at the ratio of the major to minor axis. If the ratio is high, it's a rod. If the ratio is less than about 2, it's a disc.
  댓글 수: 3
Image Analyst
Image Analyst 2013년 12월 30일
I'd look for objects with a solidity close to 1 and a major to minor axis ratio close to 1. That will be the circles. Everything else will be rods or rod/disc overlap.
Hasan alomari
Hasan alomari 2013년 12월 31일
편집: Image Analyst 2013년 12월 31일
make opening with disk the subtract it from the original image, like this
I=imread('Untitled.jpg');
I=I(:,:,1);
str= strel('disk',4);
Im=imopen(I,str);
rotI = imrotate(Im,33,'crop');
BW = edge(rotI,'canny');
[H,T,R] = hough(BW);
P = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));
lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);
str2=strel('line',3, 10);
im=I-Im;
im2=imclose(im,str2);
imshow(im2)

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by