0

我只是获取 github 代码并在运行时给出了我找到的解决方案并获取 kornia 官方代码以获取透视变换 KORNIA 站点代码:https://kornia.readthedocs.io/en/v0.5.0/tutorials/warp_perspective。 html ,错误在此代码行的底部,错误说:AttributeError:模块'kornia'没有属性'get_perspective_transform'

import torch
import kornia
points_src = torch.tensor([[
    [125., 150.], [562., 40.], [562., 282.], [54., 328.],
]])
h, w = 64, 128 
points_dst = torch.tensor([[
    [0., 0.], [w - 1., 0.], [w - 1., h - 1.], [0., h - 1.],
]])
############################################### ERROR AT HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!########################
M: torch.tensor = kornia.get_perspective_transform(points_src, points_dst)
############################################### ERROR AT HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!########################
4

0 回答 0