←选择平台

ColorLevelCommand类

总结
将颜色调平应用于图像。它改变图像阴影,中间色调和高光。此函数用于对图像进行预处理的目的改进条形码识别结果。
语法
c#
VB
objective - c
c++
Java
公共ColorLevelCommand:RasterCommand
公共ColorLevelCommand继承了RasterCommand
@接口LTColorLevelCommand: LTRasterCommand
公共ColorLevelCommand扩展RasterCommand
公共ref类ColorLevelCommand:公共RasterCommand
讲话
  • 该协会的成员ColorLevelCommandData类告诉ColorLevelCommand什么构成阴影,中间色调和高光,以及如何重新映射阴影,中间色调和高光。
  • 控件的MinimumInput、MaximumInput、MinimumOutput、MaximumOutput和Gamma成员的值来控制图像平衡和调平的数量ColorLevelCommandData类。
    • 属性的MinimumInput属性ColorLevelCommandData类定义方法解释为该颜色通道阴影的内容。任何小于或等于MinimumInput的值都被认为是阴影。
    • 属性的MaximumInput属性ColorLevelCommandData类定义方法解释为该颜色通道的高亮显示内容。任何大于或等于MaximumInput的值都被认为是高亮显示。
    • MaximumInput属性的值必须比MinimumInput属性的值至少大2。
    • 中间音调是那些介于MinimumInput和MaximumInput之间的值。
    • MinimumOutput属性是阴影将被映射到的值。
    • MaximumOutput属性是将突出显示映射到的值。
    • Gamma属性用于修改中间色调值
  • 如果只有ColorLevelCommandFlags. master被设置在Flags属性中,那么其余的通道仍然会受到影响。
  • 如果图像是灰度图像,则必须设置ColorLevelCommandFlags. master的Flags属性,否则类将没有任何影响。
  • 如果MinimumOutput > MaximumOutput,那么图像的阴影和高光将被反转。
  • 该命令不支持12位和16位灰度。
  • 该命令支持48位和64位彩色图像。对48和64位彩色图像的支持仅在文档/医疗工具包。
  • 该命令不支持签名数据映像。

有关更多信息,请参阅改变亮度和对比度.有关更多信息,请参阅修正颜色

例子

运行ColorLevelCommand在图像上。

c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing.Color;公共无效ColorLevelCommandExample ()//加载图像RasterCodecs codecs =RasterCodecs ();编解码器。ThrowExceptionsOnInvalidImages =真正的RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,“IMAGE1。CMP”));//准备命令ColorLevelCommandData蓝色=ColorLevelCommandData ();ColorLevelCommandData master =ColorLevelCommandData ();//指定图像级别蓝色的。MinimumInput = 20;蓝色的。MaximumInput = 200;蓝色的。MinimumOutput = 0;蓝色的。MaximumOutput = 255;蓝色的。Gamma = 100;// Master将使图像反转的主人。MinimumInput = 0;的主人。MaximumInput = 255;的主人。MinimumOutput = 255;的主人。MaximumOutput = 0;的主人。Gamma = 100;//升级蓝色和Master通道ColorLevelCommand命令=ColorLevelCommand(主,蓝色,ColorLevelCommandFlags。蓝色的|ColorLevelCommandFlags.Master);command.Run(图片);编解码器。保存(形象,Path.Combine (LEAD_VARS.ImagesDir“Result.jpg”), RasterImageFormat.Jpeg, 24);静态LEAD_VARS公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”
进口Leadtools进口Leadtools。编解码器进口Leadtools.ImageProcessing.Color公共ColorLevelCommandExample ()昏暗的编解码器作为RasterCodecs ()编解码器。ThrowExceptionsOnInvalidImages =真正的昏暗的leadImage作为RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,“IMAGE1。CMP”))准备命令昏暗的蓝色的作为ColorLevelCommandData =ColorLevelCommandData昏暗的作为ColorLevelCommandData =ColorLevelCommandData'指定图像级别蓝色的。MinimumInput = 20蓝色的。MaximumInput = 200蓝色的。MinimumOutput = 0蓝色的。MaximumOutput = 255蓝色的。Gamma = 100主人会让图像颠倒过来的主人。MinimumInput = 0的主人。MaximumInput = 255的主人。MinimumOutput = 255的主人。MaximumOutput = 0的主人。Gamma = 100“调平蓝色和Master通道昏暗的命令作为ColorLevelCommand =ColorLevelCommand(主没有什么没有什么,蓝色,ColorLevelCommandFlags。蓝色的ColorLevelCommandFlags.Master)command.Run (leadImage)编解码器。保存(leadImage Path.Combine (LEAD_VARS.ImagesDir“Result.jpg”), RasterImageFormat.Jpeg, 24)结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools.ImageProcessing.Color组装
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。