我有一张脸的形状以及该脸的重建,我想对初始形状的相应图像进行建模。
基本上,我想将点从原始形状移动到面部重建指示的位置。我尝试通过使用薄板样条翘曲来做到这一点,它的实现如下:http://ipwithopencv.blogspot.ro/2010/01/thin-plate-spline-example.html http://ipwithopencv.blogspot.ro/2010/01/thin-plate-spline-example.html.
However, it's not working as I would want. I want to have the corners of the image fixed and just to move the corresponding points which define the face. I can illustrate this with 2 pictures. In the first picture I have the shape of the original face with the reconstructed shape.
在这里,我有我想要修改的图片以及使用上面提到的链接中的代码生成的图片。绿色点标记原始面部点,蓝色点标记它们的新位置以及我想要重新定位它们并拉伸我的面部的位置。
我想要的只是将绿点移动到蓝点,使其看起来变形。您知道您已经测试过的任何方法吗?
固定角落非常容易。只需为四个图像角添加四个额外的对应关系即可。就你的例子而言:
iP.push_back(cv::Point(0, 0));
iiP.push_back(cv::Point(0, 0));
iP.push_back(cv::Point(0, height-1));
iiP.push_back(cv::Point(0, height-1));
iP.push_back(cv::Point(width-1, 0));
iiP.push_back(cv::Point(width-1, 0));
iP.push_back(cv::Point(width-1, height-1));
iiP.push_back(cv::Point(width-1, height-1));
当然,在哪里,width是图像宽度,height是图像高度
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)