用法:
cucim.skimage.registration.optical_flow_tvl1(reference_image, moving_image, *, attachment=15, tightness=0.3, num_warp=5, num_iter=10, tol=0.0001, prefilter=False, dtype=<class 'numpy.float32'>)
粗到細的光流估計器。
TV-L1 求解器應用於圖像金字塔的每個級別。 TV-L1 是 Zack 等人引入的一種流行的光流估計算法。 [1] ,在 [2] 中改進並在 [3] 中詳細說明。
- reference_image:ndarray,形狀(M,N[,P[,…]])
序列的第一幅灰度圖像。
- moving_image:ndarray,形狀(M,N[,P[,…]])
序列的第二個灰度圖像。
- attachment:浮點數,可選
附件參數([1] 中的 )。該參數越小,返回的結果越平滑。
- tightness:浮點數,可選
密封性參數([1] 中的 )。它應該具有較小的值,以便保持對應的附件和正則化部分。
- num_warp:整數,可選
image1 扭曲的次數。
- num_iter:整數,可選
定點迭代次數。
- tol:浮點數,可選
公差用作停止標準,基於 (u, v) 的兩個連續值之間的 L² 距離。
- prefilter:布爾型,可選
是否在每個圖像扭曲之前對估計的光流進行預過濾。當為 True 時,將應用沿每個軸的窗口大小為 3 的中值濾波器。這有助於消除潛在的異常值。
- dtype:dtype,可選
輸出數據類型:必須是浮點數。與雙精度相比,單精度提供了良好的結果並節省了內存使用和計算時間。
- flow:ndarray,形狀((image0.ndim,M,N[,P[,…]])
每個軸的估計光流分量。
參數:
返回:
注意:
不支持彩色圖像。
參考:
- 1(1,2,3)
Zach, C., Pock, T., & Bischof, H. (2007, September). A duality based approach for realtime TV-L 1 optical flow. In Joint pattern recognition symposium (pp. 214-223). Springer, Berlin, Heidelberg. DOI:10.1007/978-3-540-74936-3_22
- 2
Wedel, A., Pock, T., Zach, C., Bischof, H., & Cremers, D. (2009). An improved algorithm for TV-L 1 optical flow. In Statistical and geometrical approaches to visual motion analysis (pp. 23-45). Springer, Berlin, Heidelberg. DOI:10.1007/978-3-642-03061-1_2
- 3
Pérez, J. S., Meinhardt-Llopis, E., & Facciolo, G. (2013). TV-L1 optical flow estimation. Image Processing On Line, 2013, 137-150. DOI:10.5201/ipol.2013.26
例子:
>>> import cupy as cp >>> from cucim.skimage.color import rgb2gray >>> from skimage.data import stereo_motorcycle >>> from cucim.skimage.registration import optical_flow_tvl1 >>> image0, image1, disp = [cp.array(a) for a in stereo_motorcycle()] >>> # --- Convert the images to gray level: color is not supported. >>> image0 = rgb2gray(image0) >>> image1 = rgb2gray(image1) >>> flow = optical_flow_tvl1(image1, image0)
相關用法
- Python cucim.skimage.restoration.richardson_lucy用法及代碼示例
- Python cucim.skimage.restoration.calibrate_denoiser用法及代碼示例
- Python cucim.skimage.restoration.wiener用法及代碼示例
- Python cucim.skimage.restoration.unsupervised_wiener用法及代碼示例
- Python cucim.skimage.restoration.denoise_tv_chambolle用法及代碼示例
- Python cucim.skimage.feature.shape_index用法及代碼示例
- Python cucim.skimage.filters.threshold_triangle用法及代碼示例
- Python cucim.skimage.util.invert用法及代碼示例
- Python cucim.skimage.data.binary_blobs用法及代碼示例
- Python cucim.skimage.filters.roberts_neg_diag用法及代碼示例
- Python cucim.skimage.color.lch2lab用法及代碼示例
- Python cucim.skimage.measure.label用法及代碼示例
- Python cucim.skimage.color.rgb2gray用法及代碼示例
- Python cucim.skimage.filters.gabor用法及代碼示例
- Python cucim.skimage.transform.rescale用法及代碼示例
- Python cucim.skimage.filters.roberts_pos_diag用法及代碼示例
- Python cucim.skimage.segmentation.random_walker用法及代碼示例
- Python cucim.skimage.filters.roberts用法及代碼示例
- Python cucim.skimage.morphology.dilation用法及代碼示例
- Python cucim.skimage.feature.corner_foerstner用法及代碼示例
- Python cucim.skimage.measure.moments_coords用法及代碼示例
- Python cucim.skimage.filters.gabor_kernel用法及代碼示例
- Python cucim.skimage.color.hsv2rgb用法及代碼示例
- Python cucim.skimage.morphology.closing用法及代碼示例
- Python cucim.skimage.color.rgb2hed用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cucim.skimage.registration.optical_flow_tvl1。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。