nolu bir verim sağlar. Gözün açık olup olmadığını öğrenmek için mobile vision API
numaralı telefondan getIsLeftEyeOpenProbability
kullanıyorum. Ancak, garip bir şey olur, göz açılsa bile her zaman olasılığını -1
alırım. İşte getIsLeftEyeOpen Mobil vizyon API'sinden elde edilen bir olasılık,
FaceDetector faceDetector = new FaceDetector.Builder(getApplicationContext())
.setTrackingEnabled(false)
.setLandmarkType(FaceDetector.ALL_LANDMARKS)
.build();
Frame frame = new Frame.Builder().setBitmap(obtainedBitmap).build();
SparseArray <Face> facesForLandmarks = faceDetector.detect(frame);
faceDetector.release();
Thread homeSwipeThread;
for (int a = 0; a < facesForLandmarks.size(); a++) {
Face thisFace = facesForLandmarks.valueAt(a);
List <Landmark> landmarks = thisFace.getLandmarks();
for (int b = 0; b < landmarks.size(); b++) {
if (landmarks.get(b).getType() == landmarks.get(b).LEFT_EYE) {
leftEye = new Point(landmarks.get(b).getPosition().x, landmarks.get(b).getPosition().y - 3);
} else if (landmarks.get(b).getType() == landmarks.get(b).RIGHT_EYE) {
rightEye = new Point(landmarks.get(b).getPosition().x, landmarks.get(b).getPosition().y - 3);
} //end else if.
} //end inner
//for every detected face check eyes probability:
if (thisFace.getIsLeftEyeOpenProbability() <= 0.1) {
//some code
}
}
Bunun nedeni nedir ve bunu nasıl çözebilir?
Bu büyük açıklama için teşekkür ederiz. Ancak bu satır boolean isLeftOpen = thisFace.getIsLeftEyeOpenProbability(); float boolean'a dönüştürülemediği için bana hata veriyor, lütfen bu satırdan ne demek istiyorsunuz? Ya da, LeftOpen'ın yüzdüğü anlamına mı geliyor? – Dania
Bu bir yazım hatasıydı. Onardım. – pm0733464
Teşekkür ederim, çok iyi çalıştı. – Dania