zw版【转发·台湾nvp系列Delphi例程】HALCON SigmaImage1

zw版【转发·台湾nvp系列Delphi例程】HALCON SigmaImage1-LMLPHP

procedure TForm1.Button1Click(Sender: TObject);
var
img, img1: HImageX;
w, h: OleVariant;
begin
img := CoHImageX.Create;
img.ReadImage('surface_scratch.png');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);
img1 := img.SigmaImage(5, 5, 3);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img1.DispObj(HWindowXCtrl2.HalconWindow);
HWindowXCtrl2.HalconWindow.SetColor('red');
HWindowXCtrl2.HalconWindow.SetTposition(10, 10);
HWindowXCtrl2.HalconWindow.WriteString('MaskHeight X MaskWidth : 5 X 5');
img1 := img.SigmaImage(6, 6, 3);
HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img1.DispObj(HWindowXCtrl3.HalconWindow);
HWindowXCtrl3.HalconWindow.SetColor('red');
HWindowXCtrl3.HalconWindow.SetTposition(10, 10);
HWindowXCtrl3.HalconWindow.WriteString('偶數值 : 6 X 6 => 奇數值 : 7 X 7');
HWindowXCtrl3.HalconWindow.SetTposition(50, 10);
HWindowXCtrl3.HalconWindow.WriteString('MaskHeight X MaskWidth : 7 X 7');
end;

05-11 19:35