Google
AreaMoments.HuInvariants Method
Class
Pascal
class function HuInvariants(image: IPixelEnumerator; basis: MomentBasis): TFloatArray;
Returns

= (Math.Power(-1, (m - k) div 2) * CommonTypes.Math.Fact((m + k) div 2)) / (CommonTypes.Math.Fact((m - k) div 2) * CommonTypes.Math.Fact((n + k) div 2) * CommonTypes.Math.Fact((k - n) div 2)) else 

= 0; end; 

var k, val: integer; w, h, x, y: integer; c: TComplex; r, xx, yy, x0, y0, xScale, yScale: float; mPi, bmnk: float; begin w := Length(image[0]); h := image.GetSize.Height; xScale := w / 2; yScale := h / 2; x0 := (w + 1) / 2; y0 := (h + 1) / 2; if (not Odd(m - Abs(n))) and (Abs(n) <= m) then begin result.form := Rectangular; result.re := 0; result.im := 0; for k := n to m do begin bmnk := B(m, n, k); if (bmnk <> 0) then for x := 0 to w - 1 do for y := 0 to h - 1 do begin val := image[y,x]; if (val <> 0) then begin xx := (x - x0) / xScale; yy := (y - y0) / yScale; if ((xx * xx + yy * yy) <= 1) then begin c.form := Rectangular; c.re := xx; c.im := -yy; c := Complex.IntPower(c, n); //r := Math.IntPower(xx * xx + yy * yy, (k - n) div 2) * val * bmnk; r := Math.IntPower(xx * xx + yy * yy, (k - n) div 2) * bmnk; result.re := result.re + c.re * r; result.im := result.im + c.im * r; end end; end; end; mPi := (m + 1) / Pi; result.re := result.re * mPi; result.im := result.im * mPi; end else begin result.re := 0; result.im := 0; end; 

end;

Description

class function AreaMoments.ZernikeMomentGS(image: IImageAdapter; m: byte; n: Shortint): TComplex; 

function B(m, n, k: Shortint): float; begin if (not Odd(m - Abs(k))) and (n >= 0) then

Related Information