C#数字图像处理(二)

article/2025/8/7 7:59:49

文章目录

  • 1.灰度直方图
    • 1.1 灰度直方图定义
    • 1.2 灰度直方图编程实例
  • 2.线性点运算
    • 2.1线性点运算定义
    • 2.2 线性点运算编程实例
  • 3.全等级直方图灰度拉伸
    • 3.1 灰度拉伸定义
    • 3.2 灰度拉伸编程实例
  • 4.直方图均衡化
    • 4.1 直方图均衡化定义
    • 4.2 直方图均衡化编程实例
  • 5.直方图匹配
    • 5.1 直方图匹配定义
    • 5.2 直方图匹配编程实例
  • 6.附件链接
    • 6.1 解决VS2022 中没有.net4.0
      • 6.1.1 解措施

1.灰度直方图

  任何一幅图像的直方图都包括了可观的信息,某些类型的图像还可以由其直方图完全描述。

1.1 灰度直方图定义

在这里插入图片描述
  灰度直方图是灰度的函数,描述的是图像中具有该灰度级的像素的个数。如果用直角坐标系来表示,则它的横坐标是灰度级,纵坐标是该灰度出现的概率(像素的个数)。

1.2 灰度直方图编程实例

在这里插入图片描述
在这里插入图片描述

private void histogram_Click(object sender, EventArgs e)
{if (curBitmap != null){histForm histoGram = new histForm(curBitmap);histoGram.ShowDialog();histoGram.Close();}
}

