Sizing of Poly Objects in an Image

조회 수: 1 (최근 30일)
Murat Kocaman
Murat Kocaman 2018년 3월 1일
이동: DGM 2023년 2월 13일
Hello,
I was trying to measure the length and width of the each objects seen below image. I could have the each objefct seperately but is there a way to measure the length and size each object at the same code? Each red circled part are the objects and I would like to measure the length and width at the same code.

채택된 답변

Image Analyst
Image Analyst 2018년 3월 5일
Try
  1. taking the red channel.
  2. threshold to get all the blue jewels
  3. take the convex hull with bwconvhull so that you have only one blob.
  4. erode with imerode until you've gone enough to get inside the outer ring.
  5. Use those two binary images to get a mask of just the outer ring. Use xor().
  6. Use the ring mask to mask the red image.
  7. Use regionprops() to get the center of the convex hull mask.
  8. Use improfile and bwboundaries to get the mean gray level of the ring for every angle around the ring.
  9. Examine the mean gray level as a function of angle to find the dividing lines between blob on the ring.
  댓글 수: 1
Murat Kocaman
Murat Kocaman 2018년 5월 7일
Thank you this works but not with red I used blue instead of red.

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

추가 답변 (2개)

Walter Roberson
Walter Roberson 2018년 3월 1일
If you can work out an appropriate mask (which does not look easy for this case unless the red is already there) then mask and regionprops() to get the characteristics.
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 3월 1일
I do not understand why those 7 should be picked and not the other 24-ish round objects around the edge?
Is there any possibility of improving the lighting on the images?
Walter Roberson
Walter Roberson 2018년 3월 2일
I think finding the boundaries between the adjacent objects would be tricky. I do not think I have any suggestions at this time. Image Analyst might have some ideas.
I would tend to think that the third of those images, the larger darker blue, would be the easiest one to work with of what you have shown: it is the only one in which the small round(-ish) dots are somewhat clear. Though I could be wrong: perhaps edge detection on the back-lit version might be easier.

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


Image Analyst
Image Analyst 2018년 3월 2일
What are you after? Do you want to find out if there are any missing jewels? If so, just use a template and look for the presence of blue. If you really want the size, it could be tricky because they are so cluttered where they abut each other. You could try to separate them with watershed. See Steve's blog: http://blogs.mathworks.com/steve/2013/11/19/watershed-transform-question-from-tech-support/
  댓글 수: 3
Image Analyst
Image Analyst 2018년 3월 4일
OK, then after watershed you have a labeled image which you can pass directly into regionprops() to do the measurements.
Murat Kocaman
Murat Kocaman 2018년 3월 5일
이동: DGM 2023년 2월 13일
The image becomes as seen below picture so it does not give a result.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by