【问题标题】:how to calculate the image quality score in arcore in android?如何在android中计算arcore中的图像质量分数?
【发布时间】: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


    【解决方案1】:

    第一步:从官网下载arcoreimg工具

    https://github.com/google-ar/arcore-android-sdk/blob/master/tools/arcoreimg/linux/arcoreimg

    第 2 步:试试这个命令

    ./arcoreimg eval-img --input_image_path=yourImagePath
    

    示例命令

    ./arcoreimg eval-img --input_image_path=/Users/ranjithkumar/Downloads/sceneform-android-sdk-1.15.0/samples/augmentedimage/app/src/main/assets/default.jpg
    

    第 3 步:如果遇到任何错误,请授予 arcoreimg 工具的读写权限。

    (如果第 2 步有效,请忽略此内容)

    sudo chmod +x arcoreimg
    

    它返回 0 到 100 的分数。高分不会滞后。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 2019-06-21
      • 2017-06-14
      • 2011-05-11
      • 2012-12-03
      • 1970-01-01
      相关资源
      最近更新 更多