原文:Win8 Metro(C#)数字图像处理--3.3图像直方图计算

        /// <summary>
/// Get the array of histrgram.
/// </summary>
/// <param name="src">The source image.</param>
/// <returns></returns>
public static int[] GetHistogramArray(WriteableBitmap src) ////34 图像直方图计算
{
if (src != null)
{
int[] histogram = new int[256];
int gray = 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);
histogram[gray]++;
}
return histogram;
}
else
{
return null;
}
}
}
}
最后,分享一个专业的图像处理网站(微像素),里面有很多源代码下载:

Win8 Metro(C#)数字图像处理--3.3图像直方图计算的更多相关文章

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

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

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

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

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

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

  4. Win8 Metro(C#)数字图像处理--3.1图像均值计算

    原文:Win8 Metro(C#)数字图像处理--3.1图像均值计算 /// <summary> /// Mean value computing. /// </summary> ...

  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. 让Apache 和nginx支持跨域訪问

    1,怎样让Apache支持跨域訪问呢? 步骤: 改动httpd.conf,windows中相应的文件夹是:C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf ...

  2. kali 系统的源

    sources.list deb http://http.kali.org/kali kali-rolling main non-free contrib deb http://mirrors.ust ...

  3. numpy tricks(二)—— 删除多维数组的行或列

    numpy.delete numpy 下的多维数组,如果要删除其中的某些行,或某些列,不可以用置空的方式,进行设置: A[1, :] = None, ⇒ 会将 A 中的第一行数据全部置为 Nan 1. ...

  4. 利用for循环的嵌套输出图形--课后作业

    for (int i = 1; i <= 8; i++) { int a, b; for (a = 1; a < i; a++) Console.Write(" "); ...

  5. 【a803】营救

    Time Limit: 10 second Memory Limit: 2 MB 问题描述 铁达尼号遇险了!它发出了求救信号.距离最近的哥伦比亚号收到了讯息,时间就是生命,必须尽快赶到那里.通过侦测, ...

  6. 【第400篇题解纪念2016年10月28日】【28.10%】【codeforces 617E】XOR and Favorite Number

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  7. ThoughtWorks、Teambition、Trello、Slack、DevCloud 主流敏捷软件开发工具平台比较

    在大公司做了6年程序员,2年项目经理的小王,正在创业公司迎来他焦虑的而立之年. 但是对于3个月前加入创业公司的决定,他现在有些烦躁和怀疑人生.在他过往的经验看来,公司新接的小项目,在过去的大公司里1个 ...

  8. Android--MVP设计模式实践

    MVP设计模式是android开发讨论的很火的一个话题,我对设计模式也有一些拙见,为了实践我的一些想法,我在我最新开发的产品中将我心目中的MVP设计模式进行了实践,最后得到了这样的架构. 特点:简单, ...

  9. google地图API的简单使用

    <div id="contact_container" style="width:700px;height:600px;"></div> ...

  10. Information centric network (icn) node based on switch and network process using the node

    The present invention relates to an apparatus for supporting information centric networking. An info ...