我需要以编程方式确定在图像上覆盖文本的最佳位置。换句话说,我需要从背景中分辨出前景。我试过 imagemagick:http ://www.imagemagick.org/Usage/scripts/bg_removal 。不幸的是,这还不够好。这些图像可以是几乎任何东西的照片,但通常背景模糊。
我现在想试试 liuliu 的 CCV。代码:https ://github.com/liuliu/ccv ,演示: http: //liuliu.me/ccv/js/nss/
该演示使用看起来像 json haar 级联的东西来检测人脸:https ://github.com/liuliu/ccv/blob/unstable/js/face.js
我该怎么做: 1. 将 xml haar 级联文件转换为能够与 CCV 一起使用 2. 为我的目标生成最佳级联(图像上的文本放置) 3. 查找 CCV 的任何文档
最后,有没有更好的方法来解决这个问题?
编辑:我在这里问过边界问题:https ://stackoverflow.com/questions/10559262/programmatically-place-text-in-an-image