Vision API裁剪面地标 [英] Vision API Cropping Face Landmark

查看:130
本文介绍了Vision API裁剪面地标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用路径勾勒出整个图像,以便可以将其裁剪掉,但是该路径未遵循人脸的轮廓.这是我的代码:

I'm trying to outline the whole image with a path so I could crop it out, but the path is not following the face's outline. Here's my code :

 for (Landmark landmark : face.getLandmarks()) {
                    if (face.getLandmarks().indexOf(landmark) == 0) {
                        path.moveTo(landmark.getPosition().x, landmark.getPosition().y);
                    } else {
                        path.lineTo(landmark.getPosition().x, landmark.getPosition().y);
                    }
            }

如何使路径仅遵循面部的外部轮廓

How do I make it so that the path only follows the outer outline of the face

推荐答案

查看类型.如果要查看类型,则将知道下一个要使用的地标,而不是数组中下一个要使用的地标.

Look at the Type of each landmark. If you are looking at types, you will know which landmark to use next rather than whichever landmark is next in the array.

这篇关于Vision API裁剪面地标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