## Re: [Algorithms] Bezier curve fitting

 Re: [Algorithms] Bezier curve fitting From: Danny Kodicek - 2005-10-13 13:28:27 ```> Alternatively (probably equivalently), how can I convert between a 2D > Catmull-Rom spline and a Bezier curve? Either of these will solve my > current > problem, which is to approximate a curve made up of lots of points with a > curve made up of a few Bezier segments. I think this approach won't solve your problem if you treat the initial curve as Catmull-Rom one (passes through all points); and in the end want a Bezier (or some other type) of curve with much fewer points. You don't want just to create a point in the output for each point in the input... That's true, but what I can do is make a Catmull-rom passing through every n'th point, and convert *that* to a Bezier. It won't be a perfect approximation, but assuming my curves are reasonably smooth it should work all right. Now anyone want to email me offlist to talk about magnetic field lines? :) Danny ```

 RE: [Algorithms] Motion tracking from a live video source From: Willem de Boer - 2005-10-10 10:16:11 Attachments: Message as HTML ```Hi, =20 What exactly are you trying to track? Is it faces, or human body movement? The literature out there is vast, and a best solution depends on the context (ie., is the camera moving relative to the object; what kind of object are you tracking). =20 Cheers, =20 --- Willem H. de Boer Homepage: http://www.whdeboer.com =20 =20 =20 ________________________________ From: gdalgorithms-list-admin@... [mailto:gdalgorithms-list-admin@...] On Behalf Of Alias Sent: 08 October 2005 14:45 To: gdalgorithms-list@... Subject: [Algorithms] Motion tracking from a live video source =20 Hello all, At the moment, I'm trying to figure out a couple of things relating to webcam motion tracking. Firstly - as I see it, there are two basic approaches: 1) Look for a certain colour, say, orange, and track it by checking for pixels that match it, within a certain threshold. 2) Look at the difference between frames using difference blending, then compare the bounding rectangles of the current frame with the previous frame.=20 I've had some success with the first approach, but the the results seem to vary wildly depending on the lighting - it works really well in low light, and not so well in brighter environments.=20 So now I'm considering the second approach. However, what I'm trying to figure out is the best way to get a movement vector from the bounding rectangles. Should I compare the current frame to the previous frame and then try to interpolate a motion vector from that? Should I use the centre point of the rectangles, or the corners, or is there some other technique that I should know about?=20 Any info would be much appreciated, Thanks in advance, Alias ```
 RE: [Algorithms] Motion tracking from a live video source From: Willem de Boer - 2005-10-10 10:47:45 ```>Any heuristic that uses the source colors of the incoming pixels is not >going to work. It just varies way too much. You want to use things=20 Colour statistics have been succesfully used in the past for tracking objects in real-time across a sequence of frames. Here's one example: http://www.cvmt.dk/education/teaching/CVG9ExercisePapers/TrackingColorOb jects.pdf Colour models can be used to track objects under varying lighting conditions, and camera parameters. Cheers, --- Willem H. de Boer Homepage: http://www.whdeboer.com ```
 [Algorithms] Re: Motion tracking from a live video source From: Juhana Sadeharju - 2005-10-11 17:22:26 ```>From: Aras Pranckevicius > >PiAgQXQgdGhlIG1vbWVudCwgSSdtIHRyeWluZyB0byBmaWd1cmUgb3V0IGEgY291cGxlIG9mIHRo >aW5ncyByZWxhdGluZyB0bwo+IHdlYmNhbSBtb3Rpb24gdHJhY2tpbmcuCgpJZiB5b3UgY2FuIHNv [ Reposting the coded message in plain ascii. Juhana ] > At the moment, I'm trying to figure out a couple of things relating to > webcam motion tracking. If you can somehow segment "foreground" (moving object) and "background" (the rest), then you've got a black&white image. From there, quite many approaches exist; quite easy is MHI (motion history images) - basically, just fade out the foreground along time, so you have fading out "motion trails". Then compute image gradients of that. Of course, all this assumes you've got background extraction working, which is hard :) Anyway, I suggest taking a look at OpenCV library - it has lots of vision-related algorithms already implemented: http://sourceforge.net/projects/opencvlibrary It won't solve your problem immediately, but at least can provide some building blocks. -- Aras 'NeARAZ' Pranckevicius http://nesnausk.org/nearaz | http://nearaz.blogspot.copad: fix the code ```
 Re: [Algorithms] Re: Motion tracking from a live video source From: Ken Noland - 2005-10-11 19:28:34 Attachments: Message as HTML ```Actually, funny you ask this because I've been debating on writing a small demo that uses the camera as an input to orient the perspective in a 3D game. Kinda like a big trackball using the camera to point and shoot. The idea I was toying around with and starting to seriously consider was t= o analyze the frame to determine a grid of distinctive points, say 16x16 distinctive points with color gradient stored, and possibly even some edge detection in there to sample the most distinctive points on the 2D image. The next frame it would search for the 16x16 points and attempt to match up the difference with the current frame and then that *should* spit out a 3D coordinate change. However, there are certain things that would disrupt that really basic algorithm. The first of which is moving objects in the scene. That is why I decided to have a distinctive weighting value added to each point chosen to sample and each frame that goes by that contains that particular point at a high degree of accuracy then the weighting value is incremented, otherwise the weighting value is decremented. Has anyone else experimented with this? -Krad On 10/11/05, Juhana Sadeharju wrote: > > >From: Aras Pranckevicius > > > > >PiAgQXQgdGhlIG1vbWVudCwgSSdtIHRyeWluZyB0byBmaWd1cmUgb3V0IGEgY291cGxlIG9m= IHRo > > >aW5ncyByZWxhdGluZyB0bwo+IHdlYmNhbSBtb3Rpb24gdHJhY2tpbmcuCgpJZiB5b3UgY2Fu= IHNv > > [ Reposting the coded message in plain ascii. Juhana ] > > > At the moment, I'm trying to figure out a couple of things relating to > > webcam motion tracking. > > If you can somehow segment "foreground" (moving object) and > "background" (the rest), then you've got a black&white image. From > there, quite many approaches exist; quite easy is MHI (motion history > images) - basically, just fade out the foreground along time, so you > have fading out "motion trails". Then compute image gradients of that. > > Of course, all this assumes you've got background extraction working, > which is hard :) > > Anyway, I suggest taking a look at OpenCV library - it has lots of > vision-related algorithms already implemented: > http://sourceforge.net/projects/opencvlibrary It won't solve your > problem immediately, but at least can provide some building blocks. > > -- > Aras 'NeARAZ' Pranckevicius > http://nesnausk.org/nearaz | http://nearaz.blogspot.copad: fix the code > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > ```
 [Algorithms] Bezier curve fitting From: Danny Kodicek - 2005-10-13 11:41:54 ```Hey all - been lurking for a while but this is only my second post, so Hi there. I'm dealing with what ought to be a really common algorithm, but for some reason I can't find one anywhere: given points p1, p2, q1, q2, and vectors v1 and v2, how can I find the control points p1+s*v1 and p2+t*v2 for a 2D Bezier curve p1 q1 q2 p2? (Is that clear? :) ) Alternatively (probably equivalently), how can I convert between a 2D Catmull-Rom spline and a Bezier curve? Either of these will solve my current problem, which is to approximate a curve made up of lots of points with a curve made up of a few Bezier segments. Thanks Danny ```
 Re: [Algorithms] Bezier curve fitting From: Aras Pranckevicius - 2005-10-13 12:58:19 ```> Alternatively (probably equivalently), how can I convert between a 2D > Catmull-Rom spline and a Bezier curve? Either of these will solve my curr= ent > problem, which is to approximate a curve made up of lots of points with a > curve made up of a few Bezier segments. I think this approach won't solve your problem if you treat the initial curve as Catmull-Rom one (passes through all points); and in the end want a Bezier (or some other type) of curve with much fewer points. You don't want just to create a point in the output for each point in the input... -- Aras 'NeARAZ' Pranckevicius http://nesnausk.org/nearaz | http://nearaz.blogspot.com ```
 Re: [Algorithms] Bezier curve fitting From: Danny Kodicek - 2005-10-13 13:28:27 ```> Alternatively (probably equivalently), how can I convert between a 2D > Catmull-Rom spline and a Bezier curve? Either of these will solve my > current > problem, which is to approximate a curve made up of lots of points with a > curve made up of a few Bezier segments. I think this approach won't solve your problem if you treat the initial curve as Catmull-Rom one (passes through all points); and in the end want a Bezier (or some other type) of curve with much fewer points. You don't want just to create a point in the output for each point in the input... That's true, but what I can do is make a Catmull-rom passing through every n'th point, and convert *that* to a Bezier. It won't be a perfect approximation, but assuming my curves are reasonably smooth it should work all right. Now anyone want to email me offlist to talk about magnetic field lines? :) Danny ```