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


procedure TForm1.Button1Click(Sender: TObject);
var
w, h : OleVariant;
hv_Fuse, hv_i : Integer;
begin
ho_Image.ReadImage(Tuple.TupleAdd('color/color_fuses_0', hv_Count));
w := ho_Image.GetImageSize(h);
hv_WH.SetPart(0, 0, h - 1, w - 1);
hv_WH.DispObj(ho_Image as IHObjectX);
hv_WH.SetTposition(12, 512);
hv_WH.WriteString(Tuple.TupleAdd(Tuple.TupleAdd('color/color_fuses0', hv_Count), '.png'));

ho_Red := ho_Image.Decompose3(ho_Green, ho_Blue);
ho_Hue := ho_Red.TransFromRgb(ho_Green, ho_Blue, ho_Saturation, ho_Intensity, 'hsv');
ho_Saturated := ho_Saturation.Threshold(60, 255);
ho_HueSaturated := ho_Hue.ReduceDomain(ho_Saturated);
for hv_Fuse := 0 to Tuple.TupleSub(Tuple.TupleLength(hv_FuseTypes), 1) do
begin
ho_CurrentFuse := ho_HueSaturated.Threshold(Tuple.TupleSelect(hv_HueRanges, Tuple.TupleMult(hv_Fuse, 2)), Tuple.TupleSelect(hv_HueRanges, Tuple.TupleAdd(Tuple.TupleMult(hv_Fuse, 2), 1)));
ho_CurrentFuseConn := ho_CurrentFuse.Connection;
ho_CurrentFuseFill:= ho_CurrentFuseConn.FillUp;
ho_CurrentFuseSel := ho_CurrentFuseFill.SelectShape('area', 'and', 6000, 20000);
hv_FuseArea := ho_CurrentFuseSel.AreaCenter(hv_Row1, hv_Column1);
hv_WH.SetColor('magenta');
for hv_i := 0 to Tuple.TupleSub(Tuple.TupleLength(hv_FuseArea), 1) do
begin
hv_WH.SetTposition(Tuple.TupleSelect(hv_Row1, hv_i), Tuple.TupleSelect(hv_Column1, hv_i));
hv_WH.WriteString(Tuple.TupleAdd(Tuple.TupleAdd(Tuple.TupleAdd(Tuple.TupleSelect(hv_FuseColors, hv_Fuse), ' '), Tuple.TupleSelect(hv_FuseTypes, hv_Fuse)), ' Ampere'));
end;
hv_WH.SetTposition(Tuple.TupleMult(24, Tuple.TupleAdd(hv_Fuse, 1)), 12);
hv_WH.SetColor('slate blue');
hv_WH.WriteString(Tuple.TupleAdd(Tuple.TupleAdd(Tuple.TupleSelect(hv_FuseColors, hv_Fuse), ' Fuses: '), Tuple.TupleLength(hv_FuseArea)));
end;
hv_Count := hv_Count + 1;
if (hv_Count > 4) then
hv_Count := 0;
end;

zw版【转发·台湾nvp系列Delphi例程】HALCON color_fuses2的更多相关文章

  1. zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow (Delphi Prism)

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow (Delphi Prism) namespace DirectShow_Prism;interfaceuses Sys ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON HImage与Bitmap格式转换 (Delphi Prism)namespace HImage_Bitmap_Prism;interfac ...

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

    zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports Sys ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON HWindow Overlayer 1 ------------------------------------HALCON HWindow ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectFile unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...

  7. zw版【转发·台湾nvp系列Delphi例程】Delphi 使用 HALCON库件COM控件数据格式转换

    zw版[转发·台湾nvp系列Delphi例程]Delphi 使用 HALCON库件COM控件数据格式转换 Delphi 使用 HALCON库件COM控件数据格式转换,与IHObjectX接口有关 va ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON AddNoiseWhite unit Unit1;interfaceuses Windows, Messages, SysUtils, Va ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON CheckDifference unit Unit1;interfaceuses Windows, Messages, SysUtils, ...

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

    zw版[转发·台湾nvp系列Delphi例程]HALCON BinThreshold unit Unit1;interfaceuses Windows, Messages, SysUtils, Var ...

随机推荐

  1. Android Lint简介(转)

    转载自原文:http://blog.csdn.net/hudashi/article/details/8333349,感谢原作者. 英文原文:http://tools.android.com/tips ...

  2. Linux: 20 Iptables Examples For New SysAdmins

    Linux comes with a host based firewall called Netfilter. According to the official project site: net ...

  3. boost::circular_buffer

    boost::circular_buffer的push_back分析 circular_buffer为了效率考虑,使用了连续内存块保存元素   使用固定内存,没有隐式或者非期望的内存分配 快速在cir ...

  4. SVN Working Copy locked ,并且进行clean up也还是不行

    标题:working copy locked 提示:your working copy appears to be locked. run cleanup to amend the situation ...

  5. json对象与json字符串互换

    json字符串转json对象:jQuery.parseJSON(jsonStr);                  /          var jsonObj= eval('(' + str + ...

  6. getconf 命令

    getconf 命令 用途 将系统配置变量值写入标准输出. 系统的默认参数,比如mkfs读取默认参数,并格式化,默认PAGESIZE是4096 语法 getconf [ -v specificatio ...

  7. proguard使用

      Proguard用于混淆java代 码,使代码变为由难懂的,无规律的字符命名的各种方法和类,保护自己的劳动成果.个人认为proguard混淆纯java项目比较理想,比如j2me的 MIDLET,如 ...

  8. python判断类型

    方法 isinstance(obj, type) 示例 >>> print isinstance(, int) True >>> print isinstance( ...

  9. NSAttributedString

    1.    使用这个类,必须先导入CoreText框架. 2.    给UILabel设置attributedText了会导致给UILabel中text,font,textColor,shadowCo ...

  10. Xcode 6.x 添加Empty Application模板

    Xcode 6.x 添加Empty Application模板 在Apple最新的XCode6.x中没有了Empty Application模板,这对一个老人来说是不能别接受的,同时也可以看出Appl ...