Login  Register

Re: Finding distances to edge of a "blob"

Posted by Sami Badawi-2 on Mar 10, 2008; 6:15pm
URL: http://imagej.273.s1.nabble.com/Finding-distances-to-edge-of-a-blob-tp3696949p3696952.html

Hi meastwood98,

I can think of 2 approaches:

1: Trace angle lines (30, 60, 90) from center to first background point.

Look at a line drawing algorithm if you have a hard time finding what points
are on the lines.

This is simple but only works if the blobs are convex.

2: Trace the edge of the blob

Trace the edge of the blob and for each new point take the distance and the
angle between your chosen center point.
If a points that have an angle that is a multiple of 30 store the distance,
if another point also have the same angle store the max distance.

The main idea to this edge tracing algorithm is:
Say you want to trace the blob in say clockwise direction:
* Choose 2 points on the edge of the blog going in clockwise direction
* Always choose the next edge point on the blob by starting on the previous
point, and go around the current point until you get to a point at the edge
* Stop when you get back to the first point

The lines from one edge point to the next are usually stored in what is
called chain code, number going from 0 to 7 for each direction.

I did a Google search for: "chain code" blob and found a few references

https://www.cs.tcd.ie/courses/computervision/ConnectedComponents.html

http://books.google.com/books?id=IZveETjcNLMC&pg=PA114&lpg=PA114&dq=%22chain+code%22+blob&source=web&ots=tI7eNtcCOj&sig=9ALZkN9LJFLCK16BfmtUnuauYkM&hl=en#PPA121,M1

You might be able to find somebody that has made an edge tracer for ImageJ
already.

-Sami Badawi
http://www.shapelogic.org