zw版【转发·台湾nvp系列Delphi例程】HALCON 3D Position Of Circles
zw版【转发·台湾nvp系列Delphi例程】HALCON 3D Position Of Circles

procedure TForm1.action();
var
ho_Image, ho_EllipseContoursLarge : HUntypedObjectX;
ho_EllipseContoursSmall, ho_EllipseContours : HUntypedObjectX;
hv_Width, hv_Height : OleVariant;
hv_WindowHandle, hv_NumberLarge : OleVariant;
hv_NumberSmall, hv_RadiusLarge : OleVariant;
hv_RadiusSmall, hv_CamParam : OleVariant;
hv_Pose1, hv_Pose2, hv_CenterNormal1 : OleVariant;
hv_CenterNormal2, hv_ClusterP1 : OleVariant;
hv_ClusterP2, hv_ClusterCN1 : OleVariant;
hv_ClusterCN2, hv_HomMat3D : OleVariant;
hv_i : Longint;
hv_Qx, hv_Qy, hv_Qz : OleVariant;
hv_Row, hv_Column : OleVariant;
val1, val2 : double;
begin
hv_WindowHandle := HWindowXCtrl1.HalconWindow.HalconID;
Op.ReadImage(ho_Image, 'rim');
Op.GetImageSize(ho_Image, hv_Width, hv_Height);
Op.SetPart(hv_WindowHandle, 0, 0, hv_Height - 1, hv_Width - 1);
set_display_font(hv_WindowHandle, 16, 'courier', 'true', 'false');
Op.DispObj(ho_Image, hv_WindowHandle);
Op.SetLineWidth(hv_WindowHandle, 3);
p_determine_ellipse_contours(hv_WindowHandle, ho_Image, ho_EllipseContoursLarge, ho_EllipseContoursSmall, 0, hv_NumberLarge, hv_NumberSmall);
Op.ConcatObj(ho_EllipseContoursLarge, ho_EllipseContoursSmall, ho_EllipseContours);
hv_RadiusLarge := Tuple.TupleDiv(10.25, 1000.0);
hv_RadiusSmall := Tuple.TupleDiv(5.91, 1000.0);
val1 := 0.00000739;
val2 := 0.0000074;
hv_CamParam := Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleConcat(0.0122, -261.04), val1), val2), 303.12), 234.17), 652), 494);
Op.GetCirclePose(ho_EllipseContours, hv_CamParam, Tuple.TupleConcat(Tuple.TupleGenConst(hv_NumberLarge, hv_RadiusLarge), Tuple.TupleGenConst(hv_NumberSmall, hv_RadiusSmall)), 'pose', hv_Pose1, hv_Pose2);
Op.GetCirclePose(ho_EllipseContours, hv_CamParam, Tuple.TupleConcat(Tuple.TupleGenConst(hv_NumberLarge, hv_RadiusLarge), Tuple.TupleGenConst(hv_NumberSmall, hv_RadiusSmall)), 'center_normal', hv_CenterNormal1, hv_CenterNormal2);
p_cluster_normals(hv_Pose1, hv_Pose2, hv_CenterNormal1, hv_CenterNormal2, hv_ClusterP1, hv_ClusterP2, hv_ClusterCN1, hv_ClusterCN2);
Op.DispObj(ho_Image, hv_WindowHandle);
Op.SetColored(hv_WindowHandle, 12);
Op.DispObj(ho_EllipseContours, hv_WindowHandle);
for hv_i := 0 to Longint(Tuple.TupleSub(Tuple.TupleAdd(hv_NumberLarge, hv_NumberSmall), 1)) do
begin
Op.PoseToHomMat3d(Tuple.TupleSelectRange(hv_ClusterP1, Tuple.TupleMult(hv_i, 7), Tuple.TupleAdd(Tuple.TupleMult(hv_i, 7), 6)), hv_HomMat3D);
Op.AffineTransPoint3D(hv_HomMat3D, 0, 0, 0, hv_Qx, hv_Qy, hv_Qz);
Op.Project3DPoint(hv_Qx, hv_Qy, hv_Qz, hv_CamParam, hv_Row, hv_Column);
hv_Row := Tuple.TupleSub(hv_Row, 95);
hv_Column := Tuple.TupleSub(hv_Column, 60);
disp_message(hv_WindowHandle, Tuple.TupleConcat(Tuple.TupleConcat(Tuple.TupleAdd('X=', Tuple.TupleString(Tuple.TupleSelect(hv_ClusterCN1, Tuple.TupleMult(hv_i, 6)), '6.3f')), Tuple.TupleAdd('Y=', Tuple.TupleString(Tuple.TupleSelect(hv_ClusterCN1, Tuple.TupleAdd(Tuple.TupleMult(hv_i, 6), 1)), '6.3f'))), Tuple.TupleAdd('Z=', Tuple.TupleString(Tuple.TupleSelect(hv_ClusterCN1, Tuple.TupleAdd(Tuple.TupleMult(hv_i, 6), 2)), '6.3f'))), 'window', hv_Row, hv_Column, 'black', 'true');
end;
end;
zw版【转发·台湾nvp系列Delphi例程】HALCON 3D Position Of Circles的更多相关文章
- 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 ...
随机推荐
- Asp.net Mvc4默认权限详细(下)
前言 菜鸟去重复之Sql的问题还没有得到满意的答案.如果哪位大哥有相关的资料解释,能够分享给我,那就太谢谢了. 以后每发表一篇博文我都会将以前遗留的问题在前言里指出,直到解决为止. 本文主要在于探讨一 ...
- Javascript数据类型的一些注意点
1.字符串类型 substring()返回指定索引区间的子串: var s = 'hello, world' s.substring(0, 5); // 从索引0开始到5(不包括5),返回'hello ...
- NYU Hand Pose Dataset
http://cims.nyu.edu/~tompson/NYU_Hand_Pose_Dataset.htm#overview
- TST fall detection database
http://www.tlc.dii.univpm.it/blog/databases4kinect#IDFall2
- POJ2262问题描述
Goldbach's Conjecture Description In 1742, Christian Goldbach, a German amateur mathematician, sen ...
- vsUnit单元测试
在自定义的方法名上[右键]然后选择[创建单元测试],之后在项目中就添加了一个单元测试的项目,找到对应的单元测试的方法[TestMethod()]特性修饰,将单元测试的方法中最后一句:Assert.In ...
- 微信支付开发(3) JS API支付
由于微信支付接口更新,本文档已过期,请查看新版微信支付教程.地址 http://www.cnblogs.com/txw1958/category/624506.html 本文介绍如何使用JS API支 ...
- nohup和&的区别
nohup和&的区别http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4241330&fromuid=21288388 ...
- 新增WiFi真机同步与实时预览功能 简化真机调试步骤
APICloud工具插件为开发者提供iOS和Android平台真机同步调试功能,不仅可以通过USB方式进行APP真机同步功能,更新增WiFi真机同步和WiFi真机实时预览两大功能,方便开发者在开发过程 ...
- you need to upgrade the working copy first
is too old (format 29) to work with client version '1.9.4 (r1740329)' (expects format 31) 2016年09月18 ...