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 ...
随机推荐
- const与#define宏常量 , inline与#define
1.预处理 预处理器是在真正的编译开始之前由编译器调用的独立程序.预处理器可以删除注释.包含其他文件以及执行宏替代. 预处理命令(宏定义#define..#undef. 文件包含#include. 条 ...
- C# HttpWebRequest 绝技
http://www.sufeinet.com/thread-6-1-1.html 万能框架.分布式......
- TCP/IP和HTTP的举例理解
闲暇中逛博客园,看到TCP/IP和HTTP关键词,就突然想深刻理解他们(以前真的是只知皮毛),于是看了关于TCP/IP和HTTP的博文,就有了此文. 首先要引出开放系统互连参考模型(OSI:Open ...
- 开始了ecshop
一个多星期前开始接触ecshop,突然决定要用它来做网站,于是从网上找各种手册与视频,联系官网客服,然后知道官网一共提供三种类型的服务,一种是ecshop授权,不包含任何技术支持,第二种是易开店的标准 ...
- SpringMVC @ResponseBody的使用
原文链接:http://www.jianshu.com/p/7097fea8ce3f@ResponseBody用法作用:该注解用于将Controller的方法返回的对象,根据HTTP Request ...
- POJ 1028题目描述
Description Standard web browsers contain features to move backward and forward among the pages rece ...
- 基础拾掇之——http基础
基础拾掇之——http基础 http协议介绍 http:Hyper Text Transfer Protocol 超文本传输协议,是互联网应用最为广泛的一种网络协议,主要用于Web服务.通过计算机处理 ...
- Ubuntu 安装 Brother MFC7470D 驱动
Ubuntu 安装 Brother MFC7470D 驱动 办公室的打印机是 Brother MFC7470D ,在 Ubuntu 中安装打印机驱动时,发现没有这个型号的驱动.只有 MFC7450 的 ...
- H3C交换机配置
h3c 交换机的配置命令 通过 console 连接到交换机 交换机所使用的 console 接口看上去像是一个普通的 RJ45 网卡接口,但是并不能使用普通的网线与 PC 连接 ^_^ .它要通过 ...
- Android仿QQ窗口的抖动的动画效果
就是仿照QQ窗口的抖动效果,在项目的res下创建anim文件夹,再创建两个xml文件:cycle.xml . myanim.xml cycle.xml : <?xml version ...