简体   繁体   English

2D 中的单调插值

[英]Monotonic Interpolation in 2D

I would like to use scipy.interpolate.interp2d or scipy.interpolate.RectBivariateSpline to interpolate a 2D image, but would like for the interpolation to be monotonic.我想使用scipy.interpolate.interp2dscipy.interpolate.RectBivariateSpline来插值 2D 图像,但希望插值是单调的。

Is there an equivalent function that assures monotonicity or a way to force interp2d or RectBivariateSpline to return monotonic interpolations?是否有确保单调性的等效 function 或强制 interp2d 或 RectBivariateSpline 返回单调插值的方法?

I believe I am looking for something similar to PchipInterpolator , but for 2D (or n-dimensional).我相信我正在寻找类似于PchipInterpolator的东西,但是对于 2D(或 n 维)。

The first question is: How do you define monotonicity in 2D (and in higher dimensions)?第一个问题是:如何定义二维(以及更高维度)的单调性? It seems to be not unique.它似乎不是唯一的。 I searched and found this paper: Piecewise polynomial monotonic interpolation of 2D gridded data ( https://hal.inria.fr/hal-01059532/document ).我搜索并找到了这篇论文:二维网格数据的分段多项式单调插值( https://hal.inria.fr/hal-01059532/document )。 Maybe this helps.也许这有帮助。

The function RectBivariateSpline in scipy is wrapped around fitpack (as I remember, but maybe not). scipy 中的 function RectBivariateSpline 包裹在 fitpack 周围(我记得,但可能不是)。 If that is the case, then it wouldn't be monotonic, it is b-spline-based.如果是这样,那么它就不是单调的,它是基于 b 样条的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM