资源简介
图像超分辨率技术源码;
基于深度学习的图像超分辨率重建的流程如下[2]:
1.首先找到一组原始图像Image1;
2.将这组图片降低分辨率为一组图像Image2
3.通过各种神经网络结构,将Image2超分辨率重建为Image3(Image3和Image1分辨率一样)
4.通过PSNR等方法比较Image1和Image3,验证超分辨率重建的效果,根据效果调节神经网络中的节点和参数
5.反复执行以上直到第4步的结果比较满意
The process of image super-resolution reconstruction based on deep learning is as follows [2]:
1. First find a set of original images image1;
2. Reduce the resolution of this group of pictures to a group of image2
3. Through various neural network structures, the super-resolution of image2 is reconstructed into image3 (the resolution of image3 is the same as that of image1)
4. Compare image1 and image3 by PSNR and other methods to verify the effect of super-resolution reconstruction, and adjust the nodes and parameters of neural network according to the effect
5. Repeat the above until the result of step 4 is satisfactory)
代码片段和文件信息
import os
import sys
import glob
import numpy as np
from PIL import Image
import pdb
# Artifically expands the dataset by a factor of 19 by scaling and then rotating every image
def main():
if len(sys.argv) == 2:
data = prepare_data(sys.argv[1])
else:
print(“Missing argument: You must specify a folder with images to expand“)
return
for i in xrange(len(data)):
scale(data[i])
rotate(data[i])
def prepare_data(dataset):
filenames = os.listdir(dataset)
data_dir = os.path.join(os.getcwd() dataset)
data = glob.glob(os.path.join(data_dir “*.bmp“))
return data
def scale(file):
image = Image.open(file)
width height = image.size
scales = [0.9 0.8 0.7 0.6]
for scale in scales:
new_width new_height = int(width * scale) int(height * scale)
new_image = image.resize((new_width new_height) Image.ANTIALIAS)
new_path = ‘{}-{}.bmp‘.format(file[:-4] scale)
new_image.save(new_path)
def rotate(file):
image = Image.open(file)
rotations = [90 180 270]
for rotation in rotations:
new_image = image.rotate(rotation expand=True)
new_path = ‘{}-{}.bmp‘.format(file[:-4] rotation)
new_image.save(new_path)
if __name__ == ‘__main__‘:
main()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1228 2019-06-06 13:37 图像超分辨率\expand_data.py
文件 1763 2019-06-06 13:37 图像超分辨率\main.py
文件 8973 2019-06-06 13:43 图像超分辨率\model.py
文件 9726 2019-06-06 13:45 图像超分辨率\utils.py
目录 0 2019-06-06 13:39 图像超分辨率
----------- --------- ---------- ----- ----
21690 5
- 上一篇:《Python神经网络编程》源代码
- 下一篇:NetAnalyze 建立网络
相关资源
- NetAnalyze 建立网络
- 《Python神经网络编程》源代码
- tradaboost
- 官方Python上位机
- xgboost算法
- numpy安装包
- Python安装MySQL安装包 64位 py2.7 [exe文件
- MySQL数据库工具MySQL-python-1.2.3.win-amd
- Pandas for Everyone Python Data Analysis 无水印
- Python3.5官方文档中文版本chm格式
- Python 3.7 标准库内置库手册(CHM格式,
- 利用python写入.ply文件、三维点云写入
- 用python_Tkinter显示股票中K线图均线和
- 数据可视化.pdf
- TensorFlow Python API documentation.pdf
- 2018年15期Python视频教程传智播客itca
- 小甲鱼Python课后题答案
- 小甲鱼python课后题
- Python3进程内存分析器-用于运行pytho
- Python 版LIMS实验室信息管理系统
- 循序遍历获取指定文件夹下的图片路
-
Python使用xpath读取xm
l文件的最简单方 - 基于OpenCV的python颜色提取
- 火焰检测代码python
- python,Opencv实现的车牌识别定位及分
- 从零开始学Python数据分析与挖掘.doc
- 零基础入门学习Python+全套源码课件
- Practical Web Scraping for Data Science_2018.p
- python+opencv实现初步手势识别源码(本
- Game Programming with Python Lua And Ruby
评论
共有 条评论