C#,图像二值化(24)——局部阈值算法的NiBlack算法及源程序
创始人
2024-05-12 05:17:44
0

1、局部阈值算法的NiBlack算法

摘要-医学图像的处理最为复杂人和计算机。磁性捐赠的脑组织共振成像(MRI)在许多领域是非常重要的问题例如手术和治疗。最常见的分割图像的最简单方法是使用阈值。在这项工作中,我们提出了一个有效的实现阈值,并给出详细的比较了现有的局部阈值算法。

Niblack阈值算法在预处理的输入MRI图像。输出结果如下根据区域不均匀性质量度量进行处理,以及

高效实施的质量。我们的实施是适用于处理MR脑图像分割对象的交互式平滑边界。

关键词-磁共振成像,阈值,Niblack,区域不均匀性

一、 引言

属于对象的像素的灰度级为与像素的灰度级完全不同属于背景,在图像的许多应用中处理。阈值处理变得简单,但将前景对象与出身背景我们可以将图像中的像素分成两个主要群体,根据其灰度等级。这些灰度级可以用作“检测器”,以区分背景和对象被视为前景图像[1]。在这两个主要颜色之间选择一个灰度级

灰度级组,将作为阈值区分两组(对象和背景)。图像分割由边界等执行检测或区域相关技术。但是阈值技术更加完善、简单广泛使用[2]。不同的二值化方法执行以评估不同类型的数据。这个在灰度级中使用局部自适应二值化方法低对比度、背景强度变化的图像以及噪声的存在。Niblack的方法用于灰度图像中的阈值处理效果更好,但它仍然是对其进行了修改,以获得更好的结果[3]。在这项工作中,Niblock算法的输入数据为在一些预处理下增强输出数据。这个MRI脑图像自然具有低对比度。这低对比度图像也得到增强结果从背景分析对象。当地人直方图均衡对输入图像进行了增强[12],[13]. 直方图均衡生成灰度图。它更改图像的直方图并重新排列所有像素值尽可能接近用户指定的期望值直方图。直方图均衡丰富了较低的局部对比度以获得较高的对比度。本文的组织结构如下,第二节为目的是呈现关于图像阈值的信息。详细解释了局部自适应阈值技术在第三节中,第四节侧重于Niblack算法的实现。视觉结果和第四节的质量度量结果在第节中讨论五、 最后,第六节包含结论。

二、阈值

简单地,阈值的基本函数[5]创建通过旋转所有像素从灰度级图像中提取二值图像

低于某个阈值为零且所有像素高于该阈值阈值设置为一[1],[5]。如果g(x,y)是如果f(x,y)T在某个全局阈值T时等于1否则为零[1]。阈值技术一般可分为两类,如全局阈值和局部阈值阈值。全局阈值方法考虑单个强度阈值。局部阈值方法计算图像中每个像素的阈值其附近的内容[13]。它认为图像中所有强度级别的存在。所以当地人阈值方法通常对低质量图像[3]。我们将阈值方法分组根据他们利用的信息。直方图基于形状的方法,该方法使用了波峰、波谷并分析平滑直方图的曲率。

基于聚类的方法在灰度级样本分为两部分作为背景和前景(对象)。基于熵的方法导致使用原始数据之间的交叉熵的算法以及二值化图像、前景的熵和背景区域[3]、[4]。基于对象属性的方法;搜索灰度级和二值化图像,如边缘重合、模糊形状相似性空间方法使用了像素和/或高阶概率分布。地方的方法使每个像素上的阈值适应本地图像特征[4]。

Abstract— Medical images are most complicated to process by

human and computer. Brain tissue donated by magnetic

resonance imaging (MRI) is very important issue in many

applications such as surgery and treatments. Most common

and simplest approach to segment an image is using

thresholding. In this work we present an efficient

implementation for threshoding and give a detailed

comparison of some existing local thresholding algorithm.

Niblack thresholding algorithm is implemented on

preprocessed input MRI image. The output results are

processed under Region Nonuniformity quality metrics and

the quality of efficient implementation. Our implementation is

suitable for processing the MR brain images, making

interactive smooth boundaries to the segmented object.

Keywords— Magnetic resonance imaging, thresholding,

Niblack, Region Nonuniformity

I. INTRODUCTION

The gray levels of pixels belonging to the object are

entirely different from the gray levels of the pixels

