当前位置:网站首页>图像处理7-图像增强
图像处理7-图像增强
2022-06-30 06:09:00 【<Hunter>】
图像处理系列:
本文源码见本人资源,可免费下载。
图像增强
(1)网上任意下载三张图
(2)对图片进行预处理;
(3)导出预处理后的图片。
1.导入包
如图1.1,导入要使用的包。

图1.1 导入需要使用的包
2.图片下载
如图1.2,使用该代码进行图片自动化下载,从必应图片特定搜索的结果中下载照片。

图1.2 图片自动化爬取代码
3.各种预处理
本部分尝试使用各种图片增强方法处理图片,并展示效果。
a.图片读取
使用如图1.3的代码进行图片读取,并显示。

图1.3 图片读取与显示
b.随机比例缩放
使用图1.4的代码进行图片比例缩放,并显示。

图1.4 图片比例缩放和显示
c.随机位置裁剪和中心位置裁剪
使用图1.5的代码进行随机位置裁剪和显示。

图1.5 随机位置裁剪
使用图1.6的代码进行中心位置裁剪,并显示。

图1.6 中心位置裁剪
d.随机水平和竖直翻转
使用图1.7的代码进行水平翻转,并显示。

图1.7 随机水平翻转
使用图1.8的代码进行竖直翻转,并显示。

图1.8 随机竖直翻转
e.随机角度翻转
使用图1.9的代码进行随机角度翻转并显示。

图1.9 随机角度翻转
f.色度、亮度、饱和度、对比度、灰度变化
使用图1.10的代码进行色度变化并显示。

图1.10 色度变换
使用图1.11的代码进行亮度变化并显示。

图1.11 亮度变换
使用图1.12的代码进行饱和度变换,并显示。

图1.12 饱和度变化
使用图1.13的代码进行对比度变化,并显示。

图1.13 对比度变化
使用如图1.14的代码进行灰度变化,并显示。

图1.14 灰度变化
g.扩充
使用图1.15的代码进行扩充,并显示。

图1.15 扩充
h.使用PiPeLine变化
使用图1.16将想要进行的系列操作,封装进一个compose,对图片进行组合变化,并显示。

图1.16 使用PiPeLine变化
4.批量图像自动化处理
结合上述的尝试,我们可以使用图1.17的代码先将系列的随机变换,封装到一个PiPeLine

图1.17 批量图像增强自动预处理代码
中,然后对图片文件夹的照片进行批量的读入,对每张照片批量的处理,并保存到文件夹中效果见图1.18。

图1.18 自动化图像增强效果
边栏推荐
- Gestion des utilisateurs de la base de données MySQL
- Mysql database learning notes - foreign keys, table connections, subqueries, and indexes for MySQL multi table queries
- 飞升:基于中文分词器IK-2种自定义热词分词器构建方式showcase & 排坑showtime
- Summation of basic exercise sequence of test questions
- 24、 I / O device model (serial port / keyboard / disk / printer / bus / interrupt controller /dma and GPU)
- Share problems solved
- 旋转标注工具roLabelImg
- [openstack]-01- basic introduction
- At the age of 32, I fell into a middle-aged crisis and finally quit naked...
- ES6 extended operator (...)
猜你喜欢

Golang's handwritten Web Framework

MySQL log management, data backup and recovery

PC viewing WiFi password

Dao -- a beautiful new world?
![[MD editing required] welcome to the CSDN markdown editor](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[MD editing required] welcome to the CSDN markdown editor

Master slave synchronization of MySQL database to realize read-write separation

ECS deployment web project

Completabilefuture: from understanding to mastering, here are all you want to know

Develop stylelint rules from zero (plug-ins)

inno setup 最简单的自定义界面效果
随机推荐
MySQL數據庫用戶管理
[GPU] basic operation of GPU (I)
InputStream转InputStreamSource
Tornado frame foundation
Finally someone can make the server so straightforward
Create priority queue
Dao -- a beautiful new world?
ES6 deconstruction assignment
MySQL 索引
[regular expression series] greedy and non greedy patterns
Go common judgments
ECS deployment web project
Share problems solved
Voting vault: a new primitive for defi and Governance
MySQL log management, data backup and recovery
Huxiaochun came to fengshu electronics to sign a strategic cooperation agreement with Zoomlion
Intelligent deodorizer embedded development
24、 I / O device model (serial port / keyboard / disk / printer / bus / interrupt controller /dma and GPU)
Dynamic programming -- gliding wing of the strange thief Kidd
反编译正常回编译出现问题自己解决办法