←选择平台

FeretsDiameterCommand类

总结
计算Feret直径的一个对象(点之间的最大距离周边的地区),并发现其端点。
语法
c#
VB
c++
公共FeretsDiameterCommand
公共FeretsDiameterCommand
公共ref类FeretsDiameterCommand
讲话
  • 这个命令计算Feret的直径(卡尺长度),沿边界任意两点之间最长的距离。这相当于最小直径的管,这个对象可以通过通过。
  • 这个命令不支持已签名的数据图像。
例子

运行FeretsDiameterCommand在一个图像。

c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing.Effects;公共无效FeretsDiameterCommandExample (){/ /加载一个图像RasterCodecs编解码器=RasterCodecs ();编解码器。ThrowExceptionsOnInvalidImages =真正的;RasterImage图像= codecs.Load (Path.Combine (LEAD_VARS.ImagesDir,@“Cannon.jpg”));/ /准备命令LeadRect rcRect =LeadRect(图片。宽/ 4,形象。身高/ 4、形象。宽度* 3 / 4,形象。高度* 3 / 4);image.AddEllipseToRegion (、rcRect RasterRegionCombineMode.Set);RegionContourPointsCommand contourcommand =RegionContourPointsCommand ();如果(contourcommand ! =)contourcommand.Run(图片);FeretsDiameterCommand命令=FeretsDiameterCommand (contourcommand.Points);command.Run ();MessageBox.Show (字符串.Format (”结果\ nFirstIndex: {0} \ nSecondIndex: {1} \ nDiameter: {2}”,命令。FirstIndex,命令。SecondIndex command.FeretsDiameter),“Ferets直径测试结果”);}静态LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools.Codecs进口Leadtools.ImageProcessing.Effects公共FeretsDiameterCommandExample ()昏暗的编解码器作为RasterCodecs ()编解码器。ThrowExceptionsOnInvalidImages =真正的昏暗的leadImage作为RasterImage = codecs.Load (Path.Combine (LEAD_VARS.ImagesDir“Cannon.jpg”))“准备的命令昏暗的rcRect作为LeadRect =LeadRect (leadImage。宽度\ 4,leadImage。身高\ 4,leadImage。宽度* 3 \ 4,leadImage。高度* 3 \ 4)leadImage.AddEllipseToRegion (没有什么、rcRect RasterRegionCombineMode。)昏暗的contourcommand作为RegionContourPointsCommand =RegionContourPointsCommand (没有什么)contourcommand.Run (leadImage)昏暗的命令作为FeretsDiameterCommand =FeretsDiameterCommand (contourcommand.Points)command.Run ()MessageBox.Show (字符串.Format (“ResultsFirstIndex: {0}”&环境。换行符&“SecondIndex: {1}”&环境。换行符&“直径:{2}”,命令。FirstIndex,命令。SecondIndex command.FeretsDiameter),“Ferets直径测试结果”)结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools.ImageProcessing.Effects作为sembly
188金宝搏的网址客服|支持|联系我们|知识产权的通知
©1991 - 2021领先的技术公司。保留所有权利。