Beizer curve fitting/ B-spline Fitting

Beizer curve fitting/ B-spline Fitting

Post by Dr. Jasjit Sur » Thu, 09 Dec 1999 04:00:00



Hello...

I have a bunch of points (say 50) in an clock wise order representing  a

closed contour.
I would like to fit a Bezier or B spline over it.
Is there public domain code other than Andrew Glassner (GEMS-1) ?

Thanks very much.

best,
jas

 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Richard Kinc » Thu, 09 Dec 1999 04:00:00



Quote:> I would like to fit a Bezier or B spline over it.
> Is there public domain code other than Andrew Glassner (GEMS-1) ?

(You mean Philip Schneider's code in _Graphics Gems_;
Glassner was the book editor.)

I seem to recall a GNU program which to me didn't seem nearly as
good as Schneider's.  There are a few sources on some relevant
mathematics.  The problem itself is still not well-defined, as you
have in some cases abstract points (like yours) that you just want
smoothed, versus points which are noisy samples of an existing smooth
image which you want to reconstruct.  Thus also the variety of
terms such as "curve fitting" versus "auto-tracing".   Such complexity
tends to not encourage development of nicely sharable programs.

I've been casually researching this problem for a number of years,
and the publications seem very sparse.  A number of commercial
products attempt this function, with some success, but their
publishers are reticent to disclose their methods (unless
disclosures are buried in patents somewhere--ugh).

Having done some work myself, and wanting to write on the subject,
I would be happy to correspond with anyone of a similar interest.

Richard J. Kinch
More Bezier stuff at http://truetex.com/bezexp.htm

 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Martin Webe » Fri, 10 Dec 1999 04:00:00


Have a look at:
http://homepages.go.com/~martweb/AutoTrace.htm



Quote:> Hello...

> I have a bunch of points (say 50) in an clock wise order
representing  a

> closed contour.
> I would like to fit a Bezier or B spline over it.
> Is there public domain code other than Andrew Glassner (GEMS-1) ?

> Thanks very much.

> best,
> jas

Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

Beizer curve fitting/ B-spline Fitting

Post by PROF D. Rogers {EAS FA » Fri, 10 Dec 1999 04:00:00


G'day,

One of the more accessible and comprehensive treatments
is by Piegl and Tiller in The NURBS Book 2/e, Springer-Verlag, 1997
ISBN 3-540-61545-8

Dave Rogers




!
!! I would like to fit a Bezier or B spline over it.
!! Is there public domain code other than Andrew Glassner (GEMS-1) ?
!
!(You mean Philip Schneider's code in _Graphics Gems_;
!Glassner was the book editor.)
!
!I seem to recall a GNU program which to me didn't seem nearly as
!good as Schneider's.  There are a few sources on some relevant
!mathematics.  The problem itself is still not well-defined, as you
!have in some cases abstract points (like yours) that you just want
!smoothed, versus points which are noisy samples of an existing smooth
!image which you want to reconstruct.  Thus also the variety of
!terms such as "curve fitting" versus "auto-tracing".   Such complexity
!tends to not encourage development of nicely sharable programs.
!
!I've been casually researching this problem for a number of years,
!and the publications seem very sparse.  A number of commercial
!products attempt this function, with some success, but their
!publishers are reticent to disclose their methods (unless
!disclosures are buried in patents somewhere--ugh).
!
!Having done some work myself, and wanting to write on the subject,
!I would be happy to correspond with anyone of a similar interest.
!
!Richard J. Kinch
!More Bezier stuff at http://truetex.com/bezexp.htm

 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Rogier E » Tue, 14 Dec 1999 04:00:00




Quote:> Hello...

> I have a bunch of points (say 50) in an clock wise order
representing  a

> closed contour.
> I would like to fit a Bezier or B spline over it.
> Is there public domain code other than Andrew Glassner (GEMS-1) ?

I assume you're working with 2d points? Just interpolate the x and y
values seperately, using
your prefered density function (b-spline, bilinear, etc.. see
"curve(t)" below)

You can do this by defining your contour as a pair of continious
functions fx(t) and fy(t), where
0 <= t < 1 and fx(0) = fx(1) and fy(0) = fy(1).

fx could be defined as follows:

float fx(float t)
{
float fn = t*N;
int n0 = int(fn);    // N = total nr of points, 50 in your example
int n1=n0+1, n2=n1+1, n3=n2+1;

fn -= floor(fn);    // fractional part between current and next
point

// wrap point indices
if (n0>=N) n0-=N;
if (n1>=N) n1-=N;
if (n2>=N) n2-=N;
if (n3>=N) n3-=N;

return curve(-1-fn)*cx[n0] + curve(-fn)*cx[n0] + curve(1-fn)*cx[n2]
+ curve(2-fn)*cx[n3];    // cx[i] are your contour points.

Quote:}

And the curve(t) function defines the type of interpolation:

float curve(float t)
{
t = fabs(t);
float t2 = t*t, t3=t2*t;

// for b-spline interpolation
if (t<1.f) return 0.5f*t3 - t2 + 2.f/3.f;
if (t<2.f) return (2.f-t)*(2.f-t)*(2.f-t)/6.f;
return 0;

/*
// for bilinear itnerpolation
if (t<1.f) return 1.f-t;
return 0;
*/

Quote:}

Well, I guess you can figure out fy(t) yourself :)

Hope this helps,
    Rogier "Jace / tBL"

 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Richard Kinc » Wed, 15 Dec 1999 04:00:00



> I seem to recall a GNU program which to me didn't seem nearly as
> good as Schneider's.

I recalled this is the "limn" program from the GNU font utilities,
I believe written by Karl Berry.  I found it documented at:

http://hill.ucs.ualberta.ca/Documentation/Info/by-node/fontutils-0.6/...

Richard J. Kinch
Publisher, TrueTeX brand typesetting software.
See http://truetex.com

 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Martin Webe » Thu, 16 Dec 1999 04:00:00


Where to get Schneider's?




> > I seem to recall a GNU program which to me didn't seem nearly as
> > good as Schneider's.

> I recalled this is the "limn" program from the GNU font utilities,
> I believe written by Karl Berry.  I found it documented at:

> http://hill.ucs.ualberta.ca/Documentation/Info/by-node/fontutils-
0.6/fontu_toc.html

> Richard J. Kinch
> Publisher, TrueTeX brand typesetting software.
> See http://truetex.com

Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

Beizer curve fitting/ B-spline Fitting

Post by Richard Kinc » Thu, 16 Dec 1999 04:00:00



> Where to get Schneider's?

_Graphics Gems_
 
 
 

1. B-spline fit to segmented curve

Seeking opinions, references, pointers, etc on following problem:
I have a 2D curve, say 16 segments, traced from an image.
I want to find a B-spline curve with, say 4 control points,
which best fits the measured curve. I have a routine (STEPIT)
which could adjust control point coordinates to minimize
deviation between observed curve and b-spline curve, but
I'm not sure how one would measure this discrepancy. Or
is there a better approach?

Thanks in advance for any info...

2. ImageList bug ?

3. Curve Fitting/Spline Help!!!!!

4. parameter HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

5. Closed and periodic B-spline curve fitting

6. Help Corel Move?????

7. Curve coarsening ? (opposite of curve fitting)

8. Rendering for compositing

9. curves: hermite, bezier, spline, bspline, nurbs

10. Gimp FITS violates FITS standard.

11. Gimp FITS images violate FITS standard

12. NURBS/Spline-fitting to circles