非得我亲自出面了,求图形处理高人指点一二!(300分)

  • 主题发起人 主题发起人 cqbaobao
  • 开始时间 开始时间
C

cqbaobao

Unregistered / Unconfirmed
GUEST, unregistred user!
原问题:http://www.delphibbs.com/delphibbs/dispq.asp?lid=777961不是我问的,
LID=1570108 是我发的言,可没有反应[:(];

头绪太多,数学基础不好,现诚心请教。
 
http://service.lonetear.com/delphi/dispdoc.asp?id=1383
 
老大 我看了一下 瞎说了几句
 
amakusa:
问题是这种 BEZIER 曲线只过端点,不过控制点,
我现在只有端点,那两个控制点得计算啊。
 
zw84611:
上当上当,那书我都有,[8D]可是我看不懂[:(]

这个问题属于:插值?逼近?拟合???请明示。。。。[?]
 
sorry,我不懂,只是提个醒
 
呵呵,什么时候BEZIER变成拟和算法了.
拟合要曲线过所有的点,而BEZIER只过两个点.呵呵.
拟和的方法很多,各中方法出来的曲线都不一样,不知道楼主的应用需要什么样的.
 
这段时间忙点别的东东,倒是忘了这个问题了。

LeeChange:

呵呵,其实我根本搞不清楚 BEZIER 能否与拟和扯上关系,

是这样的:

我有一堆点是从一个图形轮廓上取样而来,我希望用平滑的曲线连接这些点;
我就看到 BEZIER 曲线很平滑(漂亮[:)]),所以想利用它来“拟合”我的这些点,
当然,如果用别的算法能实现我的要求也行。
 
to cqbaobao:
三点的抛物线参数拟合你能搞定吗?这点是自由曲线拟合的基础.
BEZIER的特点是修改曲线的方便性.
 
一点不懂,捧场可以吧
 
这是三点拟合的程序.
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
PaintBox1: TPaintBox;
Button1: TButton;
procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
Index: Byte;
Point: array [1..3] of TPoint;

procedure Par(xs, ys, xm, ym, xe, ye: Integer);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.Par(xs, ys, xm, ym, xe, ye: Integer);
var
d, d1, ax, ay, bx, by: Double;
n, i: Integer;
begin
ax:=(xe-2*xm+xs)*2;
ay:=(ye-2*ym+ys)*2;
bx:=xe-xs-ax;
by:=ye-ys-ay;
n:=Trunc(Sqrt(ax*ax+ay*ay));
n:=Trunc(Sqrt(n*100));
PaintBox1.Canvas.MoveTo(xs, ys);
d:=1/n;
d1:=d;
for i:=0 to n do
begin
PaintBox1.Canvas.LineTo(Trunc(ax*d1*d1+bx*d1+xs), Trunc(ay*d1*d1+by*d1+ys));
d1:=d1+d
end;
PaintBox1.Canvas.LineTo(xe, ye)
end;

procedure TForm1.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Inc(Index);
if Index<4 then
begin
Point[Index].X:=x;
Point[Index].Y:=y;
PaintBox1.Canvas.Pixels[x,y]:=clred
end
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Index:=0;
Par(Point[1].X, Point[1].Y, Point[2].X, Point[2].Y, Point[3].X, Point[3].Y)
end;

end.
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
643
import
I
I
回复
0
查看
700
import
I
后退
顶部