のvlaueを与えます。しかし、何か奇妙なことが起こる、私はいつも目が開いても-1
として確率を得る。getIsLeftEyeOpenProbabilityは、私は目が開いているかどうかを知るために<code>mobile vision API</code>から<code>getIsLeftEyeOpenProbability</code>を使用しています-1
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
}
}
このエラーが発生する理由、そしてどのように私はそれを解決することができます:ここで
は、コードのですか?
ありがとうございました。しかし、この行のブールisLeftOpen = thisFace.getIsLeftEyeOpenProbability();浮動小数点数をブール値に変換できないため、私にエラーが発生します。この行の意味を明確にしてください。または、isLeftOpenが浮動小数点型であることを意味しましたか? – Dania
それはタイプミスでした。それを私が直した。 – pm0733464
ありがとう、それは非常にうまくいった。 – Dania