Win8 Metro(C#)数字图像处理--2.46图像RGB分量增强效果
来源:互联网 发布:超融合云计算 编辑:程序博客网 时间:2024/05/22 15:50
[函数名称]
RGB分量调整 RGBAdjustProcess(WriteableBitmap src, int value,int threshould)
[算法说明]
RGB分量调整实际上是分别对每个像素的RGB三个分量进行调整,公式如下:
[函数代码]
/// <summary> /// R,G,B value adjusting. /// </summary> /// <param name="src">The source image.</param> /// <param name="value">To judge which one to adjust, R is 3, G is 2, B is 1.</param> /// <param name="threshould">It is a value to adjust the result image.</param> /// <returns></returns> public static WriteableBitmap RGBAdjustProcess(WriteableBitmap src, int value,int threshould)////41 RGB分量调整 { if (src != null) { int w = src.PixelWidth; int h = src.PixelHeight; WriteableBitmap srcImage = new WriteableBitmap(w, h); byte[] temp = src.PixelBuffer.ToArray(); if (value == 1) { for (int i = 0; i < temp.Length; i += 4) { temp[i] = (byte)(Math.Max(0, Math.Min((temp[i] + threshould), 255))); } } if (value == 2) { for (int i = 0; i < temp.Length; i += 4) { temp[i + 1] = (byte)(Math.Max(0, Math.Min((temp[i + 1] + threshould), 255))); } } if (value == 3) { for (int i = 0; i < temp.Length; i += 4) { temp[i + 2] = (byte)(Math.Max(0, Math.Min((temp[i + 2] + threshould), 255))); } } Stream sTemp = srcImage.PixelBuffer.AsStream(); sTemp.Seek(0, SeekOrigin.Begin); sTemp.Write(temp, 0, w * 4 * h); return srcImage; } else { return null; } }
0 0
- Win8 Metro(C#)数字图像处理--2.46图像RGB分量增强效果
- Win8 Metro(C#)数字图像处理--2.62图像对数增强
- Win8 Metro(C#)数字图像处理--2.63图像指数增强
- Win8 Metro(C#)数字图像处理--2.42图像光照效果算法
- Win8 Metro(C#)数字图像处理--2.43图像马赛克效果算法
- Win8 Metro(C#)数字图像处理--2.44图像油画效果算法
- Win8 Metro(C#)数字图像处理--2.45图像雾化效果算法
- Win8 Metro(C#) 数字图像处理--1 图像打开,保存
- Win8 Metro(C#)数字图像处理--2.35图像肤色检测算法
- Win8 Metro(C#)数字图像处理--2.39二值图像投影
- Win8 Metro(C#)数字图像处理--2.50图像运动模糊
- Win8 Metro(C#)数字图像处理--2.51图像统计滤波算法
- Win8 Metro(C#)数字图像处理--2.53图像傅立叶变换
- Win8 Metro(C#)数字图像处理--2.54迭代法图像二值化
- Win8 Metro(C#)数字图像处理--2.55OSTU法图像二值化
- Win8 Metro(C#)数字图像处理--2.56简单统计法图像二值化
- Win8 Metro(C#)数字图像处理--2.58双峰法图像二值化
- Win8 Metro(C#)数字图像处理--2.59 P分位法图像二值化
- 应届生面试,你准备好了吗?
- js取两个数组的交集
- POJ 2777-Count Color(线段树_区间染色)
- Android遇上打印机
- HDU4018 Parsing URL【水题】
- Win8 Metro(C#)数字图像处理--2.46图像RGB分量增强效果
- [后缀数组+dp/AC自动机+dp+线段树] hdu 4117 GRE Words
- 我们再也看不到“Win 10 破解版下载”
- 报表数据源之多结果集
- 史上最全设计模式导学目录(完整版)
- Java网络编程从入门到精通(23):HTTP消息头字段
- ORACLE9i_性能调优基础二(Database Configuration and IO Issues)
- vivado2014.2 zedboard 自制IP注意事项
- 自定义控件学习之钟表制作