C#,图像二值化(08)——灰度图像二值化,全局算法,全局阈值优化算法及其源代码

news2024/9/24 21:26:57

1、全局阈值算法

基于灰度直方图的优化迭代算法之一。

Iterative Scheduler and Modified Iterative Water-Filling
In the downlink, the inter-cell interference is only function of the power levels and is independent of the user scheduling decisions. This suggests that the user scheduling and the power allocation can be carried out separately. An iterative scheduler can be derived so that the best user to schedule are first found assuming a fixed power allocation, then the best power allocation are computed for the fixed scheduled users [VPW09, YKS10]. If the iteration always increases the objective function monotonically, one can guarantee the convergence of the scheduler to at least a local optimum.

 二值算法综述请阅读:

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

2、全局阈值算法的源程序

using System;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Drawing.Imaging;

namespace Legalsoft.Truffer.ImageTools
{
    public static partial class BinarizationHelper
    {

        #region 灰度图像二值化 全局算法 全局阈值算法

        /// <summary>
        /// 基本全局阈值法
        /// https://blog.csdn.net/xw20084898/article/details/17564957
        /// </summary>
        /// <param name="histogram"></param>
        /// <returns></returns>
        private static int Basic_Global_Threshold(int[] histogram)
        {
            double t = Histogram_Sum(histogram);
            double u = Histogram_Sum(histogram, 1);
            int k2 = (int)(u / t);

            int k1;
            do
            {
                k1 = k2;
                double t1 = 0;
                double u1 = 0;
                for (int i = 0; i <= k1; i++)
                {
                    t1 += histogram[i];
                    u1 += i * histogram[i];
                }
                int t2 = (int)(t - t1);
                double u2 = u - u1;
                if (t1 != 0)
                {
                    u1 = u1 / t1;
                }
                else
                {
                    u1 = 0;
                }
                if (t2 != 0)
                {
                    u2 = u2 / t2;
                }
                else
                {
                    u2 = 0;
                }
                k2 = (int)((u1 + u2) / 2);
            } while (k1 != k2);

            return (k1);
        }

        public static void Global_Threshold_Algorithm(byte[,] data)
        {
            int[] histogram = Gray_Histogram(data);
            int threshold = Basic_Global_Threshold(histogram);
            Threshold_Algorithm(data, threshold);
        }

        #endregion

    }
}

3、全局阈值算法的计算效果

The thematic series Iterative Methods and Optimization Algorithms is devoted to the latest achievements in the field of iterative methods and optimization theory for single-valued and multi-valued mappings. The series is related to the significant contributions in these fields of Professor Hong-Kun Xu, as well as to some important recent advances in theory, computation, and applications.

In this chapter we focus on general approach to optimization for multivariate functions. In the previous chapter, we have seen three different variants of gradient descent methods, namely, batch gradient descent, stochastic gradient descent, and mini-batch gradient descent. One of these methods is chosen depending on the amount of data and a trade-off between the accuracy of the parameter estimation and the amount time it takes to perform the estimation. We have noted earlier that the mini-batch gradient descent strikes a balance between the other two methods and hence commonly used in practice. However, this method comes with few challenges that need to be addressed. We also focus on these issues in this chapter.

Learning outcomes from this chapter:
Several first-order optimization methods
Basic second-order optimization methods

This chapter closely follows chapters 4 and 5 of (Kochenderfer and Wheeler 2019). There are many interesting textbooks on optimization, including (Boyd and Vandenberghe 2004), (Sundaram 1996), and (Nesterov 2004),

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/130277.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

俺的2022年

年末将至&#xff0c;还是要写点总结性的内容&#xff0c;以回顾过去一年做的各种事情。工作之外从客观数据上看&#xff0c;今年的收入水平略差于去年&#xff0c;主要是工作外的收入有所减少&#xff0c;其核心原因是没有录制新的课程内容进行变现&#xff0c;原本的计划是&a…

【自学Python】Python介绍

