# Image analysis for extracting lines between cells

I have a 2D image as shown here and need to extract the spatial information about the curves in between each cell division. I have been able to analyze the image and output $\;(x,y)\;$ coordinates where the brightest values (1.0) are located in the grid of pixels.

How might I be able to process the image to remove noise (inside the cells) leaving only the lines describing the cell outlines?

-

There are a number of nonlinear filters that are possible. One that might help is the RidgeFilter

img=Import["http://i.stack.imgur.com/IyUPZ.jpg"];


Let's now clean it up a bit:

Pruning[Thinning[SelectComponents[Binarize[ImageAdjust[RidgeFilter[img, 5]], 0.094],
"Count", # > 800 &]]]


The above binarizes the output of the ridge filter. This leaves the desired edges plus some junk in the middle. SelectComponents then removes all the small components, leaving just the desired edges. The result contains the edges but they have become fat; the Thinning function trims them down. The final pruning (as suggested by halirutan) removes a couple of dangling edges.

-
Thank you for the assistance. This is exactly the push I needed! – rjd Nov 26 '13 at 14:38

Common functions you should look at are EdgeDetect, Thinning and Pruning. With the already mentioned RidgeFilter this gives

img = Import["http://i.stack.imgur.com/IyUPZ.jpg"];
border = Pruning[Thinning@Closing[EdgeDetect[

What about doing an initial TotalVariationFiltering with Method->"Poisson"? – UDB Nov 20 '13 at 11:16