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

HALCON SigmaImage 示例
本文通过 Delphi 实现了 HALCON 中 SigmaImage 的应用案例,展示了如何读取图像、进行不同参数下的高斯平滑处理并显示结果。该示例有助于理解图像平滑的基本原理及其在图像处理中的应用。

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

 

procedure TForm1.Button1Click(Sender: TObject);
var
op: HOperatorSetX;
img, img1: HUntypedObjectX;
w, h: OleVariant;
begin
op := CoHOperatorSetX.Create;
op.ReadImage(img, 'surface_scratch.png');
op.GetImageSize(img, w, h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
op.DispObj(img, HWindowXCtrl1.HalconWindow.HalconID);
op.SigmaImage(img, img1, 5, 5, 3);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
op.DispObj(img1, HWindowXCtrl2.HalconWindow.HalconID);
HWindowXCtrl2.HalconWindow.SetColor('red');
HWindowXCtrl2.HalconWindow.SetTposition(10, 10);
HWindowXCtrl2.HalconWindow.WriteString('MaskHeight X MaskWidth : 5 X 5');
op.SigmaImage(img, img1, 6, 6, 3);
HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1);
op.DispObj(img1, HWindowXCtrl3.HalconWindow.HalconID);
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;

转载于:https://www.cnblogs.com/ziwang/p/4851108.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值