在这里插入图片描述

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace histogram
{public partial class histForm : Form{//利用构造函数实现窗体之间的数据传递public histForm(Bitmap bmp){InitializeComponent();//把主窗体的图像数据传递给从窗体bmpHist = bmp;//灰度级计数countPixel = new int[256];  //8位可表示256个灰度级}private void close_Click(object sender, EventArgs e){this.Close();}//图像数据private System.Drawing.Bitmap bmpHist;//灰度等级private int[] countPixel;//记录最大的灰度级个数private int maxPixel;/// <summary>/// 计算各个灰度级所具有的像素个数/// </summary>private void histForm_Load(object sender, EventArgs e){//锁定8位灰度位图Rectangle rect = new Rectangle(0, 0, bmpHist.Width, bmpHist.Height);System.Drawing.Imaging.BitmapData bmpData = bmpHist.LockBits(rect,System.Drawing.Imaging.ImageLockMode.ReadWrite, bmpHist.PixelFormat);IntPtr ptr = bmpData.Scan0;int bytes = bmpHist.Width * bmpHist.Height;byte[] grayValues = new byte[bytes];System.Runtime.InteropServices.Marshal.Copy(ptr, grayValues, 0, bytes);//灰度值数据存入grayValues中byte temp = 0;maxPixel = 0;//灰度等级数组清零Array.Clear(countPixel, 0, 256);//计算各个灰度级的像素个数for (int i = 0; i < bytes; i++){//灰度级temp = grayValues[i];//计数加1countPixel[temp]++;if (countPixel[temp] > maxPixel){//找到灰度频率最大的像素数,用于绘制直方图maxPixel = countPixel[temp];}}//解锁System.Runtime.InteropServices.Marshal.Copy(grayValues, 0, ptr, bytes);bmpHist.UnlockBits(bmpData);}/// <summary>/// 绘制直方图/// </summary>private void histForm_Paint(object sender, PaintEventArgs e){//获取Graphics对象Graphics g = e.Graphics;//创建一个宽度为1的黑色钢笔Pen curPen = new Pen(Brushes.Black, 1);//绘制坐标轴g.DrawLine(curPen, 50, 240, 320, 240);//横坐标g.DrawLine(curPen, 50, 240, 50, 30);//纵坐标//绘制并标识坐标刻度g.DrawLine(curPen, 100, 240, 100, 242);g.DrawLine(curPen, 150, 240, 150, 242);g.DrawLine(curPen, 200, 240, 200, 242);g.DrawLine(curPen, 250, 240, 250, 242);g.DrawLine(curPen, 300, 240, 300, 242);g.DrawString("0", new Font("New Timer", 8), Brushes.Black, new PointF(46, 242));g.DrawString("50", new Font("New Timer", 8), Brushes.Black, new PointF(92,242));g.DrawString("100", new Font("New Timer", 8), Brushes.Black, new PointF(139, 242));g.DrawString("150", new Font("New Timer", 8), Brushes.Black, new PointF(189, 242));g.DrawString("200", new Font("New Timer", 8), Brushes.Black, new PointF(239, 242));g.DrawString("250", new Font("New Timer", 8), Brushes.Black, new PointF(289, 242));g.DrawLine(curPen, 48, 40, 50, 40);g.DrawString("0", new Font("New Timer", 8), Brushes.Black, new PointF(34, 234));g.DrawString(maxPixel.ToString(), new Font("New Timer", 8), Brushes.Black, new PointF(18, 34));//绘制直方图double temp = 0;for (int i = 0; i < 256; i++){//纵坐标长度temp = 200.0 * countPixel[i] / maxPixel;g.DrawLine(curPen, 50 + i, 240, 50 + i, 240 - (int)temp);}//释放对象curPen.Dispose();}}
}

在这里插入图片描述

2.线性点运算

  灰度图像的点运算可分为线性点运算和非线性点运算两种。

2.1线性点运算定义

  线性点运算就是输出灰度级与输入灰度级呈线性关系的点运算。在这种情况下,灰度变换函数的形式为:

g(x, y)=pf(x,y)+L

  其中 f(x,y) 为输入图像在点 (x,y) 的灰度值, g(x,y) 为相应的输出点的灰度值。显然,如果P=1和L=0,g(x,y)就是f(x,y)的复制;如果P<1,输出图像的对比度将增大;如果P>1,则对比度将减少;如果P=1而L≠0,该操作仅使所有像素的灰度值上移或下移,其效果是使整个图像在显示时更暗或更亮;如果P为负值,暗区域将变亮,亮区域将变暗,该操作完成了图像求补。

2.2 线性点运算编程实例

在这里插入图片描述
在这里插入图片描述

linearPOForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace histogram
{public partial class linearPOForm : Form{public linearPOForm(){InitializeComponent();}private void startLinear_Click(object sender, EventArgs e){//设置DialogResult属性this.DialogResult = DialogResult.OK;}private void close_Click(object sender, EventArgs e){this.Close();}//设置两个get访问器public string GetScaling{get{//得到斜率return scaling.Text;}}public string GetOffset{get{//得到偏移量return offset.Text;}}}
}
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace histogram
{public partial class Form1 : Form{public Form1(){InitializeComponent();}//文件名private string curFileName;//图像对象private System.Drawing.Bitmap curBitmpap;/// <summary>/// 打开图像文件/// </summary>private void open_Click(object sender, EventArgs e){//创建OpenFileDialogOpenFileDialog opnDlg = new OpenFileDialog();//为图像选择一个筛选器opnDlg.Filter = "所有图像文件|*.bmp;*.pcx;*.png;*.jpg;*.gif;" +"*.tif;*.ico;*.dxf;*.cgm;*.cdr;*.wmf;*.eps;*.emf|" +"位图(*.bmp;*.jpg;*.png;...)|*.bmp;*.pcx;*.png;*.jpg;*.gif;*.tif;*.ico|" +"矢量图(*.wmf;*.eps;*.emf;...)|*.dxf;*.cgm;*.cdr;*.wmf;*.eps;*.emf";//设置对话框标题opnDlg.Title = "打开图像文件";//启用“帮助”按钮opnDlg.ShowHelp = true;//如果结果为“打开”,选定文件if (opnDlg.ShowDialog() == DialogResult.OK){//读取当前选中的文件名curFileName = opnDlg.FileName;//使用Image.FromFile创建图像对象try{curBitmpap = (Bitmap)Image.FromFile(curFileName);}catch (Exception exp){MessageBox.Show(exp.Message);}}//对窗体进行重新绘制,这将强制执行paint事件处理程序Invalidate();}/// <summary>/// 在控件需要重新绘制时发生/// </summary>private void Form1_Paint(object sender, PaintEventArgs e){//获取Graphics对象Graphics g = e.Graphics;if (curBitmpap != null){//使用DrawImage方法绘制图像//160,20:显示在主窗体内,图像左上角的坐标//curBitmpap.Width, curBitmpap.Height图像的宽度和高度g.DrawImage(curBitmpap, 160, 20, curBitmpap.Width, curBitmpap.Height);}}/// <summary>/// 关闭窗体 /// </summary>private void close_Click(object sender, EventArgs e){this.Close();}private void histogram_Click(object sender, EventArgs e){if (curBitmpap != null){//定义并实例化新窗体,并把图像数据传递给它histForm histoGram = new histForm(curBitmpap);histoGram.ShowDialog();}}private void linearPO_Click(object sender, EventArgs e){if (curBitmpap!=null){//实例化linearPOForm窗体linearPOForm linearForm = new linearPOForm();//点击确定按钮if (linearForm.ShowDialog()==DialogResult.OK){Rectangle rect = new Rectangle(0, 0, curBitmpap.Width, curBitmpap.Height);System.Drawing.Imaging.BitmapData bmpData = curBitmpap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, curBitmpap.PixelFormat);IntPtr ptr = bmpData.Scan0;int bytes = curBitmpap.Width * curBitmpap.Height;byte[] grayValues = new byte[bytes];System.Runtime.InteropServices.Marshal.Copy(ptr, grayValues, 0, bytes);int temp = 0;//得到斜率double a = Convert.ToDouble(linearForm.GetScaling);//得到偏移量double b = Convert.ToDouble(linearForm.GetOffset);for (int i = 0; i < bytes; i++){//根据公式计算线性点运算//加0.5表示四舍五入temp = (int)(a * grayValues[i] + b + 0.5);//灰度值限制在0~255之间//大于255,则为255;小于0则为0if (temp>255){grayValues[i] = 255;}else if (temp<0){grayValues[i] = 0;}else{grayValues[i] = (byte)temp;}}System.Runtime.InteropServices.Marshal.Copy(grayValues, 0, ptr, bytes);curBitmpap.UnlockBits(bmpData);}Invalidate();}}}
}

在这里插入图片描述
在这里插入图片描述

3.全等级直方图灰度拉伸

  灰度拉伸也属于线性点运算的一种,也可以通过上一节的程序得到。但由于它在点运算的特殊性,所以把它单独列出来进行介绍。

3.1 灰度拉伸定义

  如果一幅图像的灰度值分布在全等级灰度范围内,即在0~255之间,那么它更容易被区别确认出来。
  灰度拉伸,也称对比度拉伸,是一种简单的线性点运算。它扩展图像的直方图,使其充满整个灰度等级范围内。
  设f(x,y)为输入图像,它的最小灰度级A和最大灰度级B的定义为:

A=min[f(x,y) B=max[f(x,y)]

  我们的目标是按照公式

  g(x, y)=pf(x,y)+L    

   把A和B分别线性映射到0和255,因此,最终的图像g(x,y)为:
在这里插入图片描述

3.2 灰度拉伸编程实例

 private void stretch_Click(object sender, EventArgs e){Stretch(curBitmpap, out curBitmpap);Invalidate();}/// <summary>/// 全等级灰度拉伸 (图像增强)/// </summary>/// <param name="srcBmp">原图像</param>/// <param name="dstBmp">处理后图像</param>/// <returns>处理成功 true 失败 false</returns>public static bool Stretch(Bitmap srcBmp, out Bitmap dstBmp){if (srcBmp == null){dstBmp = null;return false;}double pR = 0.0;//斜率double pG = 0.0;//斜率double pB = 0.0;//斜率byte minGrayDegree = 255;byte maxGrayDegree = 0;byte minGrayDegreeR = 255;byte maxGrayDegreeR = 0;byte minGrayDegreeG = 255;byte maxGrayDegreeG = 0;byte minGrayDegreeB = 255;byte maxGrayDegreeB = 0;dstBmp = new Bitmap(srcBmp);Rectangle rt = new Rectangle(0, 0, dstBmp.Width, dstBmp.Height);BitmapData bmpData = dstBmp.LockBits(rt, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);unsafe{for (int i = 0; i < bmpData.Height; i++){byte* ptr = (byte*)bmpData.Scan0 + i * bmpData.Stride;for (int j = 0; j < bmpData.Width; j++){if (minGrayDegreeR > *(ptr + j * 3 + 2))minGrayDegreeR = *(ptr + j * 3 + 2);if (maxGrayDegreeR < *(ptr + j * 3 + 2))maxGrayDegreeR = *(ptr + j * 3 + 2);if (minGrayDegreeG > *(ptr + j * 3 + 1))minGrayDegreeG = *(ptr + j * 3 + 1);if (maxGrayDegreeG < *(ptr + j * 3 + 1))maxGrayDegreeG = *(ptr + j * 3 + 1);if (minGrayDegreeB > *(ptr + j * 3))minGrayDegreeB = *(ptr + j * 3);if (maxGrayDegreeB < *(ptr + j * 3))maxGrayDegreeB = *(ptr + j * 3);}}pR = 255.0 / (maxGrayDegreeR - minGrayDegreeR);pG = 255.0 / (maxGrayDegreeG - minGrayDegreeG);pB = 255.0 / (maxGrayDegreeB - minGrayDegreeB);for (int i = 0; i < bmpData.Height; i++){byte* ptr1 = (byte*)bmpData.Scan0 + i * bmpData.Stride;for (int j = 0; j < bmpData.Width; j++){*(ptr1 + j * 3) = (byte)((*(ptr1 + j * 3) - minGrayDegreeB) * pB + 0.5);*(ptr1 + j * 3 + 1) = (byte)((*(ptr1 + j * 3 + 1) - minGrayDegreeG) * pG + 0.5);*(ptr1 + j * 3 + 2) = (byte)((*(ptr1 + j * 3 + 2) - minGrayDegreeR) * pR + 0.5);}}}dstBmp.UnlockBits(bmpData);return true;}

在这里插入图片描述
  增强后:
在这里插入图片描述

4.直方图均衡化

4.1 直方图均衡化定义

  直方图均衡化,又称直方图修平,它是一种很重要的非线性点运算。该方法通常用来增加图像的局部对比度,尤其是当图像的有用数据的对比度相当接近的时候。通过这种方法,亮度可以更好地在直方图上分布。
  直方图均衡化的基本思想,是把原始图像的直方图变换为均匀分布的形式,这样就增加了像素灰度值的动态范围,从而可达到增强图像整体对比度的效果。
在这里插入图片描述
在这里插入图片描述

4.2 直方图均衡化编程实例

在这里插入图片描述
  为该控件添加Click事件,代码如下:

 private void equalization_Click(object sender, EventArgs e){if (curBitmap != null){Rectangle rect = new Rectangle(0, 0, curBitmap.Width, curBitmap.Height);System.Drawing.Imaging.BitmapData bmpData = curBitmap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, curBitmap.PixelFormat);IntPtr ptr = bmpData.Scan0;int bytes = curBitmap.Width * curBitmap.Height;byte[] grayValues = new byte[bytes];System.Runtime.InteropServices.Marshal.Copy(ptr, grayValues, 0, bytes);byte temp;int[] countPixel = new int[256];int[] tempArray = new int[256];//Array.Clear(tempArray, 0, 256);byte[] pixelMap = new byte[256];//计算各灰度级的像素个数for (int i = 0; i < bytes; i++){//灰度级temp = grayValues[i];//计数加1countPixel[temp]++;}for (int i = 0; i < 256; i++){if (i != 0){tempArray[i] = tempArray[i - 1] + countPixel[i];}else{tempArray[0] = countPixel[0];}pixelMap[i] = (byte)(255.0 * tempArray[i] / bytes + 0.5);}for (int i = 0; i < bytes; i++){temp = grayValues[i];grayValues[i] = pixelMap[temp];}System.Runtime.InteropServices.Marshal.Copy(grayValues, 0, ptr, bytes);curBitmap.UnlockBits(bmpData);Invalidate();}}

在这里插入图片描述
在这里插入图片描述

5.直方图匹配

5.1 直方图匹配定义

  直方图匹配,又称直方图规定化,即变换原图的直方图为规定的某种形式的直方图,从而使两幅图像具有类似的色调和反差。直方图匹配属于非线性点运算。
  直方图规定化的原理:对两个直方图都做均衡化,变成相同的归一化的均匀直方图,以此均匀直方图为媒介,再对参考图像做均衡化的逆运算。
在这里插入图片描述

5.2 直方图匹配编程实例

在这里插入图片描述

 private void shaping_Click(object sender, EventArgs e){if (curBitmap != null){shapingForm sForm = new shapingForm();if (sForm.ShowDialog() == DialogResult.OK){Rectangle rect = new Rectangle(0, 0, curBitmap.Width, curBitmap.Height);System.Drawing.Imaging.BitmapData bmpData = curBitmap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, curBitmap.PixelFormat);IntPtr ptr = bmpData.Scan0;int bytes = curBitmap.Width * curBitmap.Height;byte[] grayValues = new byte[bytes];System.Runtime.InteropServices.Marshal.Copy(ptr, grayValues, 0, bytes);byte temp = 0;double[] PPixel = new double[256];double[] QPixel = new double[256];int[] qPixel = new int[256];int[] tempArray = new int[256];for (int i = 0; i < grayValues.Length; i++){temp = grayValues[i];qPixel[temp]++;}for (int i = 0; i < 256; i++){if (i != 0){tempArray[i] = tempArray[i - 1] + qPixel[i];}else{tempArray[0] = qPixel[0];}QPixel[i] = (double)tempArray[i] / (double)bytes;}PPixel = sForm.ApplicationP;double diffA, diffB;byte k = 0;byte[] mapPixel = new byte[256];for (int i = 0; i < 256; i++){diffB = 1;for (int j = k; j < 256; j++){diffA = Math.Abs(QPixel[i] - PPixel[j]);if (diffA - diffB < 1.0E-08){diffB = diffA;k = (byte)j;}else{k = (byte)(j - 1);break;}}if (k == 255){for (int l = i; l < 256; l++){mapPixel[l] = k;}break;}mapPixel[i] = k;}for (int i = 0; i < bytes; i++){temp = grayValues[i];grayValues[i] = mapPixel[temp];}System.Runtime.InteropServices.Marshal.Copy(grayValues, 0, ptr, bytes);curBitmap.UnlockBits(bmpData);}Invalidate();}}

在这里插入图片描述

6.附件链接

6.1 解决VS2022 中没有.net4.0

我们在安装了最新的Visual Studio 2022,在单个组件中没有 .net4.0或者.net4.5的问题。

6.1.1 解措施

通过nuget 下载 4.0 安装包
下载地址: .NETFramework,Version=v4.0 的引用程序集
在这里插入图片描述
得到安装包.nupkg ,然后后缀名字,修改为.zip 解压后
在这里插入图片描述
将v4.0 复制到 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework 直接替换文件
在这里插入图片描述
然后我们重启 vs2022,问题解决。
在这里插入图片描述


http://www.hkcw.cn/article/BRXfOPpDNL.shtml

相关文章

SOC-ESP32S3部分:24-WiFi配网

飞书文档https://x509p6c8to.feishu.cn/wiki/OD4pwTE8Jift2IkYKdNcSckOnfd 对于WiFi类设备&#xff0c;最重要的功能之一就是联网&#xff0c;WiFi需要联网&#xff0c;就需要知道我们家里路由的账号和密码&#xff0c;像手机类型的高端设备没什么问题&#xff0c;我们可以直接…

使用langchain实现五种分块策略:语义分块、父文档分块、递归分块、特殊格式、固定长度分块

文章目录 分块策略详解1. 固定长度拆分&#xff08;简单粗暴&#xff09;2. 递归字符拆分&#xff08;智能切割&#xff09;3. 特殊格式拆分&#xff08;定向打击&#xff09;Markdown分块 4. 语义分割&#xff08;更智能切割&#xff09;基于Embedding的语义分块基于模型的端到…

(七)【Linux进程的创建、终止和等待】

1 进程创建 1.1 在谈fork函数 #include <unistd.h> // 需要的头文件// 返回值&#xff1a;子进程中返回0&#xff0c;父进程返回子进程id&#xff0c;出错返回-1调用fork函数后&#xff0c;内核做了下面的工作&#xff1a; 创建了一个子进程的PCB结构体、并拷贝一份相…

EMO2:基于末端执行器引导的音频驱动虚拟形象视频生成

今天带来EMO2&#xff08;全称End-Effector Guided Audio-Driven Avatar Video Generation&#xff09;是阿里巴巴智能计算研究院研发的创新型音频驱动视频生成技术。该技术通过结合音频输入和静态人像照片&#xff0c;生成高度逼真且富有表现力的动态视频内容&#xff0c;值得…

Baklib知识中台加速企业服务智能化实践

知识中台架构体系构建 Baklib 通过构建多层级架构体系实现知识中台的底层支撑&#xff0c;其核心包含数据采集层、知识加工层、服务输出层及智能应用层。在数据采集端&#xff0c;系统支持对接CRM、ERP等业务系统&#xff0c;结合NLP技术实现非结构化数据的自动抽取&#xff1…

GpuGeek 618大促引爆AI开发新体验

随着生成式AI技术迅猛发展&#xff0c;高效可靠的算力资源已成为企业和开发者突破创新瓶颈的战略支点。根据赛迪顾问最新发布的《2025中国AI Infra平台市场发展研究报告》显示&#xff0c;2025年中国生成式人工智能企业应用市场规模将达到629.0亿元&#xff0c;作为AI企业级应用…

Linux线程同步实战:多线程程序的同步与调度

个人主页&#xff1a;chian-ocean 文章专栏-Linux Linux线程同步实战&#xff1a;多线程程序的同步与调度 个人主页&#xff1a;chian-ocean文章专栏-Linux 前言&#xff1a;为什么要实现线程同步线程饥饿&#xff08;Thread Starvation&#xff09;示例&#xff1a;抢票问题 …

任务22:创建示例Django项目,展示ECharts图形示例

任务描述 知识点&#xff1a; DjangoECharts 重 点&#xff1a; DjangoECharts 内 容&#xff1a; 创建Django项目掌握ECharts绘制图形通过官网ECharts示例&#xff0c;完成Django项目&#xff0c;并通过配置项进行修改图形 任务指导 1、创建web_test的Django项目 2…

深度学习入门Day1--Python基础

一、基础语法 1.变量 python是“动态类型语言”的编程语言。用户无需明确指出x的类型是int。 x10 #初始化 print(x) #输出x x100 #赋值 print(x) print(type(x))#输出x的类型<class int>2.算术计算 >>>4*5 >20 >>>3**3#**表示乘方&#xff08;3…

九坤:熵最小化加速LLM收敛

&#x1f4d6;标题&#xff1a;One-shot Entropy Minimization &#x1f310;来源&#xff1a;arXiv, 2505.20282 &#x1f31f;摘要 我们训练了 13,440 个大型语言模型&#xff0c;发现熵最小化只需要一个未标记的数据和 10 步优化&#xff0c;以实现比使用数千个数据获得的…

微服务面试(分布式事务、注册中心、远程调用、服务保护)

1.分布式事务 分布式事务&#xff0c;就是指不是在单个服务或单个数据库架构下&#xff0c;产生的事务&#xff0c;例如&#xff1a; 跨数据源的分布式事务跨服务的分布式事务综合情况 我们之前解决分布式事务问题是直接使用Seata框架的AT模式&#xff0c;但是解决分布式事务…

儿童节快乐,聊聊数字的规律和同余原理

某年的6月1日是星期日。那么&#xff0c;同一年的6月30日是星期几&#xff1f; 星期是7天一个循环。所以说&#xff0c;这一天是星期几&#xff0c;7天之后同样也是星期几。而6月30日是在6月1日的29天之后&#xff1a;29 7 4 ... 1用29除以7&#xff0c;可以得出余数为1。而…

视觉分析明火检测助力山东化工厂火情防控

视觉分析技术赋能化工厂火情防控&#xff1a;从山东事故看明火与烟雾检测的应用价值 一、背景&#xff1a;山东化工事故中的火情防控痛点 近期&#xff0c;山东高密友道化学有限公司、淄博润兴化工科技有限公司等企业接连发生爆炸事故&#xff0c;暴露出传统火情防控手段的局…

javaEE->多线程:定时器

一. 定时器 约定一个时间&#xff0c;时间到了&#xff0c;执行某个代码逻辑&#xff08;进行网络通信时常见&#xff09; 客户端给服务器发送请求 之后就需要等待 服务器的响应&#xff0c;客户端不可能无限的等&#xff0c;需要一个最大的期限。这里“等待的最大时间”可以用…

HTML表单

1. 什么是表单 表单常用格式 文本框 密码框 单选按钮 复选框 列表框 按钮 多行文本域 文件域 邮箱 网址 数字 滑块 搜索框 2. 表单的高级应用 隐藏域&#xff08;⭐&#xff09; 隐藏域在网页中会经常被使用&#xff0c;比如我们登录了以后需要持续使用我们的登录信息&#xff…

STM32F407寄存器操作(ADC非连续扫描模式)

1.前言 书接上回&#xff0c;在看手册的时候我突然发现手册上还描述了另一种ADC扫描模式&#xff0c;即非连续扫描模式&#xff0c;想着连续扫描模式都已经探索过了&#xff0c;那就顺手把非非连续模式研究一下吧。 2.理论 我们先看看手册&#xff0c;这里我就以规则通道举例…

老年照护实训室建设方案设计:基础照护与专业护理实训

老年照护实训室的建设是提升老年照护人才培养质量的关键环节&#xff0c;其方案设计需精准对接基础照护与专业护理的实训需求&#xff0c;为学习者构建理论与实践深度融合的教学场景。点击获取实训室建设方案 一、建设背景与目标 &#xff08;一&#xff09;建设背景 随着人…

C语言 — 文件

目录 1.流1.1 流的概念1.2 常见的的流 2.文件的打开和关闭2.1 fopen函数2.2 fclose函数2.3 文件的打开和关闭 3.文件的输入输出函数3.1 fputc函数3.2 fgetc函数3.3 feof函数和ferror函数3.4 fputs函数3.5 fgets函数3.6 fwrite函数3.7 fread函数3.8 fprintf函数3.9 fscanf函数 4…

13. springCloud AlibabaSeata处理分布式事务

目录 一、分布式事务面试题 1.多个数据库之间如何处理分布式事务&#xff1f; 2.若拿出如下场景&#xff0c;阁下将如何应对? 3.阿里巴巴的Seata-AT模式如何做到对业务的无侵入? 4.对于分布式事务问题&#xff0c;你知道的解决方案有哪些?请你谈谈? 二、分布式事务问题…

java多线程与JUC

进程线程 进程&#xff1a;进程是操作系统分配资源的基本单位。在电脑中&#xff0c;一个软件就是一个进程 线程&#xff1a;线程是CPU调度的基本单位&#xff0c;是进程内的执行单元。相当于一个软件中的不同功能 多线程程序的特点&#xff1a;程序可以同时去做多件事&#…