3

私は顔の特徴検出プロジェクトに取り組んでおり、Haarcascade xml ファイルを使用して OpenCv を使用して目、鼻、口を検出しています。でも、目尻と口角のポイントと鼻の中心が欲しいです。目標は、それを使用して感情を予測することです。このリンクがどのように機能するかを示しています。JAVA を使用してこの結果を取得する必要があります。誰でも私を助けることができますか?

前もって感謝します。

http://cmp.felk.cvut.cz/~uricamic/flandmark/

この部分では、顔の画像を受け取り、顔に drawRect を実行します。

 public void drawFaces(BufferedImage image) {
    final List<PotentialFace> faces = FacialRecognition.run(image, db);
    if (faces.isEmpty()) {
      return;
    }
    Graphics2D g2 = image.createGraphics();
    g2.setStroke(new BasicStroke(2));
    currentFaces.clear();
    for (PotentialFace face : faces) {
      final Rectangle r = face.box;
      final Color c1, c2;
      final String msg;
      if (face.name == null) {
        c1 = c2 = new Color(scale(r.x, getWidth(), 255d), scale(r.y, getHeight(), 255d), 0).brighter();
        msg = "Click to tag";
      } else {
        c1 = new Color(face.name.hashCode()).brighter();
        c2 = new Color((int) (c1.getRGB() - 10*face.confidence));
        msg = String.format("%s: %f", face.name, face.confidence);
      }
      g2.setColor(c1);
      g2.drawRect(r.x, r.y, r.width, r.height);
      g2.setColor(c2);
      g2.drawString(msg, r.x + 5, r.y - 5);
      currentFaces.add(r);
    }
4

1 に答える 1