Re: How to obtain maximum points for a set of data point
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Thu, 5 Apr 2007 18:45:15 +0000 (UTC)
In article <ef53791.-1@xxxxxxxxxxxxxxxxxxxxxxx>,
Noel <noel.tavan@xxxxxxxxx> wrote:
I am in need of help. I am trying to obtain the thickness of a dotted
line (created by ink). So I did some image analysis and i have a set
of coordinate for the boundary of the line and I am trying to obtain
the thickness. any idea how?
It seems to me that the thickness of a line should be the minimum
distance over all point pairs where the pair members are on opposite
sides of the line. This algorithm could be slightly optimized by
considering only the points that are adjacent to the line. I can
mentally picture reducing the locality even further, but I do not
have a clear algorithm in mind at the moment.
Let's see... pick a point, P1, on one side of the line. Pick
an arbitrary direction that leads through the line and continue
onwards until you encounter a point, Q1, that is on the other side
of the line. Now consider the set all points within a circle of radius
|Q1-P1| around P1. Go through the set starting from the closest
points to P1; for each set member point, if the point is on the
same side of the line as P1, or is -in- the line, discard that
point. At any given radius of consideration, if one or more points
remain after the culling, then they are all on the other side of
the line and all the same distance away from P1 and that distance
is the thickness of the line near P1; if, though, no points remain
after the culling, move to the next larger radius and re-cull,
continuing onward until eventually you have points remaining; worst
case is that Q1 will definitely be within the radius of consideration,
so you will find -some- definite thickness, T1.
Now, choose any other point P2 on the same side of the line as P1,
and consider the set of all points within a circle of radius T1
around P2, running the same sort of culling as above. Either
the culling will remove everything or it will find some point
of distance no greater than T1; if that distance is less than T1,
it becomes the new radius of consideration. Repeat this algorithm
for the remaining points on the same side as P1; the final thickness
determined is the thickness of the line.
This algorithm implicitly takes into account the possibility
that the line is curved or variable width or at an arbitrary angle.
But it does require a discretization of the point grid in order to
limit the points of consideration to a finite enumerable number;
it wouldn't work very well for for a continuous real-number map.
--
Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us. -- Ecclesiastes
.
- References:
- Prev by Date: Re: manipulating cell array
- Next by Date: Re: manipulating cell array
- Previous by thread: How to obtain maximum points for a set of data point
- Next by thread: manipulating cell array
- Index(es):
Relevant Pages
|