数字图像处理入门(一) 击中击不中

数字图像处理考点分析(五) 总结一些数字图像处理的重要知识 阅读详情

形态学的击中和击不中是形状检测的基本工具。

其基本原理为:(集合X为原二值化图像的像素集合,对X取反求得~X(非X, Y表示), 选择的结构元为s1, 对结构元s1取反的结构元为s2)

首先对用s1对X进行腐蚀得到A1,, 用s2对Y(即~X)进行腐蚀得到A2。最终结果C = A1 & A2。

对本次的样例图片,我们选取以下的结构元s1:

0 0 1 0 0

0 0 1 0 0

1 1 1 1 1

0 0 1 0 0

0 0 1 0 0                              

对其取反后的结构元s2为:

                             1 1 0 1 1

【数字图像处理】图像二值化,腐蚀膨胀,开闭运算,击中击不中变换 这是数字图像处理的第二次作业,包含的内容很多,有图像的二值化 膨胀 腐蚀 以及图像的开闭操作 击中击不中变换等。 1、图像的二值化 难点在于如何选取合适的Threshold。 基本思想:将二值化得到的二值图像视为两部分,一部分对应前景(Foreground),另一部分对应背景(Background)。尝试找到一个合适的threshold使得到的前景和背景的内部方差最小,而它们之间的方差则最大 阅读详情

相关推荐

数字图像处理 击中击不中变换

参考链接

qq_42598935的博客 1195

【Emgu CV教程】9.8、形态学常用操作之击中击不中

Emgu CV教程、形态学操作、击中击不中、MorphologyEx()、MorphOp.HitMiss

活宝的博客 853

数字图像处理——形态学操作(二值图像篇)

形态学操作内容简介 内容简介   本篇博客介绍的形态学图像处理操作。

Lavendelion的博客 9874

数字图像处理复习记录(二)邻接、连通和形态学处理

本篇文章作为数字图像处理的笔记记录,内容大量参考优快云中的相关帖子、冈萨雷斯《数字图像处理》第三版以及老师上课所用课件。 邻域、邻接和连通 象素的邻域反应了象素间的基本关系,常见邻域包含4-邻域(N4),对角邻域(ND)和8-邻域(N8)。下图表示了常见的邻域关系。 邻域仅考虑象素间的空间关系,而两个象素是否邻接,判断标准是其是否相互接触(邻域)、灰度值是否满足某个特定的相似准则(同在一个灰度值集合中取值,注意是灰度值集合而非灰度差集合)。根据邻域的定义,我们很容易得到4-邻接和8-邻接关系。但8邻接中存

weixin_56433898的博客 2189

击中不中变换:数字图像处理与应用

具体来说,击中不中变换包括两个过程:击中过程和不击中过程。在击中过程中,结构元素与图像进行逐像素比较,只有当结构元素完全匹配图像区域时,结果为1,否则为0。而在不击中过程中,结构元素与图像进行逐像素比较,只有当结构元素完全不匹配图像区域时,结果为1,否则为0。通过这两个过程,可以得到一个新的二值图像,其中目标区域被击中,而非目标区域被不击中。在数字图像处理中,击中不中变换是一种常用的操作,用于将图像中的目标击中或不击中。本文将详细介绍击中不中变换的原理和实现,并提供相应的MATLAB源代码。

DevGlider的博客 497

OpenCV-Python图像击中击不中变换理解的关键知识点及自定义实现

本节详细解释了OpenCV-Python图像击中击不中变换理解的关键知识点,给前面的如下问题进行了比较详细清楚的回答: - 补集怎么计算? - 交集怎么计算? - B1和B2怎么构造? - 调用OpenCV的HMT变换函数时,对于B1和B2怎么传入? - 能否根据介绍的算法利用腐蚀实现一个自定义的击中击不中HITMISS变换处理? 并根据这些解释应用两次腐蚀实现了一个自定义的HMT变换函数,该函数不但能对二值图处理,也能对灰度图进行正确处理。

老猿Python 3213

使用Python实现击中/击不中变换

对于击不中变换,我们需要先将待处理图像取反(即黑白颜色互换),再将其和背景结构元素一起传递给cv2.morphologyEx()函数。在击中/击不中变换中,我们需要定义两个结构元素:一个前景结构元素和一个背景结构元素。对于击中变换,我们需要将待处理图像和前景结构元素一起传递给cv2.morphologyEx()函数,并将操作类型设置为cv2.MORPH_HITMISS(击中变换)。这里我们使用cv2.threshold()函数来进行阈值处理,将像素值大于等于200的像素设置为白色,将其余像素设置为黑色。

学习使你进步。 310

