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 算法/// <summary>/// 局部算法/// 图像二值化的 NiBlack 算法/// https://blog.csdn.net/lucayhaozi/article/details/9967963/// </summary>/// <param name="data">灰度化后的图像byte数组</param>/// <param name="k"></param>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

C#,图像二值化(24)——局部阈值算法的NiBlack算法及源程序相关推荐

  1. 图像二值化_三角阈值法

    前言 一.三角阈值法是什么? 二.算法原理 1.算法 总结 参考文献 前言 图像二值化有很多方法,比较经典的为OTSU,三角阈值法,本文主要想一探三角阈值法的算法原理. 一.三角阈值法是什么? 三角阈 ...

  2. 图像二值化处理(全局阈值 自适应阈值 手动阈值操作以及直方图画法)

    文章目录 图像二值化处理 二值化原理 API介绍 手动设置阈值 均值法 迭代法 自动设置阈值 直方图法 全局阈值法 OTSU法 三角形法 自适应阈值法 API 绘制图像直方图 图像二值化处理 二值化原 ...

  3. java 用遗传算法解决图像二值化问题 找阈值

    image类对图像处理 import java.awt.image.BufferedImage; public class Image {public int h; //高public int w; ...

  4. 自适应阈值图像二值化

    一.二值化 关于二值化的介绍,以前的博客中有介绍,这里就不再描述了,二值化介绍:二值化分为固定阈值二值化和自适应阈值二值化,固定阈值二值化方式是我们常用的二值化方式,需要自己摸索一个经验阈值,不断调整 ...

  5. 【图像处理】——图像的二值化操作及阈值化操作(固定阈值法(全局阈值法——大津法OTSU和三角法TRIANGLE)和自适应阈值法(局部阈值法——均值和高斯法))

    目录 一.二值化的概念(实际上就是一个阈值化操作) 1.概念: 2.实现方法 3.常用方法 二.阈值类型 1.常见阈值类型(主要有五种类型) (1)公式描述 (2)图表描述 2.两种特殊的阈值算法(O ...

  6. OTSU_图像二值化分割阈值的算法

    简介: 大津法(OTSU)是一种确定图像二值化分割阈值的算法,由日本学者大津于1979年提出.从大津法的原理上来讲,该方法又称作最大类间方差法,因为按照大津法求得的阈值进行图像二值化分割后,前景与背景 ...

  7. 图像二值化(选择阈值)

    目录 1. 双峰法 2. 大津法(Otsu法或最大类间方差法) 1. 双峰法 在一些简单的图像中,物体的灰度分布比较有规律,背景与各个目标在图像 的直方图各自形成一个波峰,即区域与波峰一一对应,每两个 ...

  8. OpenCV-Python 图像二值化

    OpenCV-Python 图像二值化 一.什么是图像二值化 二.图像二值化 Ⅰ先获取阈值: Ⅱ根据阈值去二值化图像 ⅢOpenCV中的二值化方法 三.全局阈值函数cv2.threshold · 函数 ...

  9. 二值化图像的欧拉数_Android OpenCV(八):图像二值化

    图像二值化 简介 图像二值化( Image Binarization)就是将图像上的像素点的灰度值设置为0或255,也就是将整个图像呈现出明显的黑白效果的过程.在数字图像处理中,二值图像占有非常重要的 ...

  10. 数字图像基础——图像通道、空间域表示、图像二值化

    文章目录 一.数字彩色图像的组成结构? 二.数字图像是如何数字化存储的? 三.彩色图像的灰度化? 四.图像二值化 五.opencv实战 1.读取图像及验证图像通道 2.RGB2GRA 3.二值化 一. ...

最新文章

  1. 25种代码坏味道总结+优化示例
  2. 《XNA高级编程:Xbox 360和Windows》1-1
  3. 【AGC+FPGA】基于FPGA的数字AGC自适应增益设计,应用在BPSK调制解调系统中
  4. Python 3 利用 Dlib 和 sklearn 人脸笑脸检测机器学习建模
  5. Linux :IO多路复用模型
  6. java编写sql语句,java实现简单的给sql语句赋值的示例
  7. 动态库注入--APC注入
  8. AutoIt自动化编程(4)【转】
  9. Anguar 使用interceptor拦截器设置请求头传入jwt token
  10. Gantt - attachEvent所有事件(归类、索引)
  11. xci转化nsp_XCI转NSP格式 图文教程
  12. Unity 3D模型展示素材
  13. 在线旅游发展趋势分析
  14. AI读书笔记:《剑桥五重奏—机器能思考吗?》
  15. 计算机专业应届研究生面试自我介绍,计算机专业应届生面试自我介绍
  16. Thinkphp5 php会员实现单点登录
  17. 免费的ppt模板百度网盘资源
  18. kubernetes的DevOps业务(七):Jenkins,GitLab,Harbor,Tekton,GitOps
  19. EIE结构与算法映射
  20. 【20220207】【信号处理】希尔伯特变换定义及解调原理

热门文章

  1. 物联网毕设(智能灌溉系统 -- Android端)
  2. 电商系统搭建(商品订单模块)
  3. eclipse查看安装了哪些插件
  4. 互联网金融系列-支付清算体系介绍-下篇
  5. github项目的JAVA项目Ratel,基于Netty实现
  6. CVPR 2022|解耦知识蒸馏!旷视提出DKD:让Hinton在7年前提出的方法重回SOTA行列!...
  7. Windows 微信双开(批处理)
  8. 项目管理知识点-结合Enovia项目管理模块
  9. 最新MTK芯片型号汇总,MTK开发资料大全下载
  10. mixamo骨骼_mixamo动作库的模型和动作绑定控制器的方法-上集