給定的映射函數用於為輸出中的每個點查找輸入中的相應坐標
用法:scipy.ndimage.interpolation.geometric_transform(input, mapping, order=3)
Parameters
- 輸入:采用數組。
- mapping:接受類似於給定輸出數組等級長度的元數據結構。
- order:int參數。這是樣條插值,默認值為3。
返回值:返回一個n d數組。
範例1:
Python3
from scipy import ndimage
# importing numpy module for
# processing the arrays
import numpy as np
# creating an 2 dimensional array with
# 5 * 5 dimensions
a = np.arange(25).reshape((5, 5))
print('a')
print(a)
# reducing dimensions function
def shift_func(output_coords):
return (output_coords[0] - 0.7, output_coords[1] - 0.7)
# performing geometric transform operation
ndimage.geometric_transform(a, shift_func)
輸出:
範例2:
Python3
from scipy import ndimage
# importing numpy module for
# processing the arrays
import numpy as np
# create 4 * 4 dim array.
b = np.arange(16).reshape((4, 4))
# reducing dimensions function
def shift_func(output_coords):
return (output_coords[0] - 0.1, output_coords[1] - 0.2)
ndimage.geometric_transform(b, shift_func)
輸出:
相關用法
- Python Scipy stats.tsem()用法及代碼示例
- Python Scipy stats.tvar()用法及代碼示例
- Python Scipy stats.gmean()用法及代碼示例
- Python Scipy stats.tmin()用法及代碼示例
- Python Scipy stats.tstd()用法及代碼示例
- Python Scipy stats.tmax()用法及代碼示例
- Python Scipy stats.describe()用法及代碼示例
- Python Scipy stats.mean()用法及代碼示例
- Python Scipy stats.nanmedian()用法及代碼示例
- Python Scipy stats.nanstd()用法及代碼示例
- Python Scipy stats.nanmean()用法及代碼示例
- Python Scipy stats.moment()用法及代碼示例
- Python Scipy stats.mode()用法及代碼示例
- Python Scipy stats.normaltest()用法及代碼示例
- Python Scipy stats.skewtest()用法及代碼示例
- Python Scipy stats.kurtosis()用法及代碼示例
- Python Scipy stats.kurtosistest()用法及代碼示例
- Python Scipy stats.relfreq()用法及代碼示例
- Python Scipy stats.scoreatpercentile()用法及代碼示例
- Python Scipy stats.itemfreq()用法及代碼示例
- Python Scipy stats.histogram()用法及代碼示例
- Python Scipy stats.cumfreq()用法及代碼示例
- Python Scipy stats.variation()用法及代碼示例
- Python Scipy stats.binned_statistic_dd()用法及代碼示例
注:本文由純淨天空篩選整理自sravankumar8128大神的英文原創作品 Python Scipy – ndimage.interpolation.geometric_transform() function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。