20

Pascal/Delphi/Lazarus で書かれた逆透視変換が必要です。次の画像を参照してください。

画像処理

デスティネーション ピクセルをウォークスルーしてから、ソース イメージ内の対応する位置を計算する必要があると思います (丸め誤差などの問題を回避するため)。

function redraw_3d_to_2d(sourcebitmap:tbitmap, sourceaspect:extended, point_a, point_b, point_c, point_d:tpoint, megapixelcount:integer):tbitmap;
var
   destinationbitmap:tbitmap;
   x,y,sx,sy:integer;
begin
  destinationbitmap:=tbitmap.create;
  destinationbitmap.width=megapixelcount*sourceaspect*???; // I dont how to calculate this
  destinationbitmap.height=megapixelcount*sourceaspect*???; // I dont how to calculate this
  for x:=0 to destinationbitmap.width-1 do
    for y:=0 to destinationbitmap.height-1 do
    begin
        sx:=??;
        sy:=??;
        destinationbitmap.canvas.pixels[x,y]=sourcebitmap.canvas.pixels[sx,sy];
    end;
  result:=destinationbitmap;
end;

私は本当の式が必要です...したがって、OpenGLソリューションは理想的ではありません...

4

2 に答える 2

22
于 2013-01-09T19:08:04.187 に答える
4

Graphics32、具体的にはTProjectiveTransformationを使用します ( Transformメソッドで使用するため)。エッジがギザギザにならないように、ソース画像に透明な余白を残すことを忘れないでください。

于 2013-01-09T20:06:33.057 に答える