zw版【转发·台湾nvp系列Delphi例程】HALCON HomMat2dRotate1
2015-10-01 15:43
357 查看
zw版【转发·台湾nvp系列Delphi例程】HALCON HomMat2dRotate1
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/16/009d4c02c475ad98d8a81fe9d3bfd3f6.png)
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
rg : HRegionX;
w, h : OleVariant;
hv_HomMat2DIdentity, hv_HomMat2DRotate : HHomMat2DX;
begin
HWindowXCtrl1.HalconWindow.SetDraw('margin');
HWindowXCtrl1.HalconWindow.SetColor('red');
HWindowXCtrl2.HalconWindow.SetDraw('margin');
HWindowXCtrl2.HalconWindow.SetColor('red');
img := CoHImageX.Create;
img.ReadImage('ic1');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg := CoHRegionX.Create;
rg.GenRectangle1(h / 2 - 100, w / 2 - 100, h / 2 + 100, w / 2 + 100);
img.DispObj(HWindowXCtrl1.HalconWindow);
rg.DispObj(HWindowXCtrl1.HalconWindow);
hv_HomMat2DIdentity := CoHHomMat2DX.Create;
hv_HomMat2DIdentity.HomMat2dIdentity;
hv_HomMat2DRotate := hv_HomMat2DIdentity.HomMat2dRotate(Pi / 180 * 45, h / 2, w / 2);
rg := hv_HomMat2DRotate.AffineTransRegion(rg, 'false');
img.DispObj(HWindowXCtrl2.HalconWindow);
rg.DispObj(HWindowXCtrl2.HalconWindow);
end;
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/16/009d4c02c475ad98d8a81fe9d3bfd3f6.png)
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
rg : HRegionX;
w, h : OleVariant;
hv_HomMat2DIdentity, hv_HomMat2DRotate : HHomMat2DX;
begin
HWindowXCtrl1.HalconWindow.SetDraw('margin');
HWindowXCtrl1.HalconWindow.SetColor('red');
HWindowXCtrl2.HalconWindow.SetDraw('margin');
HWindowXCtrl2.HalconWindow.SetColor('red');
img := CoHImageX.Create;
img.ReadImage('ic1');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg := CoHRegionX.Create;
rg.GenRectangle1(h / 2 - 100, w / 2 - 100, h / 2 + 100, w / 2 + 100);
img.DispObj(HWindowXCtrl1.HalconWindow);
rg.DispObj(HWindowXCtrl1.HalconWindow);
hv_HomMat2DIdentity := CoHHomMat2DX.Create;
hv_HomMat2DIdentity.HomMat2dIdentity;
hv_HomMat2DRotate := hv_HomMat2DIdentity.HomMat2dRotate(Pi / 180 * 45, h / 2, w / 2);
rg := hv_HomMat2DRotate.AffineTransRegion(rg, 'false');
img.DispObj(HWindowXCtrl2.HalconWindow);
rg.DispObj(HWindowXCtrl2.HalconWindow);
end;
相关文章推荐
- zw版【转发·台湾nvp系列Delphi例程】HALCON FastThreshold2
- zw版【转发·台湾nvp系列Delphi例程】HALCON FastThreshold1
- zw版【转发·台湾nvp系列Delphi例程】HALCON LocalMin2
- zw版【转发·台湾nvp系列Delphi例程】HALCON LocalMin1
- zw版【转发·台湾nvp系列Delphi例程】HALCON Roberts1
- zw版【转发·台湾nvp系列Delphi例程】HALCON Roberts2
- zw版【转发·台湾nvp系列Delphi例程】HALCON ZoomImageFactor2
- zw版【转发·台湾nvp系列Delphi例程】HALCON ZoomImageFactor
- zw版【转发·台湾nvp系列Delphi例程】HALCON max_connection
- zw版【转发·台湾nvp系列Delphi例程】HALCON MirrorImage2
- zw版【转发·台湾nvp系列Delphi例程】HALCON MirrorImage
- zw版【转发·台湾nvp系列Delphi例程】HALCON MoveRectangle2
- zw版【转发·台湾nvp系列Delphi例程】HALCON MoveRectangle
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetIcon1
- zw版【转发·台湾nvp系列Delphi例程】HALCON SetIcon2
- zw版【转发·台湾nvp系列Delphi例程】HALCON DispArc
- zw版【转发·台湾nvp系列Delphi例程】HALCON HSerializedItem
- zw版【转发·台湾nvp系列Delphi例程】HALCON union1
- zw版【转发·台湾nvp系列Delphi例程】HALCON SqrtImage
- zw版【转发·台湾nvp系列Delphi例程】HALCON SubImage