zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger1-4
zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger1
procedure TForm1.Button1Click(Sender: TObject);
var
img, img1 : THImageX;
value : OleVariant;
//tuple : THTupleX;
w, h : OleVariant;
begin
//tuple := THTupleX.Create(nil);
img := THImageX.Create(nil);
img.ReadImage('ic0');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0,0,h-1,w-1);
img.DispObj(HWindowXCtrl1.HalconWindow);
value := img.ObjToInteger(1,-1);
//ShowMessage(tuple.TupleSelect(value,0));
img1 := THImageX.Create(nil);
img1.IntegerToObj(value);
w := img1.GetImageSize(h);
HWindowXCtrl2.HalconWindow.SetPart(0,0,h-1,w-1);
img1.DispObj(HWindowXCtrl2.HalconWindow);
//ShowMessage(IntToStr(img.TestEqualObj(img1.DefaultInterface)));
img1.Free;
img.Free;
//tuple.Destroy;
end;
----------------
zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger2
procedure TForm1.Button1Click(Sender: TObject);
var
img, img1 : THImageX;
value : OleVariant;
//tuple : THTupleX;
w, h : OleVariant;
begin
//tuple := THTupleX.Create(nil);
img := THImageX.Create(nil);
img.ReadImage('ic0');
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0,0,h-1,w-1);
img.DispObj(HWindowXCtrl1.HalconWindow);
value := img.ObjToInteger(1,-1);
//ShowMessage(tuple.TupleSelect(value,0));
img1 := THImageX.Create(nil);
img1.IntegerToObj(value);
w := img1.GetImageSize(h);
HWindowXCtrl2.HalconWindow.SetPart(0,0,h-1,w-1);
img1.DispObj(HWindowXCtrl2.HalconWindow);
//ShowMessage(IntToStr(img.TestEqualObj(img1.DefaultInterface)));
img1.Free;
img.Free;
//tuple.Destroy;
end;
--------------
zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger3
procedure TForm1.Button1Click(Sender: TObject);
var
img, img1 : HImageX;
value : OleVariant;
w, h : OleVariant;
filename : OleVariant;
tuple : HTupleX;
begin
tuple := CoHTupleX.Create;
img := CoHImageX.Create;
filename := VarArrayOf(['ic0', 'keypad', 'ic_pin', 'pcb']);
img.ReadImage(filename);
value := img.ObjToInteger(1,-1);
img1 := CoHImageX.Create();
img1.IntegerToObj(value);
w := img1.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,0)-1,tuple.TupleSelect(w,0)-1);
img1.SelectObj(1).DispObj(HWindowXCtrl1.HalconWindow);
HWindowXCtrl2.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,1)-1,tuple.TupleSelect(w,1)-1);
img1.SelectObj(2).DispObj(HWindowXCtrl2.HalconWindow);
HWindowXCtrl3.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,2)-1,tuple.TupleSelect(w,2)-1);
img1.SelectObj(3).DispObj(HWindowXCtrl3.HalconWindow);
HWindowXCtrl4.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,3)-1,tuple.TupleSelect(w,3)-1);
img1.SelectObj(4).DispObj(HWindowXCtrl4.HalconWindow);
img1 := nil;
img := nil;
tuple := nil;
end;
----------------
zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger4
procedure TForm1.Button1Click(Sender: TObject);
var
img, img1 : HImageX;
value : OleVariant;
w, h : OleVariant;
filename : OleVariant;
tuple : HTupleX;
ho_Region, ho_Region1 : HRegionX;
begin
tuple := CoHTupleX.Create;
img := CoHImageX.Create;
filename := VarArrayOf(['ic0', 'ic_pin', 'pcb', 'pcb_layout']);
img.ReadImage(filename);
ho_Region := img.BinThreshold();
value := img.ObjToInteger(1,-1);
img1 := CoHImageX.Create();
img1.IntegerToObj(value);
value := ho_Region.ObjToInteger(1, -1);
ho_Region1 := CoHRegionX.Create;
ho_Region1.IntegerToObj(value);
w := img1.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,0)-1,tuple.TupleSelect(w,0)-1);
HWindowXCtrl1.HalconWindow.SetDraw('margin');
HWindowXCtrl1.HalconWindow.SetColor('red');
img1.SelectObj(1).DispObj(HWindowXCtrl1.HalconWindow);
ho_Region1.SelectObj(1).DispObj(HWindowXCtrl1.HalconWindow);
HWindowXCtrl2.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,1)-1,tuple.TupleSelect(w,1)-1);
HWindowXCtrl2.HalconWindow.SetDraw('margin');
HWindowXCtrl2.HalconWindow.SetColor('red');
img1.SelectObj(2).DispObj(HWindowXCtrl2.HalconWindow);
ho_Region1.SelectObj(2).DispObj(HWindowXCtrl2.HalconWindow);
HWindowXCtrl3.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,2)-1,tuple.TupleSelect(w,2)-1);
HWindowXCtrl3.HalconWindow.SetDraw('margin');
HWindowXCtrl3.HalconWindow.SetColor('red');
img1.SelectObj(3).DispObj(HWindowXCtrl3.HalconWindow);
ho_Region1.SelectObj(3).DispObj(HWindowXCtrl3.HalconWindow);
HWindowXCtrl4.HalconWindow.SetPart(0,0,tuple.TupleSelect(h,3)-1,tuple.TupleSelect(w,3)-1);
HWindowXCtrl4.HalconWindow.SetDraw('margin');
HWindowXCtrl4.HalconWindow.SetColor('red');
img1.SelectObj(4).DispObj(HWindowXCtrl4.HalconWindow);
ho_Region1.SelectObj(4).DispObj(HWindowXCtrl4.HalconWindow);
img1 := nil;
img := nil;
tuple := nil;
ho_Region := nil;
ho_Region1 := nil;
end;
zw版【转发·台湾nvp系列Delphi例程】HALCON ObjToInteger1-4的更多相关文章
- zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow (Delphi Prism)
zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow (Delphi Prism) namespace DirectShow_Prism;interfaceuses Sys ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON HImage与Bitmap格式转换
zw版[转发·台湾nvp系列Delphi例程]HALCON HImage与Bitmap格式转换 (Delphi Prism)namespace HImage_Bitmap_Prism;interfac ...
- zw版【转发·台湾nvp系列Delphi例程】.NET调用HALCON COM控件内存释放模式
zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports Sys ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON HWindow Overlayer 1
zw版[转发·台湾nvp系列Delphi例程]HALCON HWindow Overlayer 1 ------------------------------------HALCON HWindow ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON DirectFile
zw版[转发·台湾nvp系列Delphi例程]HALCON DirectFile unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow
zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...
- zw版【转发·台湾nvp系列Delphi例程】Delphi 使用 HALCON库件COM控件数据格式转换
zw版[转发·台湾nvp系列Delphi例程]Delphi 使用 HALCON库件COM控件数据格式转换 Delphi 使用 HALCON库件COM控件数据格式转换,与IHObjectX接口有关 va ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON AddNoiseWhite
zw版[转发·台湾nvp系列Delphi例程]HALCON AddNoiseWhite unit Unit1;interfaceuses Windows, Messages, SysUtils, Va ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON CheckDifference
zw版[转发·台湾nvp系列Delphi例程]HALCON CheckDifference unit Unit1;interfaceuses Windows, Messages, SysUtils, ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON BinThreshold
zw版[转发·台湾nvp系列Delphi例程]HALCON BinThreshold unit Unit1;interfaceuses Windows, Messages, SysUtils, Var ...
随机推荐
- String 与StringBuffer比较
package String比较; /* * String 与StringBuffer比较 * String 不可变,一旦赋值,就不能被修改 * StringBuffer可变的字符串. * Strin ...
- Asp.Net MVC 路由
原文链接:http://www.asp.net/learn/mvc/ 在这篇教程中,我将为你介绍每个ASP.NET MVC应用程序都具有的一个重要功能,称作ASP.NET路由(ASP.NET Rout ...
- js判断是否为空火undefined是否给undefined加引号
js判断是否为空为undefined如果判断的是类型则用typeof(),如果其本身就是“undefind”字符窜,则不能这样判断, 这样typeof之后是字符串类型就判断不出来了,这是需要去掉typ ...
- Boolean强制转换
数据类型 转换为true的值 转换为false的值 Boolean true false String 任何非空字符串 空字符串 Number 任何非0数字值(包括无穷大) 0和NaN Object ...
- java.lang.IllegalArgumentException: No converter found for return value of type: class Person
在http://www.cnblogs.com/winner-0715/p/6033462.html我们讲到三个条件就能实现SpringMVC返回json的功能 但是按照这三个条件配置后,运行出现了错 ...
- js实例代码
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Android 多线程处理之多线程用法
handler.post(r)其实这样并不会新起线程,只是执行的runnable里的run()方法,却没有执行start()方法,所以runnable走的还是UI线程. 1.如果像这样,是可以操作ui ...
- 在网页中弹出qq临时会话
http://www.54kefu.net/linshi/201202/391.html
- python 内存监控模块之memory_profiler
0. memory_profiler是干嘛的 This is a python module for monitoring memory consumption of a process as wel ...
- session的方法
Hibernate对象的状态 瞬时(Transient) — 由 new 操作符创建,且尚未与Hibernate Session 关联的对象被认定为瞬时(Transient)的.瞬时(Transien ...