Win8Metro(C#)数字图像处理--2.33图像非线性变换
原文:Win8Metro(C#)数字图像处理--2.33图像非线性变换
[函数名称]
图像非线性变换函数NonlinearTransformProcess(WriteableBitmap src,int k )
- [函数代码]
- /// <summary>
- /// Nonlinear transform process.
- /// </summary>
- /// <param name="src">The source image.</param>
- /// <param name="k">Param to adjust nonlinear transform, from 0 to 255.</param>
- /// <returns></returns>
- public static WriteableBitmap NonlinearTransformProcess(WriteableBitmap src,int k )////37
- {
- if (src != null)
- {
- int w = src.PixelWidth;
- int h = src.PixelHeight;
- WriteableBitmap linearImage = new WriteableBitmap(w, h);
- byte[] temp = src.PixelBuffer.ToArray();
- int r = 0, g = 0, b = 0;
- for (int i = 0; i < temp.Length; i += 4)
- {
- b = (int)(k * Math.Log10(1 + temp[i]));
- g = (int)(k * Math.Log10(1 + temp[i + 1]));
- r = (int)(k * Math.Log10(1 + temp[i + 2]));
- temp[i] = (byte)(b > 0 ? (b < 255 ? b : 255) : 0);
- temp[i + 1] = (byte)(g > 0 ? (g < 255 ? g : 255) : 0);
- temp[i + 2] = (byte)(r > 0 ? (r < 255 ? r : 255) : 0);
- }
- Stream sTemp = linearImage.PixelBuffer.AsStream();
- sTemp.Seek(0, SeekOrigin.Begin);
- sTemp.Write(temp, 0, w * 4 * h);
- return linearImage;
- }
- else
- {
- return null;
- }
- }
Win8Metro(C#)数字图像处理--2.33图像非线性变换的更多相关文章
- Win8Metro(C#)数字图像处理--2.3图像反色
原文:Win8Metro(C#)数字图像处理--2.3图像反色 [函数名称] 图像反色函数ContraryProcess(WriteableBitmap src) [算法说明] 反色公式如下: ...
- Win8Metro(C#)数字图像处理--2.32图像曝光算法
原文:Win8Metro(C#)数字图像处理--2.32图像曝光算法 [函数名称] 图像曝光函数ExposureProcess(WriteableBitmap src,int exposureV ...
- Win8Metro(C#)数字图像处理--2.27图像加法运算
原文:Win8Metro(C#)数字图像处理--2.27图像加法运算 [函数名称] 图像加法函数AddProcess(WriteableBitmap src, WriteableBitmap a ...
- Win8Metro(C#)数字图像处理--2.28图像乘法运算
原文:Win8Metro(C#)数字图像处理--2.28图像乘法运算 [函数名称] 图像乘法函数MultiplicationProcess(WriteableBitmap src, Writea ...
- Win8Metro(C#)数字图像处理--2.29图像除法运算
原文:Win8Metro(C#)数字图像处理--2.29图像除法运算 [函数名称] 图像除法函数DivisionProcess(WriteableBitmap src, WriteableBit ...
- Win8Metro(C#)数字图像处理--2.26图像减法
原文:Win8Metro(C#)数字图像处理--2.26图像减法 [函数名称] 图像减法函数SubtractionProcess(WriteableBitmap src, WriteableBi ...
- Win8Metro(C#)数字图像处理--2.19图像水平镜像
原文:Win8Metro(C#)数字图像处理--2.19图像水平镜像 [函数名称] 图像水平镜像函数MirrorXProcess(WriteableBitmap src) [函数代码] ...
- Win8Metro(C#)数字图像处理--2.20图像垂直镜像
原文:Win8Metro(C#)数字图像处理--2.20图像垂直镜像 [函数名称] 图像垂直镜像函数MirrorYProcess(WriteableBitmap src) [函数代码] ...
- Win8Metro(C#)数字图像处理--2.18图像平移变换
原文:Win8Metro(C#)数字图像处理--2.18图像平移变换 [函数名称] 图像平移变换函数TranslationProcess(WriteableBitmap src,int x,in ...
随机推荐
- poj 2689 Prime Distance(大区间筛素数)
http://poj.org/problem?id=2689 题意:给出一个大区间[L,U],分别求出该区间内连续的相差最小和相差最大的素数对. 由于L<U<=2147483647,直接筛 ...
- 【t034】Matrix67的派对
Time Limit: 1 second Memory Limit: 1 MB [问题描述] Matrix67发现身高接近的人似乎更合得来.Matrix67举办的派对共有N(1<=N<=1 ...
- 【codeforces 765C】Table Tennis Game 2
[题目链接]:http://codeforces.com/contest/765/problem/C [题意] 枚举游戏先拿到k分的人胜; 然后两个人一个人得了a分,一个人得了b分; 问你最多可能进行 ...
- Mac下新安装的MySQL无法登陆root用户(安装时没有设置密码)
1.也不知是何原因,新安装好的MySQL,如果尝试用mysql -u root -p登陆就会出现这样的错误,但是root用户根本就没有设置密码. $ cd /usr/local$ cd mysql $ ...
- 商(quotient)—— 两数之比
1. IQ:Intelligence quotient IQ=MACA×100 MA:心智年龄(mental age) CA:实足年龄(chronological age)
- 从文件 I/O 看 Linux 的虚拟文件系统
1 引言 Linux 中允许众多不同的文件系统共存,如 ext2, ext3, vfat 等.通过使用同一套文件 I/O 系统 调用即可对 Linux 中的任意文件进行操作而无需考虑其所在的具体文件系 ...
- C# 控制台使用 UAC 权限
原文:C# 控制台使用 UAC 权限 本文告诉大家如何在 C# 控制台项目使用 UAC 权限.这个方法在 WPF 和 控制台都是可以使用. 右击项目,点击添加文件,找到程序清单 在 WPF 使用 UA ...
- wpf设置设计时的ViewModel
原文:wpf设置设计时的ViewModel wpf mvvm开发中,有些情况下,你的view不一定设置DataContext,但是你又想在设计阶段,能够自动提示你的view绑定的viewmodel的内 ...
- IE8支持function.bind()方法
这个 bind 方法仅仅有在 ie10 版本号的浏览器才得到原生支持,低于该版本号的浏览器下运行时会得到一个 undefined 的错误提示.于是仅仅好再次上网 google 解决方式,功夫不负有心人 ...
- auxiliary variable(辅助变量)的引入
辅助变量的引入是推导数学公式的一个重要手段. 1. 条件概率 ⇒ 积分 P(x=1|D)=∫10P(x=1|μ)P(μ|D)dμ=∫10μP(μ|D)dμ=E(μ|D) 2. 条件概率 ⇔ 边缘概率 ...