Sunday, May 20, 2012

function negative diagonal pada pengolahan Citra digital


function ImageNegativeDia(MInput:Matriks):Matriks;
var
  i,j : integer;
  MOutput : Matriks;
begin
  SetLength(MOutput,Length(MInput),Length(MInput[0]));
  for i:=0 to Length(MOutput)-1 do
  begin
    for j:=0 to Length(MOutput[0])-1 do
    begin
      if (j<=(Length(MInput[0])-i)) then
      MOutput[i,j]:=255-MInput[i,j]
      else
      MOutput[i,j]:=MInput[i,j];
    end;
  end;
  ImageNegativeDia:=MOutput;
end;

No comments:

Post a Comment