用法:
skimage.transform.warp_coords(coord_map, shape, dtype=<class 'numpy.float64'>)
為二維圖像扭曲的輸出構建源坐標。
- coord_map:可調用 GeometricTransform.inverse
返回給定輸出坐標的輸入坐標。坐標的形狀為 (P, 2),其中 P 是坐標數,每個元素是一個
(row, col)
對。- shape:元組
輸出圖像的形狀
(rows, cols[, bands])
。- dtype:np.dtype 或字符串
返回值的 dtype(明智的選擇:float32 或 float64)。
- coords:(ndim, rows, cols[, band]) dtype 數組類型
坐標
scipy.ndimage.map_coordinates
,這將通過根據coord_transform_fn.
參數:
返回:
注意:
這是一個lower-level 例程,它為warp() 使用的二維圖像生成源坐標。
它是分開提供的skimage.transform.warp為希望重新使用特定坐標映射的用戶提供額外的靈活性,在image-warping 過程中的各個點使用特定的dtypes,或實現與post-processing 不同的邏輯skimage.transform.warp調用後執行ndi.map_coordinates.
例子:
生成一個將圖像向上和向右移動的坐標圖:
>>> from skimage import data >>> from scipy.ndimage import map_coordinates >>> >>> def shift_up10_left20(xy): ... return xy - np.array([-20, 10])[None, :] >>> >>> image = data.astronaut().astype(np.float32) >>> coords = warp_coords(shift_up10_left20, image.shape) >>> warped_image = map_coordinates(image, coords)
相關用法
- Python skimage.transform.warp_polar用法及代碼示例
- Python skimage.transform.warp用法及代碼示例
- Python skimage.transform.hough_circle_peaks用法及代碼示例
- Python skimage.transform.hough_ellipse用法及代碼示例
- Python skimage.transform.resize用法及代碼示例
- Python skimage.transform.hough_line_peaks用法及代碼示例
- Python skimage.transform.integrate用法及代碼示例
- Python skimage.transform.frt2用法及代碼示例
- Python skimage.transform.estimate_transform用法及代碼示例
- Python skimage.transform.hough_circle用法及代碼示例
- Python skimage.transform.rotate用法及代碼示例
- Python skimage.transform.rescale用法及代碼示例
- Python skimage.transform.ifrt2用法及代碼示例
- Python skimage.transform.resize_local_mean用法及代碼示例
- Python skimage.transform.hough_line用法及代碼示例
- Python skimage.transform.downscale_local_mean用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.transform.warp_coords。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。