Fifth commit

This commit is contained in:
lan daiqing
2022-07-28 21:35:42 +08:00
parent 3d78b6edb3
commit 493dc7062a
10 changed files with 93 additions and 122 deletions

View File

@@ -4,13 +4,17 @@
# @Email : derighoid@gmail.com
# @File : Blue_noise_sampling.py
# @Software: PyCharm
from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
'''
最近邻插值法:
在放大图像时,多出来的像素点由最近邻的像素点构成
计算新图形(放大后或缩小后)的坐标点像素值对应于原图像中哪一个像素点填充的。
srcX=newX*(srcW/newW)
srcY=newY*(srcH/newH)
src是原图dst是新图原来的图像宽度/高度除以新图像的宽度/高度可以得到缩放比例,
@@ -57,3 +61,6 @@ def showImage(picPath):
plt.imshow(image1)
plt.show()
return image1