zw版【转发·台湾nvp系列Delphi例程】HALCON LocalMin1
zw版【转发·台湾nvp系列Delphi例程】HALCON LocalMin1
procedure TForm1.Button1Click(Sender: TObject);
var img : HImageX; w, h : OleVariant; rg : HRegionX; sys : HSystemX;begin sys := CoHSystemX.Create; img := CoHImageX.Create; img.ReadImage('fuse'); w := img.GetImageSize(h); HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1); img.DispObj(HWindowXCtrl1.HalconWindow); sys.SetSystem('neighborhood', 4); rg := img.LocalMin; HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1); img.DispObj(HWindowXCtrl2.HalconWindow); rg.DispObj(HWindowXCtrl2.HalconWindow); sys.SetSystem('neighborhood', 8); rg := img.LocalMin; HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1); img.DispObj(HWindowXCtrl3.HalconWindow); rg.DispObj(HWindowXCtrl3.HalconWindow);end;