zw版【转发·*nvp系列Delphi例程】HALCON RegionToBin1

zw版【转发·*nvp系列Delphi例程】HALCON RegionToBin1

zw版【转发·*nvp系列Delphi例程】HALCON RegionToBin1

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, HALCONXLib_TLB;
type
TForm1 = class(TForm)
HWindowXCtrl1: THWindowXCtrl;
Button1: TButton;
HWindowXCtrl2: THWindowXCtrl;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
rg : HRegionX;
w, h : OleVariant;
begin
img := CoHImageX.Create;
img.ReadImage('circle_plate');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);

rg := img.Threshold(0, 60);
img := rg.RegionToBin(255, 0, w, h);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl2.HalconWindow);
end;
end.

上一篇:android课程第一节(TextView控件使用)


下一篇:安卓开发----TextView控件属性列表(转)