belonging to the background, in many applications of image

processing. Thresholding becomes then a simple but

effective tool to separate those foreground objects from the

background. We can divide the pixels in the image into two

major groups, according to their gray-level. These graylevels may serve as “detectors” to distinguish between

background and objects is considering as foreground in the

image [1]. Select a gray-level between those two major

gray-level groups, which will serve as a threshold to

distinguish the two groups (objects and background).

Image segmentation is performed by such as boundary

detection or region dependent techniques. But the

thresholding techniques are more perfect, simple and

widely used [2]. Different binarization methods have been

performed to evaluate for different types of data. The

locally adaptive binarization method is used in gray scale

images with low contrast, Varity of background intensity

and presence of noise. Niblack’s method was found for

better thresholding in gray scale image, but still it has been

modified for fine and better result [3].

In this work the input data of the Niblock algorithm is

under some preprocess for enhanced the output data. The

MRI brain images are naturally having low contrast. This

low contrast images also enhanced and produce a better

result to analysis the object from the background. The Local

Histogram Equalization is enhanced the input image [12],

[13]. Histogram Equalization generates a gray map. It

changes the histogram of an image and rearranges all pixels

values to be as close as possible to a user specified desired

histogram. Histogram Equalization enriches the areas of

lower local contrast to gain a higher contrast.

This paper is organized as follows, section II is for the

purpose of presenting information about image thresholding.

Local adaptive thresholding technique is explained detailed

in section III. Section IV focused the efficient

implementation of Niblack algorithm. Visual results and

quality metric results of section IV are discussed in section

V. Finally section VI contains the conclusion.

II. THRESHOLDING

Simply the basic function [5] for thresholding creates the

binary image from gray level ones by turning all pixels

below some threshold to zero and all pixels above that

threshold to one [1],[5]. If g(x, y) is a threshold version of

f(x, y) at some global threshold T. g is equal to 1 if f(x, y) T

and zero otherwise [1].

Thresholding techniques can be classified generally into

two categories like Global thresholding and Local

thresholding. Global thresholding methods consider a single

intensity threshold value. Local thresholding methods

compute a threshold for each pixel in the image on the basis

of the content in its neighbourhood [13]. It considers

presences of all intensity level in the image. So the local

thresholding methods generally perform better for low

quality images [3].

We categorize the thresholding methods in groups

according to the information they are exploiting. Histogram

shape-based methods, this method used the peaks, valleys

and curvatures of the smoothed histogram are analyzed.

Clustering-based methods perform where the gray-level

samples are clustered in two parts as background and

foreground (object). Entropy-based methods result in

algorithms that use the cross-entropy between the original

and binarized image, the entropy of the foreground and

background regions [3], [4]. Object attribute-based methods;

search a similarity measure between the gray-level and the

binarized images, such as edge coincidence, fuzzy shape

similarity. The spatial methods use correlation between

pixels and/or higher-order probability distribution. Local

methods adapt the threshold value on each pixel to the local

image characteristics [4].

2、局部阈值算法的NiBlack算法源程序

