-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help using Dlib coordinates #30
Comments
Yes you could return the calculated coordinates from the |
It worked perfectly, man! However, I came across with one last "coordinate conversion" issue. The code after the modification seems like:
Now, inside my ViewController.swift, I declared an global variable for "myView" as follow:
And finally, inside my SessionHandler.swift file, I did like:
Then, I noticed that the position of the points are not coinciding, and things seems mislocated. I think I need to make some coordinate (x,y) conversion. Any ideia? Thanks! |
If I understand the problem correctly, yes you need some coordinate conversion. In this line: https://github.com/zweigraf/face-landmarking-ios/blob/master/DisplayLiveSamples/SessionHandler.swift#L72 we first convert the metadata object into some other format depending on camera orientation and stuff like that. Then, in this line: https://github.com/zweigraf/face-landmarking-ios/blob/master/DisplayLiveSamples/DlibWrapper.mm#L87 we are converting those coordinates into Dlib suitable coordinates. If you want to use the points again in SessionHandler, after calculating your point, you first need to reverse the Dlib conversion from DlibWrapper (instead of iOS-> Dlib make it Dlib->iOS), and then maybe reverse the camera conversion from SessionHandler. |
@zweigraf Any idea how do I convert Dlib to iOS points ? Anyone tried to figure out. |
@ccastelano hi, did you manage to solve "coordinate conversion" issue |
@harshchitrla hi. The coordinates returned by Dlib are the coordinates of the original image. You only need to convert the original image coordinate to you UIImageView or containerView coordinates. That depend of you content mode and the container size. |
Hey, has anyone found a solution to this? |
First of all, congratulations for your good job!
My question is: Is there any way to grab the coordinates (x, y) of the points detected by the algorithm, inside the "SessionHandler.swift" file? (more specifically inside the "captureOutput" function). I'm trying to figure out how to do this for a few days, but I couldn't get any further, because I'm having difficuties to understand Objective C and adapt the code. Thank you for sharing!
The text was updated successfully, but these errors were encountered: