Fifth commit
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user