How to detect the waist in a BW image?

5 visualizaciones (últimos 30 días)
Mona
Mona el 29 de Jun. de 2015
Respondida: Thuy Dung Nguyen el 26 de Jun. de 2018
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 comentarios
Mona
Mona el 29 de Jun. de 2015
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 el 29 de Jun. de 2015
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).

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 29 de Jun. de 2015
Editada: Image Analyst el 30 de Jun. de 2015
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 comentarios
Image Analyst
Image Analyst el 1 de Jul. de 2015
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 el 1 de Jul. de 2015
Editada: Mona el 2 de Jul. de 2015
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!

Iniciar sesión para comentar.

Más respuestas (1)

Thuy Dung Nguyen
Thuy Dung Nguyen el 26 de Jun. de 2018
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.

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by