当前位置:网站首页>Image fuzzy processing batch production fuzzy data set
Image fuzzy processing batch production fuzzy data set
2022-07-23 11:47:00 【mandala -chen】
File structure 1 As shown in the figure below 
# coding: utf-8
import numpy as np
import cv2 as cv
import os
def motion_blur(image, degree=30 ,angle=45):
image = np.array(image)
# Here we generate motion blur at any angle kernel Matrix , degree The bigger it is , The more fuzzy
M = cv.getRotationMatrix2D((degree / 2, degree / 2), angle, 1)
motion_blur_kernel = np.diag(np.ones(degree))
motion_blur_kernel = cv.warpAffine(motion_blur_kernel, M, (degree, degree))
motion_blur_kernel = motion_blur_kernel / degree
blurred = cv.filter2D(image, -1, motion_blur_kernel)
# convert to uint8
cv.normalize(blurred, blurred, 0, 255, cv.NORM_MINMAX)
blurred = np.array(blurred, dtype=np.uint8)
return blurred
# Read and process in batches
filePath = 'C:\\Users\\ Chen Dongxiang \\Desktop\\ New folder (4)\\abc\\'
for i in os.listdir(filePath):
img = cv.imread("./abc/"+i)
img_ = motion_blur(img)
cv.imwrite(i,img_)
边栏推荐
- Federal Reserve governor Waller: decentralized finance may eventually change the traditional financial market
- 数仓4.0笔记——用户行为数据采集一
- mysql修改函数权限未生效
- NFT交易平台数字藏品系统|开发定制
- Data warehouse 4.0 notes - user behavior data collection II
- 数仓4.0笔记——数仓环境搭建—— Yarn配置
- Two sorting and one random data fetching of stored procedures
- kubesphere HA install (二)
- 按照日期进行累加sql
- 数仓4.0笔记——用户行为数据采集二
猜你喜欢
![[monitoring deployment practice] display the charts of Prometheus and loki+promtail based on granfana](/img/34/b7a05bff05e1d3a1daef4fb2b98a92.png)
[monitoring deployment practice] display the charts of Prometheus and loki+promtail based on granfana

Digital collection development / meta universe digital collection development

NFT digital collection system development: the combination of music and NFT

Typescript advanced type

Entrepôt de données 4.0 Notes - acquisition de données sur le comportement de l'utilisateur II

CTF-web 常用软件安装及环境搭建

xtu-ctf Challenges-Reverse 1、2

MySQL add, delete, modify, query & advanced query statements

数字藏品系统开发:企业布局元宇宙数字藏品

渗透测试基础
随机推荐
Adding environment variables and templates to systemctl service
SQL realizes the user statistics of continuous login for more than 7 days
sql实现连续登陆7天以上用户统计
Scala之二流程控制
数字藏品开发/数字藏品系统开发解决方案
Kubesphere haproxy+kept (I)
Customize foreach tags & select tags to echo data
Data warehouse 4.0 notes - data warehouse environment construction - Yan configuration
Chinese interpretation of notepad++ background color adjustment options
Setting optimization and use of MySQL and SQL Server
用户连续登陆(允许中断)查询sql
NepCTF2022 Writeup
美联储理事沃勒:去中心化金融最终可能会改变传统金融市场
文件上传漏洞常见绕过方式
Security problems of FileInfo in PHP file upload
数字藏品系统开发/数字藏品方案介绍
[untitled]
Quartz2.2 simple scheduling job
Entrepôt de données 4.0 Notes - acquisition de données commerciales
shell取某一时间范围内月份