Finding distances to edge of a "blob"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding distances to edge of a "blob"

meastwood98
Hi, say for example i have a binary image which is just a simple black blob on a white background, i have a random centre and i would like to find the distances from the centre to the edge of the blob at different angles, say at about 30 degrees between them.

Any ideas on how best to go about this? Any help would be much appriciated.

Thanks,
Mark
Reply | Threaded
Open this post in threaded view
|

Re: Finding distances to edge of a "blob"

Sami Badawi-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Finding distances to edge of a "blob"

Burger Wilhelm
In reply to this post by meastwood98
Tracing of region boundaries is not trivial and you probably don't need
any chain code but simply the list of boundary points (coordinates).
Yes, there IS a tracer for ImageJ in our textbook sample code that
includes binary region segmentation, contour tracing etc.

The source code can be found at
http://www.imagingbook.com/index.php?id=98 (Chap. 11).

Wilhelm
www.imagingbook.com


> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On
> Behalf Of Sami Badawi
> Sent: Monday, March 10, 2008 7:16 PM
> To: [hidden email]
> Subject: Re: Finding distances to edge of a "blob"
>
> 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=PA1
14&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
>
Reply | Threaded
Open this post in threaded view
|

Re: Finding distances to edge of a "blob"

Sami Badawi-2
In reply to this post by meastwood98
Hi Wilhelm Burger,

For months now I have eagerly been anticipating your book,
Digital Image Processing, An algorithmic introduction using Java,
checking my local bookstores weekly.
I am happy to learn that I now at least can look at your code examples online.

My idea with the chain codes was that if there was a plugin that could give
you a start point and the chain codes, it would be very easy to get all the
coordinates of the boundary points back.

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