原文:Win8 Metro(C#)数字图像处理--3.1图像均值计算

        /// <summary>
/// Mean value computing.
/// </summary>
/// <param name="src">The source image.</param>
/// <returns></returns>
public static double GetMeanProcess(WriteableBitmap src) ////32 图像均值计算
{
if (src != null)
{
double mean = 0.0;
int sum = 0;
int gray = 0,number=0;
byte[] temp = src.PixelBuffer.ToArray();
for (int i = 0; i < temp.Length; i += 4)
{
gray = (int)(temp[i] * 0.114 + temp[i + 1] * 0.587 + temp[i + 2] * 0.299);
sum += gray;
number++;
}
mean =(double)(sum/number);
return mean;
}
else
{
return 0;
}
}

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

Win8 Metro(C#)数字图像处理--3.1图像均值计算的更多相关文章

  1. Win8 Metro(C#)数字图像处理--3.2图像方差计算

    原文:Win8 Metro(C#)数字图像处理--3.2图像方差计算 /// <summary> /// /// </summary>Variance computing. / ...

  2. Win8 Metro(C#)数字图像处理--3.3图像直方图计算

    原文:Win8 Metro(C#)数字图像处理--3.3图像直方图计算 /// <summary> /// Get the array of histrgram. /// </sum ...

  3. Win8 Metro(C#)数字图像处理--3.4图像信息熵计算

    原文:Win8 Metro(C#)数字图像处理--3.4图像信息熵计算 [函数代码] /// <summary> /// Entropy of one image. /// </su ...

  4. Win8 Metro(C#)数字图像处理--3.5图像形心计算

    原文:Win8 Metro(C#)数字图像处理--3.5图像形心计算 /// <summary> /// Get the center of the object in an image. ...

  5. Win8 Metro(C#)数字图像处理--2.74图像凸包计算

    原文:Win8 Metro(C#)数字图像处理--2.74图像凸包计算 /// <summary> /// Convex Hull compute. /// </summary> ...

  6. Win8 Metro(C#)数字图像处理--2.68图像最小值滤波器

    原文:Win8 Metro(C#)数字图像处理--2.68图像最小值滤波器 /// <summary> /// Min value filter. /// </summary> ...

  7. Win8 Metro(C#)数字图像处理--2.52图像K均值聚类

    原文:Win8 Metro(C#)数字图像处理--2.52图像K均值聚类  [函数名称]   图像KMeans聚类      KMeansCluster(WriteableBitmap src,i ...

  8. Win8 Metro(C#)数字图像处理--2.45图像雾化效果算法

    原文:Win8 Metro(C#)数字图像处理--2.45图像雾化效果算法 [函数名称]   图像雾化         AtomizationProcess(WriteableBitmap src,i ...

  9. Win8 Metro(C#)数字图像处理--2.46图像RGB分量增强效果

    原文:Win8 Metro(C#)数字图像处理--2.46图像RGB分量增强效果  [函数名称] RGB分量调整         RGBAdjustProcess(WriteableBitmap  ...

随机推荐

  1. [tmux] Customize tmux with tmux.conf

    You can modify tmux's behavior with your tmux configuration file, .tmux.conf. You can use your tmux ...

  2. php中的foreach如何使用?

    php中的foreach如何使用? 一.总结 1.foreach (array_expression as $value) 2.foreach (array_expression as $key =& ...

  3. 使用搜狐Sendcloud的Webapi发送邮件:Jodd和Apache Httpclient

    最近,在使用搜狐Sendcloud发邮件.    Sendcloud提供http格式的webapi,方便地发送邮件,当然是要付费的. 很早之前,http工具一直用Httpclient,后来觉得jodd ...

  4. 【poj 1704】Georgia and Bob

    Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9776 Accepted: 3222 Description Georgia a ...

  5. [React Router v4] Use the React Router v4 Link Component for Navigation Between Routes

    If you’ve created several Routes within your application, you will also want to be able to navigate ...

  6. Go语言:正則表達式的使用

    Go语言的正則表達式使用非常easy.演示样例代码: package test import ( "fmt" "regexp" ) func RegixBase ...

  7. Linux下新手怎样将VIM配置成C++编程环境(能够STL自己主动补全)

    ~ 弄拉老半天,最终弄的几乎相同啦,果然程序猿还是须要有点折腾精神啊. 首先你要安装vim,命令:sudo apt-get install vim vim它仅仅是一个编辑器,它不是IDE(比方code ...

  8. Web报表进度条显示

    创建插件 <script src="../CreateControl.js" type="text/javascript"></script& ...

  9. SpringCloud学习笔记-zuul网关

    公司目前使用的是dubbo方式实现微服务,想试水改造接口层服务为Spring Cloud, 以下是网络拓补图. 第一层负载均衡可以用nginx或者zuul(即有2层zuul), 本图画的是nginx. ...

  10. css3中的制作动画小总结

    系列教程 CSS3属性中有关于制作动画的三个属性:Transform,Transition,Animation: Transform 在CSS3中transform主要包括以下几种:旋转rotate. ...