I want to calculate the image quality score before adding the image in ARCore database. I read arcoreimg google documentation to calculate the quality score but they are calculating score on windows/Mac OS command line. I want to calculate the image quality score programmatically in my project. How can i do it. Please help. I also check this stackoverflow link, but not getting the solution. Thanks :)
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();
}
}