473 lines
8.7 KiB
Java
473 lines
8.7 KiB
Java
package it.acxent.face;
|
|
|
|
import it.acxent.util.DoubleOperator;
|
|
import java.math.RoundingMode;
|
|
|
|
public class Face {
|
|
public static final String RIGHT_CHEEK_CENTER = "RIGHT_CHEEK_CENTER";
|
|
|
|
public static final String LEFT_CHEEK_CENTER = "LEFT_CHEEK_CENTER";
|
|
|
|
public static final String CHIN_RIGHT_GONION = "CHIN_RIGHT_GONION";
|
|
|
|
public static final String CHIN_LEFT_GONION = "CHIN_LEFT_GONION";
|
|
|
|
public static final String CHIN_GNATHION = "CHIN_GNATHION";
|
|
|
|
public static final String FOREHEAD_GLABELLA = "FOREHEAD_GLABELLA";
|
|
|
|
public static final String RIGHT_EAR_TRAGION = "RIGHT_EAR_TRAGION";
|
|
|
|
public static final String LEFT_EAR_TRAGION = "LEFT_EAR_TRAGION";
|
|
|
|
public static final String RIGHT_EYEBROW_UPPER_MIDPOINT = "RIGHT_EYEBROW_UPPER_MIDPOINT";
|
|
|
|
public static final String LEFT_EYEBROW_UPPER_MIDPOINT = "LEFT_EYEBROW_UPPER_MIDPOINT";
|
|
|
|
public static final String RIGHT_EYE_LEFT_CORNER = "RIGHT_EYE_LEFT_CORNER";
|
|
|
|
public static final String RIGHT_EYE_BOTTOM_BOUNDARY = "RIGHT_EYE_BOTTOM_BOUNDARY";
|
|
|
|
public static final String RIGHT_EYE_RIGHT_CORNER = "RIGHT_EYE_RIGHT_CORNER";
|
|
|
|
public static final String RIGHT_EYE_TOP_BOUNDARY = "RIGHT_EYE_TOP_BOUNDARY";
|
|
|
|
public static final String LEFT_EYE_LEFT_CORNER = "LEFT_EYE_LEFT_CORNER";
|
|
|
|
public static final String LEFT_EYE_BOTTOM_BOUNDARY = "LEFT_EYE_BOTTOM_BOUNDARY";
|
|
|
|
public static final String LEFT_EYE_RIGHT_CORNER = "LEFT_EYE_RIGHT_CORNER";
|
|
|
|
public static final String LEFT_EYE_TOP_BOUNDARY = "LEFT_EYE_TOP_BOUNDARY";
|
|
|
|
public static final String NOSE_BOTTOM_CENTER = "NOSE_BOTTOM_CENTER";
|
|
|
|
public static final String NOSE_BOTTOM_LEFT = "NOSE_BOTTOM_LEFT";
|
|
|
|
public static final String NOSE_BOTTOM_RIGHT = "NOSE_BOTTOM_RIGHT";
|
|
|
|
public static final String MOUTH_CENTER = "MOUTH_CENTER";
|
|
|
|
public static final String MOUTH_RIGHT = "MOUTH_RIGHT";
|
|
|
|
public static final String MOUTH_LEFT = "MOUTH_LEFT";
|
|
|
|
public static final String LOWER_LIP = "LOWER_LIP";
|
|
|
|
public static final String NOSE_TIP = "NOSE_TIP";
|
|
|
|
public static final String MIDPOINT_BETWEEN_EYES = "MIDPOINT_BETWEEN_EYES";
|
|
|
|
public static final String RIGHT_OF_RIGHT_EYEBROW = "RIGHT_OF_RIGHT_EYEBROW";
|
|
|
|
public static final String LEFT_OF_RIGHT_EYEBROW = "LEFT_OF_RIGHT_EYEBROW";
|
|
|
|
public static final String RIGHT_OF_LEFT_EYEBROW = "RIGHT_OF_LEFT_EYEBROW";
|
|
|
|
public static final String LEFT_OF_LEFT_EYEBROW = "LEFT_OF_LEFT_EYEBROW";
|
|
|
|
public static final String RIGHT_EYE = "RIGHT_EYE";
|
|
|
|
public static final String LEFT_EYE = "LEFT_EYE";
|
|
|
|
public static final String UPPER_LIP = "UPPER_LIP";
|
|
|
|
private Point B_TOP_LEFT;
|
|
|
|
private Point B_TOP_RIGHT;
|
|
|
|
private Point B_BOTTOM_LEFT;
|
|
|
|
private Point B_BOTTOM_RIGHT;
|
|
|
|
private Point EBL_L;
|
|
|
|
private Point EBL_M;
|
|
|
|
private Point EBL_R;
|
|
|
|
private Point EBR_L;
|
|
|
|
private Point EBR_R;
|
|
|
|
private Point EBR_M;
|
|
|
|
private Point EL_L;
|
|
|
|
private Point EL_T;
|
|
|
|
private Point EL_R;
|
|
|
|
private Point EL_B;
|
|
|
|
private Point EL_C;
|
|
|
|
private Point ER_L;
|
|
|
|
private Point ER_T;
|
|
|
|
private Point ER_R;
|
|
|
|
private Point ER_B;
|
|
|
|
private Point ER_C;
|
|
|
|
private Point E_C;
|
|
|
|
private Point EA_L;
|
|
|
|
private Point EA_R;
|
|
|
|
private Point FORH;
|
|
|
|
private Point N_T;
|
|
|
|
private Point N_LB;
|
|
|
|
private Point N_CB;
|
|
|
|
private Point N_RB;
|
|
|
|
private Point M_L;
|
|
|
|
private Point M_C;
|
|
|
|
private Point M_R;
|
|
|
|
private Point L_T;
|
|
|
|
private Point L_B;
|
|
|
|
private Point CK_L;
|
|
|
|
private Point CK_R;
|
|
|
|
private Point CH;
|
|
|
|
private Point CH_L;
|
|
|
|
private Point CH_R;
|
|
|
|
public static final long PROP = 6400L;
|
|
|
|
private double scaleFactor = -1.0D;
|
|
|
|
public Point getEBL_L() {
|
|
return this.EBL_L;
|
|
}
|
|
|
|
public void setEBL_L(Point eBL_L) {
|
|
this.EBL_L = eBL_L;
|
|
}
|
|
|
|
public Point getEBL_M() {
|
|
return this.EBL_M;
|
|
}
|
|
|
|
public void setEBL_M(Point eBL_M) {
|
|
this.EBL_M = eBL_M;
|
|
}
|
|
|
|
public Point getEBL_R() {
|
|
return this.EBL_R;
|
|
}
|
|
|
|
public void setEBL_R(Point eBL_R) {
|
|
this.EBL_R = eBL_R;
|
|
}
|
|
|
|
public Point getEBR_L() {
|
|
return this.EBR_L;
|
|
}
|
|
|
|
public void setEBR_L(Point eBR_L) {
|
|
this.EBR_L = eBR_L;
|
|
}
|
|
|
|
public Point getEBR_R() {
|
|
return this.EBR_R;
|
|
}
|
|
|
|
public void setEBR_R(Point eBR_R) {
|
|
this.EBR_R = eBR_R;
|
|
}
|
|
|
|
public Point getEBR_M() {
|
|
return this.EBR_M;
|
|
}
|
|
|
|
public void setEBR_M(Point eBR_M) {
|
|
this.EBR_M = eBR_M;
|
|
}
|
|
|
|
public Point getEL_L() {
|
|
return this.EL_L;
|
|
}
|
|
|
|
public void setEL_L(Point eL_L) {
|
|
this.EL_L = eL_L;
|
|
}
|
|
|
|
public Point getEL_T() {
|
|
return this.EL_T;
|
|
}
|
|
|
|
public void setEL_T(Point eL_T) {
|
|
this.EL_T = eL_T;
|
|
}
|
|
|
|
public Point getEL_R() {
|
|
return this.EL_R;
|
|
}
|
|
|
|
public void setEL_R(Point eL_R) {
|
|
this.EL_R = eL_R;
|
|
}
|
|
|
|
public Point getEL_B() {
|
|
return this.EL_B;
|
|
}
|
|
|
|
public void setEL_B(Point eL_B) {
|
|
this.EL_B = eL_B;
|
|
}
|
|
|
|
public Point getEL_C() {
|
|
return this.EL_C;
|
|
}
|
|
|
|
public void setEL_C(Point eL_C) {
|
|
this.EL_C = eL_C;
|
|
}
|
|
|
|
public Point getER_L() {
|
|
return this.ER_L;
|
|
}
|
|
|
|
public void setER_L(Point eR_L) {
|
|
this.ER_L = eR_L;
|
|
}
|
|
|
|
public Point getER_T() {
|
|
return this.ER_T;
|
|
}
|
|
|
|
public void setER_T(Point eR_T) {
|
|
this.ER_T = eR_T;
|
|
}
|
|
|
|
public Point getER_R() {
|
|
return this.ER_R;
|
|
}
|
|
|
|
public void setER_R(Point eR_R) {
|
|
this.ER_R = eR_R;
|
|
}
|
|
|
|
public Point getER_B() {
|
|
return this.ER_B;
|
|
}
|
|
|
|
public void setER_B(Point eR_B) {
|
|
this.ER_B = eR_B;
|
|
}
|
|
|
|
public Point getER_C() {
|
|
return this.ER_C;
|
|
}
|
|
|
|
public void setER_C(Point eR_C) {
|
|
this.ER_C = eR_C;
|
|
}
|
|
|
|
public Point getE_C() {
|
|
return this.E_C;
|
|
}
|
|
|
|
public void setE_C(Point e_C) {
|
|
this.E_C = e_C;
|
|
}
|
|
|
|
public Point getEA_L() {
|
|
return this.EA_L;
|
|
}
|
|
|
|
public void setEA_L(Point eA_L) {
|
|
this.EA_L = eA_L;
|
|
}
|
|
|
|
public Point getEA_R() {
|
|
return this.EA_R;
|
|
}
|
|
|
|
public void setEA_R(Point eA_R) {
|
|
this.EA_R = eA_R;
|
|
}
|
|
|
|
public Point getFORH() {
|
|
return this.FORH;
|
|
}
|
|
|
|
public void setFORH(Point fORH) {
|
|
this.FORH = fORH;
|
|
}
|
|
|
|
public Point getN_T() {
|
|
return this.N_T;
|
|
}
|
|
|
|
public void setN_T(Point n_T) {
|
|
this.N_T = n_T;
|
|
}
|
|
|
|
public Point getN_LB() {
|
|
return this.N_LB;
|
|
}
|
|
|
|
public void setN_LB(Point n_LB) {
|
|
this.N_LB = n_LB;
|
|
}
|
|
|
|
public Point getN_CB() {
|
|
return this.N_CB;
|
|
}
|
|
|
|
public void setN_CB(Point n_CB) {
|
|
this.N_CB = n_CB;
|
|
}
|
|
|
|
public Point getN_RB() {
|
|
return this.N_RB;
|
|
}
|
|
|
|
public void setN_RB(Point n_RB) {
|
|
this.N_RB = n_RB;
|
|
}
|
|
|
|
public Point getM_L() {
|
|
return this.M_L;
|
|
}
|
|
|
|
public void setM_L(Point m_L) {
|
|
this.M_L = m_L;
|
|
}
|
|
|
|
public Point getM_C() {
|
|
return this.M_C;
|
|
}
|
|
|
|
public void setM_C(Point m_C) {
|
|
this.M_C = m_C;
|
|
}
|
|
|
|
public Point getM_R() {
|
|
return this.M_R;
|
|
}
|
|
|
|
public void setM_R(Point m_R) {
|
|
this.M_R = m_R;
|
|
}
|
|
|
|
public Point getL_T() {
|
|
return this.L_T;
|
|
}
|
|
|
|
public void setL_T(Point l_T) {
|
|
this.L_T = l_T;
|
|
}
|
|
|
|
public Point getL_B() {
|
|
return this.L_B;
|
|
}
|
|
|
|
public void setL_B(Point l_B) {
|
|
this.L_B = l_B;
|
|
}
|
|
|
|
public Point getCK_L() {
|
|
return this.CK_L;
|
|
}
|
|
|
|
public void setCK_L(Point cK_L) {
|
|
this.CK_L = cK_L;
|
|
}
|
|
|
|
public Point getCK_R() {
|
|
return this.CK_R;
|
|
}
|
|
|
|
public void setCK_R(Point cK_R) {
|
|
this.CK_R = cK_R;
|
|
}
|
|
|
|
public Point getCH() {
|
|
return this.CH;
|
|
}
|
|
|
|
public void setCH(Point cH) {
|
|
this.CH = cH;
|
|
}
|
|
|
|
public Point getCH_L() {
|
|
return this.CH_L;
|
|
}
|
|
|
|
public void setCH_L(Point cH_L) {
|
|
this.CH_L = cH_L;
|
|
}
|
|
|
|
public Point getCH_R() {
|
|
return this.CH_R;
|
|
}
|
|
|
|
public void setCH_R(Point cH_R) {
|
|
this.CH_R = cH_R;
|
|
}
|
|
|
|
public Point getB_TOP_LEFT() {
|
|
return this.B_TOP_LEFT;
|
|
}
|
|
|
|
public void setB_TOP_LEFT(Point b_TOP_LEFT) {
|
|
this.B_TOP_LEFT = b_TOP_LEFT;
|
|
}
|
|
|
|
public Point getB_TOP_RIGHT() {
|
|
return this.B_TOP_RIGHT;
|
|
}
|
|
|
|
public void setB_TOP_RIGHT(Point b_TOP_RIGTH) {
|
|
this.B_TOP_RIGHT = b_TOP_RIGTH;
|
|
}
|
|
|
|
public Point getB_BOTTOM_RIGHT() {
|
|
return this.B_BOTTOM_RIGHT;
|
|
}
|
|
|
|
private void setScaleFactor(double scaleFactor) {
|
|
this.scaleFactor = scaleFactor;
|
|
}
|
|
|
|
public double getScaleFactor() {
|
|
if (this.scaleFactor < 0.0D && getEA_L() != null && getEA_R() != null) {
|
|
double width = Point.getDistance(getEA_L(), getEA_R());
|
|
DoubleOperator dop = new DoubleOperator(6400.0F);
|
|
dop.setScale(6, RoundingMode.UNNECESSARY);
|
|
dop.divide(width);
|
|
setScaleFactor(dop.getResult());
|
|
}
|
|
return this.scaleFactor;
|
|
}
|
|
|
|
public Point getB_BOTTOM_LEFT() {
|
|
return this.B_BOTTOM_LEFT;
|
|
}
|
|
|
|
public void setB_BOTTOM_LEFT(Point b_BOTTOM_LEFT) {
|
|
this.B_BOTTOM_LEFT = b_BOTTOM_LEFT;
|
|
}
|
|
|
|
public void setB_BOTTOM_RIGHT(Point b_BOTTOM_RIGHT) {
|
|
this.B_BOTTOM_RIGHT = b_BOTTOM_RIGHT;
|
|
}
|
|
}
|