原文:Win8 Metro(C#)数字图像处理--2.63图像指数增强



[函数名称]

  指数增强      WriteableBitmap IndexenhanceProcess(WriteableBitmap src)

[函数代码]

<strong>        /// <summary>
/// Enhanced index process.
/// </summary>
/// <param name="src">The source image.</param>
/// <returns></returns>
public static WriteableBitmap IndexenhanceProcess(WriteableBitmap src)////指数增强
{
if (src != null)
{
int w = src.PixelWidth;
int h = src.PixelHeight;
WriteableBitmap srcImage = new WriteableBitmap(w, h);
byte[] temp = src.PixelBuffer.ToArray();
byte[] tempMask = (byte[])temp.Clone();
for (int i = 0; i < tempMask.Length; i++)
{
temp[i] = (byte)((1.0 / 255.0) * (double)(tempMask[i] * tempMask[i]));
}
Stream sTemp = srcImage.PixelBuffer.AsStream();
sTemp.Seek(0, SeekOrigin.Begin);
sTemp.Write(temp, 0, w * 4 * h);
return srcImage;
}
else
{
return null;
}
}</strong>

[图像效果]

最后,分享一个专业的图像处理网站(微像素),里面有很多源代码下载:

最新文章

  1. html5新增标签和属性
  2. UBUNTU 10.04上安装和使用HAMACHI
  3. 也谈自动化平台的搭建,另附高大上的名字---无人值守定时巡检系统(selenium+testng+ant+jenkins)
  4. MYSQL单双向同步
  5. IBM Domino 9 出现 Server Controller 未在主机上运行或未在端口2050监听 解决方案
  6. 透析Express.js
  7. K3数据库表结构
  8. strcpy函数实现
  9. cf 559a **
  10. Spring MVC 和 Spring 总结
  11. Unity 内置着色器(转)
  12. JXL获取excel批注
  13. Int16 Int32 Int64
  14. CentOS7 安装JDK
  15. Linux几种关机(重启)相关命令
  16. 获取linux帮助命令
  17. 2019年一次java知识点总结
  18. 分布式计算(四)Azkaban安装
  19. 2017-2018-2 20165228 实验四《Android程序设计》实验报告
  20. (9)模板层 - templates(模板语言、语法、取值、过滤器、变量的使用)

热门文章

  1. [Ramda] Refactor to Point Free Functions with Ramda using compose and converge
  2. 【codeforces 750F】New Year and Finding Roots
  3. 【SAE 部署 JavaWeb 项目报 404 错误】
  4. 数字图像处理原理与实践(MATLAB版)勘误表
  5. SpringBoot JPA 专题
  6. CentOS7 下的mysql安装与配置
  7. kindeditor 4 上传下载文件
  8. JAVA自带API的压缩与解压
  9. Windows远程连接Ubuntu (远程桌面和XDMCP)
  10. javascript 次序li