Re: Vertex Detection from contour



On Feb 8, 7:22 pm, "JH" <paper...@xxxxxxxxx> wrote:
On Feb 8, 5:10 am, "serg271" <aocra...@xxxxxxxxx> wrote:



On Feb 7, 3:52 pm, "JH" <paper...@xxxxxxxxx> wrote:

On Jan 27, 7:28 pm, "Mithun" <mithunja...@xxxxxxxxx> wrote:

Hello JH,

I faced a similar problem a year back and implemented the following
solution successfully.

1)Ensure that your contour coordinates (x,y) can be accessed as a
chain, i.e., you can easily access adjacent points. I'll explain later
how you can arrange adjacent points efficiently if you like..

2)Once the contour is "sorted", crawl along the contour 3 points at a
time and calculate the difference in slope. How do you do that?

If points 0,1,2 are adjacent then all you have to do is calculate the
slope difference between point 0 (x0,y0) & point 1(x1,y1), and point 1
(x1,y1) & point 2 (x2, y2) by using:

slope1=(y1-y0) / (x1-x0); slope2=(y2-y1)/(x2-x1);

3)Therefore, if there is a massive slope difference, you have a
vertex. You can define "massive" by setting a threshold value for
(slope2-slope1).

The benefit of using this algo is it can be used for any kind of change
in slope even if it's not at 90 degrees..

Anyway, good luck with your project! Please don't hesitate to mail if
you have any doubts..

Mithun

JH wrote:
Hi all,

I'v got the contour profile from the binarization image.
I want to get vertex profile(local information, i.e. x, y information)
from this contour.
Exactly, these contours are cross-shapes(like +).
Would you give some information to do this work?

I'm a beginner at image processing field, so it is good to me that
solution is simple, fast and just directly applicable to my work. (my
work is real-time application)

JH- Hide quoted text -

- Show quoted text -

Thank you very much, Mithun.

However, I'v already applied similar algorithm.
This method has is some problem, at least in my work, which it results
in numbers of points at the vertex if the vertex-like points area is
large.
(Do you understand this sentence?? I'm unfamiliar with writing in
english)
So, I was seeking for another algorithm.

JH

If I understand you correctly you have too many vertices as result.
I'd suggest different algorithm in that case. Chose the maximum
error. Make the convex sell of your contur. Then take to neighbor
point of the shell and apply recurison like this:
Use the the pair form the convex shell as bounding points (firs, end)
find the segment of contour connecting those bounding points, for
each point of the segment calculate the distance to the line segment
connecting bounding point. If all the points of contour segment are
close enough to line segment (distance is less than maximum error)
throw them away and keep only bounding points. If not, chose the
point of contour segment with maximum distance from the line segment
(breaking point). Use breaking point as a new middle point between two
old bounding points. You now have two pair of bounding points -
(first, middle) and (middle, end). Apply the same procedure
recursively to each pair. Thus you will "break" the original shell
into piecewise-linear contour, and all points of original contour will
be close enough to this new piecewise-linear contour.- Hide quoted text -

- Show quoted text -

Thank you so much, serg271.

I saw the algorithm you explained in the ARToolkit library.
(maybe it is right.)
But, what I want to detect are vertices on concave contour as I
mentioned at my first message (The contour shape is cross(+).)
Can I apply your method into the concave contour?

JH

It's not my method. It's from ARToolkit library, as you have
pointed.It still shouldt work for concave contour. Convex shell still
could be the first approximation, and as you progressively subdivide
segments they will concave inside. For convex contour it just more
simple, as for convex contour you may not need convex shell, and can
just take two point on diameter as the first pair.

.



Relevant Pages

  • Re: Vertex Detection from contour
    ... from this contour. ... Use the the pair form the convex shell as bounding points ... each point of the segment calculate the distance to the line segment ...
    (sci.image.processing)
  • Re: Vertex Detection from contour
    ... from this contour. ... Use the the pair form the convex shell as bounding points ... each point of the segment calculate the distance to the line segment ...
    (sci.image.processing)
  • Re: Finding Circles in image.(help needed...)
    ... segment boundary) check if it circle or not - for example calculate ... center and average radial error. ... also I think that computing whatever a contour is closed or not is ...   help). ...
    (sci.image.processing)
  • Re: Finding Circles in image.(help needed...)
    ... transform, but it is slow, and I need some other fast solution. ... segment boundary) check if it circle or not - for example calculate ... also I think that computing whatever a contour is closed or not is ... - Preprocess the original image to remove noise ...
    (sci.image.processing)
  • Re: acad 2007: wie Linien und Bögen kombinieren?
    ... Contour ... Allgemein (siehe Lexikon): ... Bounding, Bounding-Box, boundary ... Mit freundlichen Grüssen ...
    (de.comp.cad)