public DrawFaceAlign(FaceDetector.face_point face_Point, double height, double width) { img_height = height; img_width = width; face_landmark = face_Point; Init_faceAlign(face_landmark); }
public void Init_faceAlign(FaceDetector.face_point fp) { //face_landmark // - eye : 5~6 // - mouth : 7~8 eye_L = new EllipseGeometry(); eye_L.Center = OpenCVPoint2W_Point(face_landmark.eye[0]); eye_L.RadiusX = 3; eye_L.RadiusY = 3; eye_R = new EllipseGeometry(); eye_R.Center = OpenCVPoint2W_Point(face_landmark.eye[1]); eye_R.RadiusX = 3; eye_R.RadiusY = 3; mouth_L = new EllipseGeometry(); mouth_L.Center = OpenCVPoint2W_Point(face_landmark.mouse[0]); mouth_L.RadiusX = 3; mouth_L.RadiusY = 3; mouth_R = new EllipseGeometry(); mouth_R.Center = OpenCVPoint2W_Point(face_landmark.mouse[1]); mouth_R.RadiusX = 3; mouth_R.RadiusY = 3; // midline 연장하기 midline = new LineGeometry(); W_Point midpoint = new W_Point(); midpoint.X = (eye_L.Center.X + eye_R.Center.X) / 2; midpoint.Y = 0; midline.StartPoint = midpoint; midline.EndPoint = new W_Point(midpoint.X, img_height); // noseline_L 연장하기 noseline_L = new LineGeometry(); W_Point LeyelinePoint = new W_Point(); LeyelinePoint.X = eye_L.Center.X + ((midpoint.X - eye_L.Center.X) / 2); LeyelinePoint.Y = 0; noseline_L.StartPoint = LeyelinePoint; noseline_L.EndPoint = new W_Point(LeyelinePoint.X, img_height); // noseline_R 연장하기 noseline_R = new LineGeometry(); W_Point ReyelinePoint = new W_Point(); ReyelinePoint.X = eye_R.Center.X - ((eye_R.Center.X - midpoint.X) / 2); ReyelinePoint.Y = 0; noseline_R.StartPoint = ReyelinePoint; noseline_R.EndPoint = new W_Point(ReyelinePoint.X, img_height); // eyeline eyeline = new LineGeometry(); eyeline.StartPoint = new System.Windows.Point(face_landmark.eye[0].X, face_landmark.eye[0].Y); eyeline.EndPoint = new System.Windows.Point(face_landmark.eye[1].X, face_landmark.eye[0].Y); // lipline lipline = new LineGeometry(); lipline.StartPoint = new System.Windows.Point(face_landmark.mouse[0].X, face_landmark.mouse[0].Y); lipline.EndPoint = new System.Windows.Point(face_landmark.mouse[1].X, face_landmark.mouse[0].Y); }
public DrawFaceAlign() { face_landmark = new FaceDetector.face_point(); mainwnd = System.Windows.Application.Current.MainWindow as ToothTemplate_Step; }