Vision API Cropping Face Landmark

别说谁变了你拦得住时间么 提交于 2020-03-03 12:30:23

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/55533133/vision-api-cropping-face-landmark

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!