←选择平台

WatershedCommand类

总结
把图像分成不同的部分使用分水岭算法。
语法
c#
VB
objective - c
c++
Java
公共WatershedCommand:RasterCommand
公共WatershedCommand继承了RasterCommand
@接口LTWatershedCommand: LTRasterCommand
公共WatershedCommand扩展RasterCommand
公共ref类WatershedCommand:公共RasterCommand
讲话
  • 每个部分的像素有相同的颜色。分水岭算法对图像就像地形表面。黑暗的地区盆地。光区域盆地周围的山脊。
  • 用户负责确定输出段的数量和输入数组中的每个片段的位置。
  • 该命令支持8,16位灰度和彩色图像和24岁的32位彩色图像。
  • 这个命令不支持32位灰度图像。
  • 该命令支持签署/无符号图像。
例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing.Core;公共无效WatershedCommandExample (){RasterCodecs编解码器=RasterCodecs ();编解码器。ThrowExceptionsOnInvalidImages =真正的;/ /加载一个图像RasterImage图像= codecs.Load (Path.Combine (LEAD_VARS.ImagesDir,“IMAGE3.dcm”));LeadPoint [] [] pointsArray =LeadPoint [4] [];(intidx = 0;idx < 4;idx + +)pointsArray idx =LeadPoint [2];/ /设置起点和终点为每段路径。pointsArray [0] [0] =LeadPoint (100);pointsArray [0] [1] =LeadPoint (200);pointsArray [1] [0] =LeadPoint (180、115);pointsArray [1] [1] =LeadPoint (300、115);pointsArray [2] [0] =LeadPoint (235、220);pointsArray [2] [1] =LeadPoint (260、220);pointsArray [3] [0] =LeadPoint (180、330);pointsArray [3] [1] =LeadPoint (350、330);/ /准备命令WatershedCommand命令=WatershedCommand (pointsArray);/ /应用command.Run(图片);}静态LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools.Codecs进口Leadtools.ImageProcessing.Core公共WatershedCommandExample ()昏暗的编解码器作为RasterCodecs =RasterCodecs ()编解码器。ThrowExceptionsOnInvalidImages =真正的的加载一个形象昏暗的图像作为RasterImage = codecs.Load (Path.Combine (LEAD_VARS.ImagesDir“IMAGE3.dcm”))昏暗的pointsArray作为LeadPoint () () =LeadPoint (3) () {}idx作为整数= 03pointsArray (idx) =LeadPoint (1) {}下一个idx设置起点和终点的每一段路。pointsArray (0) (0) =LeadPoint (100)pointsArray (0) (1) =LeadPoint (200)pointsArray (1) (0) =LeadPoint (180、115)pointsArray (1) (1) =LeadPoint (300、115)pointsArray (2) (0) =LeadPoint (235、220)pointsArray (2) (1) =LeadPoint (260、220)pointsArray (3) (0) =LeadPoint (180、330)pointsArray (3) (1) =LeadPoint (350、330)“准备的命令昏暗的命令作为WatershedCommand =WatershedCommand (pointsArray)的应用command.Run(图片)结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

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