二值算法综述请阅读:

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.Binarization
{
public static partial class BinarizationHelper
{#region 灰度图像二值化 局部算法 NiBlack 算法/// /// 局部算法/// 图像二值化的 NiBlack 算法/// https://blog.csdn.net/lucayhaozi/article/details/9967963/// /// 灰度化后的图像byte数组/// public static void Niblack_Algorithm(byte[,] data, double k = -0.1){int height = data.GetLength(0);int width = data.GetLength(1);int Niblack_s = Math.Max(5, width / 32);int Niblack_q = Math.Max(5, height / 32);byte[,] dump = (byte[,])data.Clone();for (int y = 0; y < height; y++){for (int x = 0; x < width; x++){int begin_y = Math.Max(0, y - Niblack_q);int begin_x = Math.Max(0, x - Niblack_s);int end_y = Math.Min(height, y + Niblack_q);int end_x = Math.Min(width, x + Niblack_s);//if (begin_y < 0) begin_y = 0;//if (begin_x < 0) begin_x = 0;//if (end_y > height) end_y = height;//if (end_x > width) end_x = width;//该领域内总的像素点数double mean = 0.0;int total = (end_y - begin_y) * (end_x - begin_x);for (int yy = begin_y; yy < end_y; yy++){for (int xx = begin_x; xx < end_x; xx++){mean += dump[yy, xx];}}//计算在该小领域内灰度值总和//该领域的平均灰度mean /= (double)total;double std_error = 0.0;for (int yy = begin_y; yy < end_y; yy++){for (int xx = begin_x; xx < end_x; xx++){std_error += (mean - dump[yy, xx]) * (mean - dump[yy, xx]);//std += sq;}}//求出该领域内总的方差和std_error /= (double)total;//求出标准差std_error = (Math.Abs(std_error) < float.Epsilon) ? 0.0 : Math.Sqrt(std_error);//求出所得到的的阈值double threshold = mean + k * std_error;data[y, x] = (byte)((dump[y, x] > threshold) ? 255 : 0);}}}#endregion}
}

3、局部阈值算法的NiBlack算法及源程序计算效果

POWER BY 315SOFT.COM & TRUFFER.CN

相关内容

热门资讯

怎么用勇武来造句 怎么用勇武来造句  1、通过你的努力,你已经让一名勇武的伍基人获得了自由。  2、文职首领的职位多为...
分庭抗礼造句 分庭抗礼造句  分庭抗礼原指宾主相见,分站在庭的两边,相对行礼。现比喻平起平坐,彼此对等的关系。大家...
闭口不言成语造句 闭口不言成语造句  1、为此,我不能再闭口不言,我要吐露我心灵的忧愁,陈述我灵魂的苦楚。  2、当我...
娘造句有哪些 娘造句有哪些  1、娘家造句:我们也可以说,虽然苔丝以前的那番经历暂时把她完全压倒了,但是母亲的娘家...
犹豫的反义词及相关造句 犹豫的反义词及相关造句  人就是一生,其实就是在不断犹豫中成熟的。接下来小编为你带来犹豫的反义词及相...
百炼成钢造句   解放军战士百炼成钢,练就一身杀敌本领。  他身经百战,百炼成钢,是大家公认的号将军。  年轻人只...
弟妹的词语造句 弟妹的词语造句  指懂得并使用字词,按照一定的句法规则造出字词通顺、意思完整、符合逻辑的句子。依据现...
时而时而怎么造句 时而时而怎么造句  导语:时而时而怎么造句呢?小学生因为词汇量有限的缘故,在造句上总会大伤脑筋,其实...
灰浆的造句 灰浆的造句  灰浆拼音  【注音】: hui jiang  灰浆解释  【意思】:(1)石灰、水泥或...
“屹立不动”造句 1、这是胜败的关键时刻,指挥员屹立不动,坚毅如钢。2、我们不必急着想当什么。先学习富士山屹立不动,不...
“汗马功劳”造句 1、 他为我军又夺一个阵地,立下汗马功劳。2、 他为人民的事业立下了汗马功劳。3、 革命前辈们为我们...
烟消云散造句 烟消云散造句大全  (1) 我不只在我里,我在风我在海我在陆地我在星,你必须少爱我一点,才能去爱那藏...
我是什么我是什么造句 我是什么我是什么造句  造句是一个非常基础的语文写作能力,那么你会用我是什么我是什么来造句吗?下面一...
舍本逐末造句   舍本逐末造句  1、错误原因是舍本逐末,不知设计质量、过程质量与系统质量才是从事改进的正路。  ...
“青丝”造句 101、“难怪初会庞小姐似曾相识,水灵的眼神修竹的鼻子新月的朱唇,简直燕子归来!”老先生压低声音补了...
“坍塌”造句 51、 同时,不幸的消息传来,在震央东南部的都江堰,一所学校坍塌现场,900名学生被埋,至少50名死...
熟路的解释及造句 熟路的解释及造句  熟路拼音  【注音】: shu lu  熟路解释  【意思】:常走而熟悉的道路。...
用喜出望外怎么造句 用喜出望外怎么造句  【喜出望外解释】:望:希望,意料。由于没有想到的好事而非常高兴。下面是小编整理...
杯弓蛇影的造句 杯弓蛇影的造句精选  导语:杯弓蛇影是指对人的态度和某些行为疑神疑鬼。那如何造句呢?下面是小编搜集整...
“夕阳”造句 151、太阳,在走过了辉煌的路程后,渐渐西沉下去,依然,留下黄昏那静静的美丽,留下一种坦然宁静的庄严...