1 模糊集理论
模糊集理论,也称为模糊集合论,或简单地称为模糊集,1965年美国学者扎德在数学上创立了一种描述模糊现象的方法—模糊集合论。这种方法把待考察的对象及反映它的模糊概念作为一定的模糊集合,建立适当的隶属函数,通过模糊集合的有关运算和变换,对模糊对象进行分析。模糊集合论以模糊数学为基础,研究有关非精确的现象。客观世界中,大量存在着许多亦此亦彼的模糊现象。
Fuzzy set theory, also known as fuzzy set theory, or simply called fuzzy sets, was founded by American scholar Zade in 1965 to describe fuzzy phenomena mathematically - fuzzy set theory. This method takes the object to be investigated and the fuzzy concept reflecting it as a certain fuzzy set, establishes an appropriate membership function, and analyzes the fuzzy object through relevant operations and transformations of the fuzzy set. Based on fuzzy mathematics, fuzzy set theory studies the imprecise phenomena. In the objective world, there are a lot of fuzzy phenomena.
2 模糊集理论算法论文
这是篇很古老的论文中的算法,发表与1994年,是清华大学黄良凯(Liang-kai Huang) 所写,因此国外一些论文里和代码里称之为Huang's fuzzy thresholding method。虽然古老也很简单,但是其算法的原理还是值得学习的。
该论文的原文可从此处下载:
《Image thresholding by minimizing the measure of fuzziness》
该论文结合了当时处于研究热潮的模糊集理论,提出了一种具有较好效果的图像二值化算法,本文主要是对其进行简单的翻译和注释,并提供了测试C#代码。
本文介绍了一种新的基于最小化输入图像模糊性度量的图像阈值处理方法。阈值方法中的隶属函数用于表示像素与其所属区域(对象或背景)之间的特征关系。此外,基于模糊性度量,定义了一个模糊范围,以在该范围内找到合适的阈值。该方法的原理易于理解,可以直接扩展到多级阈值。通过使用具有各种类型直方图的测试图像,说明了新方法的有效性。实验结果表明,该方法在两级和三级阈值处理中表现出良好的性能。
This paper introduces a new image thresholding method based on minimizing the measures of fuzziness of an input image. The membership function in the thresholding method is used to denote the characteristic relationship between a pixel and its belonging region (the object or the background). In addition, based on the measure of fuzziness, a fuzzy range is defined to find the adequate threshold value within this range. The principle of the method is easy to understand and it can be directly extended to multilevel thresholding. The effectiveness of the new method is illustrated by using the test images of having various types of histograms. The experimental results indicate that the proposed method has demonstrated good performance in bilevel and trilevel thresholding.
3 模糊集理论算法源程序
二值算法综述请阅读:
C#,图像二值化(01)——二值化算法综述与二十三种算法目录
https://blog.csdn.net/beijinghorn/article/details/128425225?spm=1001.2014.3001.5502
支持函数请阅读:
C#,图像二值化(02)——用于图像二值化处理的一些基本图像处理函数之C#源代码
https://blog.csdn.net/beijinghorn/article/details/128425984?spm=1001.2014.3001.5502
namespace Legalsoft.Truffer.ImageTools
{
public static partial class BinarizationHelper
{
#region 灰度图像二值化 全局算法 模糊集理论算法
/// <summary>
/// 基于模糊集理论的一种图像二值化算法的原理、实现效果及代码
/// https://www.cnblogs.com/Imageshop/p/3302850.html
/// </summary>
/// <param name="histogram"></param>
/// <returns></returns>
public static int Huang_Fuzzy_Threshold(int[] histogram)
{
int left = Histogram_Left(histogram);
int right = Histogram_Right(histogram);
int[] S = new int[right + 1];
int[] W = new int[right + 1];
S[0] = histogram[0];
for (int Y = left > 1 ? left : 1; Y <= right; Y++)
{
S[Y] = S[Y - 1] + histogram[Y];
W[Y] = W[Y - 1] + Y * histogram[Y];
}
double[] Smu = new double[right + 1 - left];
for (int Y = 1; Y < Smu.Length; Y++)
{
double mu = 1 / (1 + (double)Y / (right - left));
Smu[Y] = -mu * Math.Log(mu) - (1 - mu) * Math.Log(1 - mu);
}
int Threshold = -1;
double BestEntropy = Double.MaxValue;
for (int Y = left; Y <= right; Y++)
{
double Entropy = 0.0;
int mu = (int)Math.Round((double)W[Y] / S[Y]);
for (int X = left; X <= Y; X++)
{
Entropy += Smu[Math.Abs(X - mu)] * histogram[X];
}
mu = (int)Math.Round((double)(W[right] - W[Y]) / (S[right] - S[Y]));
for (int X = Y + 1; X <= right; X++)
{
Entropy += Smu[Math.Abs(X - mu)] * histogram[X];
}
if (BestEntropy > Entropy)
{
BestEntropy = Entropy;
Threshold = Y;
}
}
return Threshold;
}
public static void Huang_Fuzzy_Algorithm(byte[,] data)
{
int[] histogram = Gray_Histogram(data);
int threshold = Huang_Fuzzy_Threshold(histogram);
Threshold_Algorithm(data, threshold);
}
#endregion
}
}