Prev: how can i transform the binary mask from temps-frequentiel domain to cepstral domain
Next: Tab-expansion freezes matlab, signal for interupting?
From: Gus Lott on 4 Jun 2010 08:23 Howdy, I've got images of a worm that segment nicely from a light background and black worm. We've setup favorable conditions for imaging such that I can readily pull out a perimeter measure of the body of the animal as it bends. I can find the tail and head by looking at curvature along the perimeter. The head and tail have the largest positive curvature (pinches in have negative curvature). I'd like to extract a body axis line now that I have the head and tail centers. This line is a 1D description that travels the length of the the animal's midline. Anyone have any advice as to how I might effectively approach this? Thanks!
From: ImageAnalyst on 4 Jun 2010 11:12 On Jun 4, 8:23 am, "Gus Lott" <lottg.nos...(a)janelia.hhmi.org> wrote: > Howdy, > > I've got images of a worm that segment nicely from a light background and black worm. We've setup favorable conditions for imaging such that I can readily pull out a perimeter measure of the body of the animal as it bends. > > I can find the tail and head by looking at curvature along the perimeter. The head and tail have the largest positive curvature (pinches in have negative curvature). > > I'd like to extract a body axis line now that I have the head and tail centers. This line is a 1D description that travels the length of the the animal's midline. > > Anyone have any advice as to how I might effectively approach this? > > Thanks! ------------------------------------------------------------------------------------------------- Use bwmorph() with the 'skel' option to find the morphological skeleton of the worm shape. Good luck, ImageAnalyst
From: Gus Lott on 4 Jun 2010 13:49 Great, I'm trying to do it a bit more lean than a morphological operation on the whole image. I've already extracted a hull of the animal and have fit it with a set of fourier descriptor coefficients to model the x/y components of the periodic boundary. Is there a mathematical way to determine points that are equidistant to two points on this fourier fit boundary equation? Thoughts?
From: ImageAnalyst on 4 Jun 2010 15:50 Computing the skeleton is probably the best and easiest way. You could compute the Euclidean Distance Transform (EDT) with bwdist() and then look for ridgelines, but that's harder, and it will also require that you start with a binary image just like bwmorph(). I'm not sure what "lean" means since the skeleton goes down to a single pixel wide line for every object in your binary image. I also do not know why the skeleton won't do what you want. You already have the binary image (you needed that to get your boundary descriptors right?) so why not just use it and get the skeleton?
From: Gus Lott on 4 Jun 2010 16:05
The main reason was that I have already reduced the number of points to just the perimeter. You are correct that I have the black and white image, but that image can have holes in it, so I really just need to calculate equidistance from the boundary anyway (a straight bwdist doesn't give good values when there are holes in the object). "Lean" means avoiding morphological operations like close and other functions like bwdist that operate on the entire image. I was hoping I could use just the perimeter points (approximately 200) or my fourier descriptor coefficients (14) to efficiently calculate the skeleton. I'm just trying to make it run as fast as I can, so operating on 200 or 14 numbers vs 1 million pixels would be ideal. I appreciate your comments, thanks! |