我正在使用Dlib来检测脸部地标。
如果我使用z3 compact来检测它,我可以得到68分。
但是,我在其他设备上得到 0点,例如nexus 5x,z5或一加二。
private Runnable landmarkDetection = new Runnable() {
public void run() {
// TODO Auto-generated method stu
try {
Canvas canvas = new Canvas(temp);
canvas.drawBitmap(temp, new Matrix(), null);
if (mFaceDet == null) {
mFaceDet = new FaceDet(Constants.getFaceShapeModelPath());
}
List<VisionDetRet> faceList = mFaceDet.detect(path);
if (faceList.size() > 0) {
for (VisionDetRet ret : faceList) {
float width = 1080;
// By ratio scale
float aspectRatio = originalImg.getWidth() / (float) originalImg.getHeight();
float resizeRatio = 1;
final int MAX_SIZE = 1;
newWidth = 1080;
newHeight = 1380;
newHeight = Math.round(newWidth / aspectRatio);
if (originalImg.getWidth() > MAX_SIZE && originalImg.getHeight() > MAX_SIZE) {
originalImg = getResizedBitmap(originalImg, newWidth, newHeight);
resizeRatio = (float) originalImg.getWidth() / (float) width;
Log.d("resizeRatio ", resizeRatio + "");
}
ArrayList<Point> landmarks = ret.getFaceLandmarks();
int count = 0;
for (Point point : landmarks) {
float pointX = (point.x * resizeRatio);
float pointY = (point.y * resizeRatio);
landmark_pt_x.add(pointX);
landmark_pt_y.add(pointY);
Log.d(TAG, count + " " + pointX + " : " + pointY);
count++;
drawpoint(pointX, pointY, temp, canvas);
}
Log.d(TAG + " added landmark", count + "");
}
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "No face", Toast.LENGTH_SHORT).show();
}
});
}
runOnUiThread(new Runnable() {
@Override
public void run() {
imageView.setImageBitmap(originalImg);
progressDialog.dismiss();
}
});
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
};
ArrayList&lt;点&gt; landmarks = ret.getFaceLandmarks();
为什么我无法获得变量&#39; point&#39;?请给我一些帮助。非常感谢你。