OpenCV-Python击中击不中变换:绳网结匹配实战教程.zip

htmltable {th, td {th {pre {简介:在图像处理中,利用OpenCV库实现的击中击不中变换是一种核心技术,用于模式识别、边缘检测等。本文介绍如何使用Python和OpenCV进行绳网结形状的匹配。通过创建绳网结的二值模板图像,结合函数进行匹配,并通过阈值处理、形态学操作和轮廓检测来优化和提取绳网结形状。详细步骤和示例代码帮助读者掌握击中击不中变换的应用,以解决实际问题。

weixin_42577735的博客 694

Matlab数学形态学细化图像——基于击中击不中循环算法

数学形态学细化算法的matlab实现,主要应用循环击中击不中算法,同时有matlab自带的细化函数实现,循环击中击不中算法运行速度效率不及Matlab自带的细化函数,但原理很清晰,吻合冈萨雷斯版教材中细化方法。

保姆级教程:给你的Jetson Orin NX换个‘大房子’——新SSD初始化与JetPack 6.x刷机全流程

本文提供Jetson Orin NX存储升级与JetPack 6.x系统部署的完整指南,涵盖SSD选型、分区策略、刷机流程及性能优化技巧。通过实测数据展示如何提升AI模型加载速度33%,并分享温度管理、I/O调度等实战经验,助力开发者突破边缘计算存储瓶颈。

weixin_42715608的博客 156

windows10 + wsl2安装docker

一、安装wsl https://docs.microsoft.com/zh-cn/windows/wsl/install-win10 1.1以管理员身份运行powershell 1.2执行如下命令 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 1.3重启电脑 1.4 重启电脑后,如果需要安装wsl2, 则安装官方文档继续后续操作,因我...

happytree001的博客 1567

AI搜索优化(GEO)实战指南:抢占智能对话流量入口

AI SEO,是针对生成式AI平台(如DeepSeek、豆包、Kimi等)的优化策略,旨在通过适配AI算法对内容的理解和引用逻辑,提升品牌在AI生成答案中的可见性与权威性,从而在对话式搜索场景中抢占流量入口。:强化内容经验性(Experience)、专业性(Expertise)、权威性(Authoritativeness)、可信度(Trustworthiness)内容需避免夸大描述,提供可验证的细节(如数据、用户评价)。

Baixue5209的博客 6774

麒麟V10服务器多硬盘安装与分区实战:告别自动分区,手动分配/boot、swap和/根目录

本文详细介绍了麒麟V10服务器在多硬盘环境下的手动分区策略,包括/boot、swap和/根目录的优化分配方案。通过SSD与HDD混合存储架构的合理规划,提升系统性能和运维效率,适用于企业级定制化系统部署需求。

weixin_26976635的博客 405

SAP_SD模块路径及运输功能后台配置简介

后台路径:SPRO—后勤执行—装运—基本发运功能—定义路线—定义传输模式根据实际运输过程运输地理的类型:海运、公路运输、空运后台路径:SPRO—后勤执行—装运—基本发运功能—定义路线—定义发运类型根据实际运输过程运输方式:汽车、卡车、火车、轮船、飞机后台路径:SPRO—后勤执行—装运—基本发运功能—路径—定义路线—定义运输连接点指在运输过程中需要中转的地区可以维护中转地区的停留的时间后台路径:SPRO—后勤执行—装运—基本发运功能—路径—定义路线—定义路径和阶段。

我小时候很黑的博客 1394

最优控制 (Optimal Control) 算法详解及案例分析

最优控制是一种通过优化控制输入,使系统在满足约束条件的情况下达到最优性能的控制方法。其目标是最小化或最大化一个性能指标。

闲人编程的博客 2090

2025年开源气象大模型的实现原理与实践指南

气象大模型在人工智能时代实现了革命性突破,通过深度学习技术以更低的计算成本达到甚至超越传统数值天气预报的精度。开源气象大模型的出现使得全球研究者和机构都能参与气象AI的创新。本文详细解析了开源气象大模型的实现原理,包括核心架构、数据准备、训练方法和实际预测流程,并提供了实践指南。核心架构主要采用Transformer、图神经网络和扩散模型,处理多模态数据融合和时空联合建模。数据体系构建涉及数据来源、预处理和增强策略。模型训练关键技术包括损失函数设计、分布式训练优化和训练过程监控。微调与领域适应策略包括迁移学

专注AI大模型,软件混淆,授权 1179

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

上一篇: 计算机视觉、图像处理学习资料汇总
下一篇: UVA 11991 Easy Problem from Rujia Liu?
小do在努力
博客等级 码龄16年 58粉丝 161原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值