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.dry(反义词)__________________  2.writ...
复活节英文怎么说 复活节英文怎么说?复活节的英语翻译是什么?复活节:Easter;"Easter,anniversar...
2008年北京奥运会主题曲 2008年北京奥运会(第29届夏季奥林匹克运动会),2008年8月8日到2008年8月24日在中华人...
英语道歉信 英语道歉信15篇  在日常生活中,道歉信的使用频率越来越高,通过道歉信,我们可以更好地解释事情发生的...
六年级英语专题训练(连词成句... 六年级英语专题训练(连词成句30题)  1. have,playhouse,many,I,toy,i...
上班迟到情况说明英语   每个人都或多或少的迟到过那么几次,因为各种原因,可能生病,可能因为交通堵车,可能是因为天气冷,有...
小学英语教学论文 小学英语教学论文范文  引导语:英语教育一直都是每个家长所器重的,那么有关小学英语教学论文要怎么写呢...
英语口语学习必看的方法技巧 英语口语学习必看的方法技巧如何才能说流利的英语? 说外语时,我们主要应做到四件事:理解、回答、提问、...
四级英语作文选:Birth ... 四级英语作文范文选:Birth controlSince the Chinese Governmen...
金融专业英语面试自我介绍 金融专业英语面试自我介绍3篇  金融专业的学生面试时,面试官要求用英语做自我介绍该怎么说。下面是小编...
我的李老师走了四年级英语日记... 我的李老师走了四年级英语日记带翻译  我上了五个学期的小学却换了六任老师,李老师是带我们班最长的语文...
小学三年级英语日记带翻译捡玉... 小学三年级英语日记带翻译捡玉米  今天,我和妈妈去外婆家,外婆家有刚剥的`玉米棒上带有玉米籽,好大的...
七年级英语优秀教学设计 七年级英语优秀教学设计  作为一位兢兢业业的人民教师,常常要写一份优秀的教学设计,教学设计是把教学原...
我的英语老师作文 我的英语老师作文(通用21篇)  在日常生活或是工作学习中,大家都有写作文的经历,对作文很是熟悉吧,...
英语老师教学经验总结 英语老师教学经验总结(通用19篇)  总结是指社会团体、企业单位和个人对某一阶段的学习、工作或其完成...
初一英语暑假作业答案 初一英语暑假作业答案  英语练习一(基础训练)第一题1.D2.H3.E4.F5.I6.A7.J8.C...
大学生的英语演讲稿 大学生的英语演讲稿范文(精选10篇)  使用正确的写作思路书写演讲稿会更加事半功倍。在现实社会中,越...
VOA美国之音英语学习网址 VOA美国之音英语学习推荐网址 美国之音网站已经成为语言学习最重要的资源站点,在互联网上还有若干网站...
商务英语期末试卷 Part I Term Translation (20%)Section A: Translate ...