Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 18.05.07 11:41 
Hi,

kennt jemand einen algorithmus für einen DirectionalBlur? Am besten noch einen schönen schnellen..
Hab schon gegoogled ohne ende, aber irgendwie nich wirklich fündig geworden :(

Im moment mach ich es über ConvolutionFilter, aber das ist ewig lahm...

Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Phantom1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 390



BeitragVerfasst: Fr 18.05.07 13:54 
Hab selbst noch keinen Directional Blurfilter geschrieben, aber evtl hab ich eine Idee.
Das Original-Bild mit gewünschten winkel drehen, anschließend nur horizonal bluren (sollte schnell gehen dank Scanline) und zum schluss wieder zurückdrehen.

mfg
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 18.05.07 14:00 
Hi,
user profile iconPhantom1 hat folgendes geschrieben:
Hab selbst noch keinen Directional Blurfilter geschrieben, aber evtl hab ich eine Idee.
Das Original-Bild mit gewünschten winkel drehen, anschließend nur horizonal bluren (sollte schnell gehen dank Scanline) und zum schluss wieder zurückdrehen.

das dürfte ziemlich miese qualität ergeben leider...
Ah und ich hab vergessen zu sagen, es muß möglichseit für jeden pixel eine andere blur-richtugn zu benutzen.

Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Phantom1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 390



BeitragVerfasst: Fr 18.05.07 14:47 
Mhhh, ich dachte Directional blurt nur in eine Richtung? Kannst du mal ein Beispiel-Bild zeigen (vorher/nacher) wie es aussehen soll?

mfg
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 18.05.07 15:03 
Hi,

ein normaler directional blur blurrt normalerweise auch nur in eine richtung, ja.. aber ich möchte halt einen anderen directional blur für jedes pixel machen. Kannst es dir vorstellen wie einen RadialBlur, der ja auch kreisförmig blurrt..

Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 18.05.07 15:12 
Wo finde ich Informationen über dieses Thema? Wikipedia kennt das nicht.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Fr 18.05.07 17:03 
Du kannst ja jeden Pixel durchgehen und je nach der gewünschten Richtung blurren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
type
  TBlurType = (btVert, btHorz, btDiagL, btDiagR);
var
  x, y: Integer;
  BlurTable: array of array of TBlurType;  // <- das ist die Tabelle für jeden Pixel, die die gewünschte Richtung enthält
begin
  for y := 0 to Image1.Height - 1 do
    for x := 0 to Image1.Width - 1 do
    begin
      case BlurTable[x, y] of
        btVert: Image1.Picture.Bitmap.Canvas.Pixels[x, y] := MixColors(Image1.Picture.Bitmap.Canvas.Pixels[x, y - 1], Image1.Picture.Bitmap.Canvas.Pixels[x, y + 1]);
        btHorz: Image1.Picture.Bitmap.Canvas.Pixels[x, y] := MixColors(Image1.Picture.Bitmap.Canvas.Pixels[x - 1, y], Image1.Picture.Bitmap.Canvas.Pixels[x + 1, y]);
        btDiagL: Image1.Picture.Bitmap.Canvas.Pixels[x, y] := MixColors(Image1.Picture.Bitmap.Canvas.Pixels[x - 1, y - 1], Image1.Picture.Bitmap.Canvas.Pixels[x + 1, y + 1]);
        btDiagR: Image1.Picture.Bitmap.Canvas.Pixels[x, y] := MixColors(Image1.Picture.Bitmap.Canvas.Pixels[x + 1, y - 1], Image1.Picture.Bitmap.Canvas.Pixels[x - 1, y + 1]);
      end;
    end;
end;

Natürlich kannst du noch weitere Richtungen machen, zwischen vertikal und RDiagonal zum Beispiel.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 18.05.07 18:38 
ich denke, aber dass bei Aya beliebige Richtungen möglich sein sollen, also bräuchte man dafür schon ne Formel ;)

mfg