在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):fatheral/matlab_imresize开源软件地址(OpenSource Url):https://github.com/fatheral/matlab_imresize开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):matlab_imresizePython implementation of MatLab imresize() function. Table of contentsBackgroundIn the latest Super Resolution challenges (e.g. see NTIRE 2017) the downscaling - bicubic interpolation - is performed via MatLab imresize() function.
Moreover, the quality (PSNR) of a tested solution is compared with the reference solution - upsampling with bicubic interpolation - which is done again with MatLab imresize() function with the default settings. All this leads to:
As the most of the Deep Learning code is written under the python, we need to do some additional preprocessing/postprocessing using completely different environment (MatLab), and can't do upscaling/downscaling in-place using simple python functions. As a result, the implemented python imresize() function is done to overcome these difficulties. System requirements
Usageimresize of uint8 image using scale (e.g. 0.5 or 2): Img_out = imresize(Img_in, scalar_scale=0.333) # Img_out of type uint8 imresize of uint8 image using shape (e.g. (100, 200)): Img_out = imresize(Img_in, output_shape=(123, 324)) # Img_out of type uint8 Above examples are working when input image import numpy as np
from skimage.io import imsave, imread
from skimage import img_as_float
img_uint8 = imread('test.png')
img_double = img_as_float(img_uint8)
new_img_double = imresize(img_double, output_shape=(123, 324))
imsave('test_double.png', convertDouble2Byte(new_img_double)) Additional informationActually, the implemented python code was made by re-writing MatLab code In fact, if you have OpenCV and have the ability to re-compile it, probably the best solution is to change parameter NotePlease note that no optimization (aside from preliminary numpy-based vectorizing) was made, so the code can be (and it is) times slower than the original MatLab code. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论