FaceAR / OpenFaceIOS

OpenFace is get from https://github.com/TadasBaltrusaitis/OpenFace, a state-of-the art open source tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation. And I create an ios project. Delete Dlib,TBB,Boost. Only use OpenCV .
GNU General Public License v3.0
504 stars 136 forks source link

FaceLandmarks show incorrect CGPoints while drawing path #14

Open Nisha-SpaceoTech opened 6 years ago

Nisha-SpaceoTech commented 6 years ago

When I try to replace camera with static image, it detects the face landmarks but points are misplaced. Below is the code, where the points are misplaced and it draws the path on wrong position.

if let boundingBox = self.faceLandmarks.inputFaceObservations?.first?.boundingBox { let faceBoundingBox = boundingBox.scaled(to: self.imgView.frame.size) //different types of landmarks

                    let allpoints = observation.landmarks?.allPoints
                    self.convertPointsForFace(allpoints, faceBoundingBox)

}

Can you please help me to get correct facelandmarks points from static image?

KeeganRen commented 6 years ago

@Nisha-SpaceoTech you can use the func only once. FaceARDetect/FaceARDetectIOS.h -(BOOL) run_FaceAR:(cv::Mat)captured_image frame__:(int)frame_count fx:(double)fx fy:(double)fy cx:(double)cx cy:(double)cy;