Python教程 什么是编程语言 编程语言&#xff08;programming language&#xff09;&#xff0c;是用来定义计算机程序的形式语言。它是一种被标准化的交流技巧&#xff0c;用来向计算机发出指令。 也可以说&#xff0c;计算机语言让程序员能够准确地定义计算机所需要使用的…

拓展交流空间,分享开发精彩 | 开发者说·DTalk 鉴赏

日月其迈&#xff0c;岁律更新&#xff0c;时间的洗礼让开发者们更加坚韧&#xff0c;持续探索&#xff0c;不断追求&#xff0c;同样也激励着我们为开发者提供更多的帮助与支持。不断迭代的技术产品是开发者们的趁手工具&#xff0c;定期更新的政策助力打造安全可靠的生态&…

基础数学(4)——线性回归复习

文章目录课程回顾基础知识回归模型的建模过程一元线性回归模型线性回顾进行极大似然估计&#xff08;例题&#xff08;必考&#xff09;&#xff09;极大似然估计极大似然估计的性质线性性无偏性最优性&#xff08;记住即可&#xff0c;没有推导&#xff09;方差计算一元线性回…

智能制造 | AIRIOT智慧工厂管理解决方案

工厂生产运转中&#xff0c;设备数量多&#xff0c;环境复杂、企业往往需要承担很高的维修、保养、备件和人力成本。传统的工厂改革遇到了诸多前所未有的挑战&#xff1a; 1、管理系统较多&#xff0c;数据隔离&#xff0c;系统集成困难重重&#xff1b; 2、大量老旧设备无法联…

QT使用log4cpp日志库

文章目录QT使用log4cpp日志库1. 从官网下载log4cpp源码2. 编译项目3. 在QT中使用log4cpp4. log4cpp4.1. Category4.2. Appender4.3. Layout4.4. Priority4.5. 使用宏定义为日志加上文件名 函数名 行号等QT使用log4cpp日志库 1. 从官网下载log4cpp源码 log4cpp官方网址 下载后…

MyBatisPlus ---- 常用注解

MyBatisPlus ---- 常用注解1. TableNamea>问题b>通过TableName解决问题c>通过全局配置解决问题2. Tablelda>问题b>通过TableId解决问题c>TableId的value属性d>TableId的type属性e>雪花算法3. TableFielda>情况1b>情况24. TableLogica>逻辑删除…

LeetCodeday03

203.移除链表元素 给你一个链表的头节点 head 和一个整数 val &#xff0c;请你删除链表中所有满足 Node.val val 的节点&#xff0c;并返回 新的头节点 。 示例 1&#xff1a; 输入&#xff1a;head [1,2,6,3,4,5,6], val 6 输出&#xff1a;[1,2,3,4,5] 示例 2&#xff1…

基于springboot+mybatis+mysql+html实现医院预约挂号管理系统

基于springbootmybatismysqlhtml实现医院预约挂号管理系统一、系统简介二、系统主要功能界面2.1登陆2.2首页&#xff08;留言板、我的预约&#xff09;--用户2.3就诊预约--用户2.4我的预约--用户2.5我参与的评介--用户2.6我的预约日程--医生2.7对我的评介--医生2.8医生管理--管…

一文探索“预训练”的奥秘!

Datawhale干货 作者&#xff1a;王奥迪&#xff0c;单位&#xff1a;中国移动云能力中心2022年下半年开始&#xff0c;涌现出一大批“大模型”的优秀应用&#xff0c;其中比较出圈的当属AI作画与ChatGPT&#xff0c;刷爆了各类社交平台&#xff0c;其让人惊艳的效果&#xff0c…

[思维模式-19]:《复盘》-7- “积”篇 - 操作复盘- 如何做好复盘

目录 一、联想&#xff1a;复盘的五个误区与七个关键成功要素 1.1 五个误区 1.2 七个关键成功要素 二、复盘的25个“坑”及对策建议 2.1 回顾、评估阶段 2.2 分析、反思阶段 2.3 萃取、提炼阶段 2.4 转化、应用阶段 2.5 复盘引导阶段 三、有效复盘的三项核心技能 3.…

