zw版【转发·*nvp系列Delphi例程】HALCON SmoothImage

zw版【转发·*nvp系列Delphi例程】HALCON SmoothImage

zw版【转发·*nvp系列Delphi例程】HALCON SmoothImage
procedure TForm1.Button1Click(Sender: TObject);
var
image0, image1, result : HImageX;
w , h : OleVariant;
i : Integer;
r, c : Integer;
begin
image0 := CoHImageX.Create;

image0.ReadImage('fuse');
w := image0.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
image0.DispObj(HWindowXCtrl1.HalconWindow);

image1 := image0.CopyImage;
Randomize;
for i := 1 to 1000 do
begin
r := Random(Integer(h));
c := Random(Integer(w));
image1.SetGrayval(r, c, Random(255));
end;
w := image1.GetImageSize(h);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
image1.DispObj(HWindowXCtrl2.HalconWindow);
result := image1.SmoothImage('deriche2', 0.5);
w := result.GetImageSize(h);
HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1);
result.DispObj(HWindowXCtrl3.HalconWindow);
end;

上一篇:Codeforces.264E.Roadside Trees(线段树 DP LIS)


下一篇:MySQL DBA面试全揭秘