在开罗python中有基于svg注释的图像裁剪功能吗?

时间:2013-01-30 10:07:52

标签: opencv image-processing svg python-2.7 cairo

我有JPG图像和inputsvgdraw,一个用于图像标注的闪光工具(http://www.mainada.net/inputdraw)。

作为Gimp或Picasa,当我裁剪图像时,我只将裁剪的部分另存为新图像。我需要一个函数,它将svg路径(代表新的图像bourders)作为参数,然后以此为基础,创建新图像。

svg数据:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 325"><g fill="none"   stroke-miterlimit="6" stroke-linecap="round" stroke-linejoin="round"><path d="M 307 97 l 0 -1 l -2 -1 l -10 -2 l -20 -1 l -25 5 l -22 9 l -10 9 l 0 9 l 2 12 l 16 18 l 25 11 l 25 5 l 17 -1 l 6 -4 l 3 -7 l -1 -12 l -6 -16 l -7 -13 l -11 -12 l -11 -14 l -9 -5" opacity="1" stroke="rgb(170,37,34)" stroke-width="5"/></g></svg>.

如何在圆形部分图像中提取并保存新图像?有没有处理这个的库? 有一种方法可以在python和裁剪图像中为图像库中的函数转换这些数据吗?

0 个答案:

没有答案