Is there a way to apply a threshold to regionprops/bounding boxes?

조회 수: 2 (최근 30일)
I'm working with data from a Pedobarograph (see example images below).
What I want MATLAB to do, is to define bounding boxes around each separate foot. Most of the time, the foot doesn't land firmly on the mat in a way that would make the toes, heel etc. contiguous. This means when I use regionprops, I end up with about dozen regions per image, even though there are only four feet in each.
So is there a way to apply some type of threshold to regionprops? Such that rather than defining a region by contiguous elements (i.e. zero, zero elements between), the threshold would allow n number of zero elements between?
Any other suggestions to select each separate foot would be much appreciated. I can provide more information if required.
Thank you!

채택된 답변

Image Analyst
Image Analyst 2015년 7월 9일
편집: Image Analyst 2015년 7월 9일
Well, there are several ways to deal with it. One way is to use activecontour() to find a snug "envelope" for each collection of blobs. That's what my attached demo does.
Another way is to use imclose() to try to attach all nearby blobs. Use a structuring kernel that is small enough to not connect blobs from different footprints.
There might be other ways that might be required for pathological images if neither of those two methods work. Let us know if another method is required because those two fail, and attach the image that doesn't work.
Upload your original gray scale image if you want more help.
  댓글 수: 2
Henry Kricancic
Henry Kricancic 2015년 7월 9일
Hi Image Analyst,
I will try implementing the method from your attached demo now. If that doesn't work, then I will get back to you :)
Thank you again!
Henry Kricancic
Henry Kricancic 2015년 7월 12일
Thanks Image Analyst. Once again you've delivered the goods, cheers!
I used the imclose method to patch the blobs together, worked quite well. Haven't tested on more atypical data yet, but so far so good.
Thank you :)

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

추가 답변 (1개)

Syed Waqas  Ul Haque
Syed Waqas Ul Haque 2016년 2월 15일
I have a question
Since you have pretty much clearly defined how to create a bounding box tell me how to use the bonded part of image for thresholding
  댓글 수: 1
Image Analyst
Image Analyst 2016년 2월 15일
I have no idea what you're asking. Read this link and then post your own question with your own image. Otherwise all I can say is to either mask or crop your image and then threshold it
binaryImage = boundedImage < someThreshold;

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

Community Treasure Hunt

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

Start Hunting!

Translated by