我使用findHomography函数获得H矩阵。
H = findHomography(points_src, points_dst);
Run Code Online (Sandbox Code Playgroud)
然后,将H与warpPerspective一起使用以获取图像的透视投影
warpPerspective(im_src, im_dst, H, Size(100, 100));
Run Code Online (Sandbox Code Playgroud)
从这里我得到了一些兴趣点
vector<Point2f> points = some_function(im_dst)
Run Code Online (Sandbox Code Playgroud)
现在,我只想让“点”集返回到原始图像,这样,我现在就可以将原始图像中的关注点集还原。
对于此任务,我猜想我需要再次使用warpPerspective和标志WARP_INVERSE_MAP,但这不起作用。
我在Windows中使用过gdal api,但现在我需要在Linux(Ubuntu)中使用它.我不知道如何为c ++安装库,也不知道如何使用g ++或其他编译器构建gdal程序.
我看到UbuntuGis有图书馆(我想).我在source.list文件中添加了:
deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu raring main deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu raring main
我安装了gdal-bin,但我认为不是它是库,我不知道该怎么做.