1、图像二值化概述

图像二值化是将彩色图像转换为黑白图像。大多数计算机视觉应用程序将图片转换为二进制表示。图像越是未经处理,计算机就越容易解释其基本特征。

二值化过程

在计算机存储器中,所有文件通常以灰度级的形式存储,灰度级具有从0到255的最大256个不同灰度值。每个灰度值生成灰度调色板的不同颜色。如果需要文档图像中的某些信息,则需要进行多次操作。为了减少提取图像部分所需的时间,二进制图像更有用。

二值化是将任何灰度图像(多色调图像)转换为黑白图像(双色调图像)的方法。要执行二值化处理,首先找到灰度的阈值,并检查像素是否具有特定的灰度值。

如果像素的灰度值大于阈值,则将这些像素转换为白色。类似地,如果像素的灰度值小于阈值,则这些像素被转换为黑色。

下面讨论了两种类型的二值化方法——

i、 基于全局或单个阈值的二值化

二。基于区域的二值化

1.基于全局或单个阈值的二值化:通常,找到整个图像的全局阈值,并使用单个阈值对图像进行二值化。但是在这种单阈值方法中,图像的局部方差通常丢失或被抑制,这可能具有一些重要的信息或内容。

2.基于区域的二值化:还设计了另一种用于二值化的方法,其中阈值根据区域来确定。实际上,图像被划分为几个区域或窗口。每个区域或窗口计算或决定自己的局部阈值,然后根据Saha,借助其局部阈值将其区域转换为双色调区域。

在实际场景中,二值化过程失败,因为可能由于图像采集过程效率低、原始源质量差或原始源上的照明不均匀而导致退化。

Image binarization is turning a color image into a black-and-white one. Most computer vision applications transform the picture into a binary representation. The more unprocessed an image is, the simpler it is for the computer to interpret its underlying characteristics.

Binarization Process
In the computer memory generally all the documents are stored in the form of gray level which has a maximum 256 different gray values from 0 to 255. Each gray value generates the different color of the gray scale palette. If some information is required from the document image, then this is required to process the action number of times. To reduce this time requirement for extracting the part of the image, binary image is more useful.

Binarization is the method of converting any gray – scale image (multi tone image) into black – white image (two tone image) . To perform binarization process, first find the threshold value of gray scale and check whether a pixel having a particular gray value or not.

If the gray value of the pixels is greater than the threshold, then those pixels are converted into the white . Similarly if the gray value of the pixels is lesser than the threshold, then those pixels are converted into the black .

There is two type of binarization method is discuss below –

i. Binarization based on Global or Single Threshold
ii. Binarization based on Region

1. Binarization based on Global or Single Threshold: Normally, find the global threshold for the whole image and binarize the image using single threshold. But in this single threshold method generally the local variance of the image is lost or suppressed which may be having some important information or contents.

2. Binarization based on Region: One another method is also designed for binarization in which threshold decide according to the region. Actually the image is divided into several regions or windows. Each region or window calculate or decide their own local threshold and then convert their region into two – tone region by the help of their local threshold according of the Saha .

The binarization process is failed in the practical scenario because of degradation may be occur due to less efficient acquisition process of image, poor quality of original source or non – uniform illumination over the original source.

2、基于双峰平均值的阈值算法与源程序

二值算法综述请阅读:

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

using System;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.Drawing.Imaging;namespace Legalsoft.Truffer.ImageTools
{public static partial class BinarizationHelper{#region 灰度图像二值化 全局算法 基于双峰平均值的阈值/// <summary>/// 基于双峰平均值的阈值/// 该算法和基于谷底最小值的阈值方法类似,/// 只是最后一步不是取得双峰之间的谷底值,/// 而是取双峰的平均值作为阈值。/// </summary>/// <param name="histogram"></param>/// <returns></returns>public static int Intermodes_Threshold(int[] histogram){double[] HistGramC = Histogram_To_Float(histogram);double[] HistGramCC = Histogram_To_Float(histogram);int Iter = 0;while (Is_Dimodal_Histogram(HistGramCC) == false){HistGramCC[0] = (HistGramC[0] + HistGramC[0] + HistGramC[1]) / 3;for (int i = 1; i < 255; i++){HistGramCC[i] = (HistGramC[i - 1] + HistGramC[i] + HistGramC[i + 1]) / 3;}HistGramCC[255] = (HistGramC[254] + HistGramC[255] + HistGramC[255]) / 3;System.Buffer.BlockCopy(HistGramCC, 0, HistGramC, 0, 256 * sizeof(double));Iter++;if (Iter >= 10000){return -1;}}int[] Peak = new int[2];for (int i = 1, Index = 0; i < 255; i++){if (HistGramCC[i - 1] < HistGramCC[i] && HistGramCC[i + 1] < HistGramCC[i]){Peak[Index++] = i - 1;}}return ((Peak[0] + Peak[1]) / 2);}public static void Intermodes_Algorithm(byte[,] data){int[] histogram = Gray_Histogram(data);int threshold = Intermodes_Threshold(histogram);Threshold_Algorithm(data, threshold);}#endregion    }
}

3、基于双峰平均值的阈值算法的计算效果

C#,图像二值化(13)——全局阈值的双峰平均值算法(Bimodal Thresholding)与源程序相关推荐

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  9. OpenCV-Python 图像二值化

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

最新文章

  1. php修改为ajax,php通过ajax实现双击table修改内容
  2. core data 学习笔记
  3. 清华「计图」现在支持国产芯片了!动态图推理比PyTorch快了270倍
  4. SharePoint 2010开发实例精选——“每日一句”WebPart
  5. 动量策略 python_在Python中使用动量通道进行交易
  6. labview列表框禁用鼠标单击_【跟我学LabVIEW】什么是局部变量?如何创建及使用局部变量?...
  7. 计算机无法启动windows无线服务,win10无线服务无法启动怎么解决
  8. C++ Primer Plus学习(四)—— string类实践
  9. CSS3 3D切割轮播图
  10. Linux安装docker-ce教程 centos依赖包安装
  11. 深度学习--二值神经网络BNN基础概念学习总结+官方代码解析
  12. A novel hybrid intrusion detection method integrating anomalydetection with misuse detection
  13. 【黑苹果装机实践】从硬件选择到系统安装
  14. 吴恩达机器学习笔记第一周
  15. maven 创建java项目_手把手教你创建Java Maven依赖项目
  16. 陀螺年度好文回顾|区块链跨链互操性的意义和应用案例
  17. 线性代数中的余子式、代数余子式、行列式
  18. AutoJs学习-文字转语音QQ发送
  19. 剑英陪你玩转图形学 (三)归去来
  20. Rect定义的参数含义

热门文章

  1. windows下安装与使用pix2tex(mathpix免费替代版)
  2. 论文页眉设置 奇偶页页眉均为章序及章标题 论文按章节设置页眉
  3. 大量C语言、C++、C#、VC编程相关书籍下载
  4. Why-How-What黄金圈法则 的理解和运用
  5. 我的大学六年 郭天祥
  6. 【笔记】openwrt - full cone NAT(全锥NAT)、解决“arp_cache: neighbor table overflow!”
  7. PDF分割与合并(充分利用Spire的bug实现操作PDF)
  8. 智能镜——6.屏幕显示时间日期篇
  9. 【小程序】地图的基本使用
  10. Android 音频源码分析——音频设备切换(插入耳机)