java常见问题处理

文章目录一、前言二、实战演练1、idea常用快捷键使用2、idea设置字体大小3、idea设置背景颜色-背景4、idea配置Maven5、idea中配置JDK6、idea中java.util变红报错IDEA中Sources、JavaDocs路径是红色的7、idea中使用mybatisPlus 自增主键失效&#xff0c;自增主键超大小知识点8、…

ZI-data RO-data RW-data Code BSS DATA

KEIL MDK 查看代码量、RAM使用情况--RO-data、RW-data、ZI-data的解释&#xff08;转&#xff09; - 酒醉的Tiger - 博客园源&#xff1a;KEIL MDK 查看代码量、RAM使用情况--RO-data、RW-data、ZI-data的解释KEIL RVMDK编译后的信息Program Size: Code86496 RO-datahttps://ww…

STM32MP157驱动开发——Linux 音频驱动

STM32MP157驱动开发——Linux 音频驱动一、简介1.CS42L51 简介2.I2S总线3.STM32MP1 SAI 总线接口二、驱动开发1.音频驱动1&#xff09;修改设备树i2c 接口&#xff1a;1.8v电源管理&#xff1a;2&#xff09;SAI 音频接口设备树3&#xff09;sound 节点2.使能和修改内核的 CS42…

linux系统中字符设备驱动开发方法

大家好&#xff0c;今天主要和大家聊一聊&#xff0c;linux系统中的字符设备驱动实现的基本过程。 目录 第一&#xff1a;字符设备驱动简介 第二&#xff1a;字符设备驱动开发步骤 第三&#xff1a;编写字符设备驱动实验程序 第一&#xff1a;字符设备驱动简介 字符设备是Li…

130道基础OJ编程题之: 58 ~ 67 道

130道基础OJ编程题之: 58 ~ 67 道 文章目录130道基础OJ编程题之: 58 ~ 67 道0. 昔日OJ编程题:58. BC61 金字塔图案59. BC62 翻转金字塔图案60. BC63 菱形图案61. BC64 K形图案62. BC65 箭形图案63. BC66 反斜线形图案64. BC67 正斜线形图案65. BC68 X形图案66. BC69 空心正方形…

电商大促话术

每逢节日&#xff0c;各大电商平台为了迎合节日气氛&#xff0c;会有各种大促活动&#xff0c;客户咨询量都会较平日有所增加&#xff0c;为了接待更多的客户&#xff0c;客服要掌握一定的电商大促话术。 前言 每逢节日&#xff0c;各大电商平台为了迎合节日气氛&#xff0c;会…

Python--数据容器

文章目录一、数据容器数据容器特点对比二、序列三、列表(list)3.1、列表定义&#xff1a;3.2、列表下标索引3.3、列表常用方法&#xff1a;3.4、list遍历四、元组(tuple)4.1、元组定义4.2、元组的常用方法4.3、元组的遍历五、字符串(str)5.1、字符串定义5.2、常用方法5.3、字符…

Unity 3D 资源下载 || Unity 3D 综合案例

Unity 3D 资源下载 你也可以在 Unity 3D 中执行 Window → Asset Store 菜单命令直接访问 Unity 资源商店&#xff08;Asset Store&#xff09;。 Unity 资源商店简介 Unity 资源商店https://www.assetstore.unity3d.com/ 中提供了多种类的游戏媒体资源&#xff08;人物模型…

某微1day后台RCE审计漏洞

某应用存在后台RCE&#xff0c;根据相关信息&#xff0c;我们在对后台审计过程&#xff0c;这里发现一处调用newInstance实例化溯源找到InterfaceRegisterCustomOperationCmd #excute访问路径为 /api/integration/workflowflow/getInterfaceRegisterCustomOperationgetInterfac…