【发布时间】:2020-10-13 09:02:47
【问题描述】:
我想在将图像添加到 ARCore 数据库之前计算图像质量分数。我读了arcoreimg google documentation 来计算质量分数,但他们正在计算 Windows/Mac OS 命令行上的分数。我想在我的项目中以编程方式计算图像质量分数。我该怎么做。请帮忙。 我还检查了thisstackoverflow 链接,但没有得到解决方案。 谢谢:)
private void registeredImage() {
File file = new File(getExternalFilesDir(null) + "/db.imgdb");
//OutputStream outputStream = getResources().openRawResource(R.raw.imagedb);
Frame CurrFrame = frame;
Image currentImage;
int idx = -1;
byte[] data = null;
try {
currentImage = CurrFrame.acquireCameraImage();
data = NV21toJPEG(YUV_420_888toNV21(currentImage),
currentImage.getWidth(), currentImage.getHeight());
} catch (NotYetAvailableException | IOException | ImageInsufficientQualityException e) {
e.printStackTrace();
}
try {
FileOutputStream outputStream = new FileOutputStream(file);
Bitmap bitmap = BitmapFactory.decodeByteArray(data,0,data.length);
-------------------------------------------------------------
***// Here i want to calculate the quality score of image that i'm going to add in database***.
--------------------------------------------------------------
idx = aid.addImage(name,bitmap);
aid.serialize(outputStream);
outputStream.close();
Toast.makeText(this, "image Registered", Toast.LENGTH_SHORT).show();
} catch (IOException | ImageInsufficientQualityException e) {
Toast.makeText(this, "Image doesnot have enough featues..Please try again", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
【问题讨论】:
标签: java android-studio augmented-reality arcore android-camera2