zw版【转发·台湾nvp系列Delphi例程】HALCON SetComprise2
procedure TForm1.Button1Click(Sender: TObject);
var op : HOperatorSetX; image0, image1 : HUntypedObjectX; w, h : OleVariant;begin op := CoHOperatorSetX.Create; op.ReadImage(image0, 'fabrik'); op.GetImageSize(image0, w, h); HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1); op.DispObj(image0, HWindowXCtrl1.HalconWindow.HalconID); op.SobelAmp(image0, image1, 'sum_abs', 3); HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1); HWindowXCtrl2.HalconWindow.SetComprise('object'); op.DispObj(image1, HWindowXCtrl2.HalconWindow.HalconID); HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1); HWindowXCtrl2.HalconWindow.SetComprise('image'); op.DispObj(image1, HWindowXCtrl3.HalconWindow.HalconID); op.ClearObj(image0); op.ClearObj(image1); end;