How to detect the waist in a BW image?

2 次查看(过去 30 天)
I am trying to split an abject that is in fact two touching objects. So to split it in two I need to detect the waist (the area with the minimum distance)
. I can;t figure out how to detect the waist.
  4 个评论
Mona
Mona 2015-6-29
Thanks for your input Ashish. The original image is the top-left image (without the blue and red detected boarders). I will upload it all by itself if it helps. So I apply Wiener filter to smooth the background then use Canny edge detection. Then dilate and erode the detected edges simultaneously while filling the holes to find the border as the perimeter of the two touching objects. Once that is done, I need to detect the waist, split the two objects ad track/match their profile throughout the video. Any ideas or thoughts about doing that in a better/more efficient way is more than welcome.
Thanks a lot
Ashish Uthama
Ashish Uthama 2015-6-29
I spent a few minutes, didnt get far (Though stdfilt followed by a threshold helps get close to the mask).
Your watershed image appears to have split the two, isnt that enough? and the waist appear clear,(you could filter the label image with a small summing filter and find areas with a particular sum if you want the 'waist' segment to quantify lenght).

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2015-6-29
编辑:Image Analyst 2015-6-30
Why not use imdistline() or improfile() to manually specify them. Unless you have hundreds of images and need to do this automatically, that's probably the best way.
Otherwise, first call bwareafilt() to extract the largest blob. Then try to iterate where you call imdilate() followed by bwlabel() to count the number of blobs and quit when you get to two. Then binarize again and call bwmorph() with the "thicken" option to expand the blobs out so that they touch, but will not join/combine them. Then label again and call graycomatrix() to count how many pixels of blob #1 occur next to blob #2.
  5 个评论
Image Analyst
Image Analyst 2015-7-1
Can you post your original binary image, or else code to get it from the gray scale image you uploaded? By the way, you can use the boundaries in poly2mask() if you want to mask out stuff outside the red lines.
Mona
Mona 2015-7-1
编辑:Mona 2015-7-2
Yes sure, here is the original BW image.
Ya, you are correct. masking out the extra pixels would work. I actually just multiplied the labeled thickened image by the original binary image shown above and it works just fine! Thanks a lot, your suggestions are very helpful.
Going back to graycomatrix(). Can you please tell me how to use it to find the waist. I used
[glcm,~] = graycomatrix(L_s,'NumLevels',num+1,'G',[])
But it doesn't give me the correct waist length. I found myself writing a hideous code to scan and match for [1 0 2] pixels!

请先登录,再进行评论。

更多回答(1 个)

Thuy Dung Nguyen
Thuy Dung Nguyen 2018-6-26
Hello. I have the same problem as Mona had. Can someone explain to me what she did because I do not understand the codes completely.

类别

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