zw版【转发·*nvp系列Delphi例程】HALCON Regiongrowing
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
rg : HRegionX;
w, h : OleVariant;
begin
img := CoHImageX.Create;
img.ReadImage('fabrik');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);
rg := img.Regiongrowing(3, 3, 6, 100);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl2.HalconWindow);
HWindowXCtrl2.HalconWindow.SetDraw('margin');
HWindowXCtrl2.HalconWindow.SetColor('red');
rg.DispObj(HWindowXCtrl2.HalconWindow);
end;