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

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


procedure TForm1.Button1Click(Sender: TObject);
var
img: HImageX;
w, h: OleVariant;
rg, rg1: HRegionX;
begin
img := CoHImageX.Create;
img.ReadImage(‘razors1‘);
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);
rg := img.Threshold(100, 255);
HWindowXCtrl2.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg.DispObj(HWindowXCtrl2.HalconWindow);
rg1 := rg.MirrorRegion(‘row‘, h);
HWindowXCtrl3.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg1.DispObj(HWindowXCtrl3.HalconWindow);
rg1 := rg.MirrorRegion(‘column‘, w);
HWindowXCtrl4.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg1.DispObj(HWindowXCtrl4.HalconWindow);
rg1 := rg.MirrorRegion(‘row‘, h / 2);
HWindowXCtrl5.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg1.DispObj(HWindowXCtrl5.HalconWindow);
rg1 := rg.MirrorRegion(‘column‘, w / 2);
HWindowXCtrl6.HalconWindow.SetPart(0, 0, h - 1, w - 1);
rg1.DispObj(HWindowXCtrl6.HalconWindow);
img := nil;
end;

时间: 2024-12-27 22:49:05

zw版【转发·台湾nvp系列例程】HALCON ShapeTrans(Delphi)的相关文章

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

zw版[转发·台湾nvp系列例程]HALCON MirrorRegion (Delphi) procedure TForm1.Button1Click(Sender: TObject);var img: HImageX; w, h: OleVariant; rg, rg1: HRegionX;begin img := CoHImageX.Create; img.ReadImage('razors1'); w := img.GetImageSize(h); HWindowXCtrl1.Halcon

【转发·台湾nvp系列例程】HALCON SetFont例程 (Delphi)

[转发·台湾nvp系列例程]HALCON SetFont例程 (Delphi) procedure TForm1.FormShow(Sender: TObject);var w, h : OleVariant;begin Set8087CW($27f); img := CoHImageX.Create; img.ReadImage('ic'); w := img.GetImageSize(h); HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w

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

zw版[转发·台湾nvp系列Delphi例程]HALCON DirectFile unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, HALCONXLib_TLB, StdCtrls, ExtCtrls;type TForm1 = class(TForm) HWindowXCtrl1: THWindowXCtrl

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

zw版[转发·台湾nvp系列Delphi例程]HALCON CheckDifference unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, HALCONXLib_TLB;type TForm1 = class(TForm) HWindowXCtrl1: THWindowXCtrl; But

zw版【转发·台湾nvp系列Delphi例程】.NET调用HALCON COM控件内存释放模式

zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports System.Runtime.InteropServices Marshal.ReleaseComObject(COM物件)COM 物件 = Nothing 方法二 :COM 物件 = NothingGC.Collect()GC.WaitForPendingFinalizers() 方法三 :Import

zw版【转发·台湾nvp系列Delphi例程】HALCON HImage与Bitmap格式转换

zw版[转发·台湾nvp系列Delphi例程]HALCON HImage与Bitmap格式转换 (Delphi Prism)namespace HImage_Bitmap_Prism;interfaceuses System.Drawing, System.Collections, System.Collections.Generic, System.Windows.Forms, System.ComponentModel, System.Drawing, System.Drawing.Imag

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

zw版[转发·台湾nvp系列Delphi例程]HALCON AddNoiseWhite unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, HALCONXLib_TLB;type TForm1 = class(TForm) HWindowXCtrl1: THWindowXCtrl; Butto

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

zw版[转发·台湾nvp系列Delphi例程]HALCON HWindow Overlayer 1 ------------------------------------HALCON HWindow Overlayer 1 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleCtrls, HALCONXLib_TLB, St

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

zw版[转发·台湾nvp系列Delphi例程]HALCON Component Histogram unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, HALCONXLib_TLB;type TForm1 = class(TForm) HWindowXCtrl1: THWindowXCtrl;