Tensorflow中的sparse_image_warp无法正常工作?

时间:2019-08-06 08:03:37

标签: tensorflow image-processing

我想对深度学习框架中(可能很小)控制点的源和目标位置指定的图像应用扭曲。而且我认为功能'tf.contrib.image.sparse_image_warp'可以完全满足我的要求。但是在我尝试之后,扭曲的图像看起来并不好。

更具体地说,我想通过脸部界标将源图像扭曲到目标图像。因此,我使用了以下代码:

warped_image, dense_flows = sparse_image_warp(source_image, source_image_landmarks, dest_image_landmarks)

结果在这里:

带有地标的源图像:

具有地标的最佳图像:

变形的结果:

通过其他方法生成的期望结果:

我是否以错误的方式使用该功能?还是该功能无法实现我的需要?

1 个答案:

答案 0 :(得分:0)

请密切注意tf.contrib.image.sparse_image_warp,您需要以 y-x 坐标而不是{ {1}}-x

相关问题