Bakalavrning bitiruv ishi mavzu: Android tizimli telefonlar uchun skaner ilovasini yaratish



Yüklə 3,16 Mb.
səhifə19/19
tarix24.11.2023
ölçüsü3,16 Mb.
#134070
1   ...   11   12   13   14   15   16   17   18   19
Android tizyaratish

OCR result:
public class OcrResult { private Bitmap bitmap; private String text; private int[] wordConfidences; private int meanConfidence; private List regionBoundingBoxes; private List textlineBoundingBoxes; private List wordBoundingBoxes; private List stripBoundingBoxes; private List characterBoundingBoxes; private long timestamp; private long recognitionTimeRequired; private Paint paint; public OcrResult(Bitmap bitmap,
String text, int[] wordConfidences, int meanConfidence,
List regionBoundingBoxes,
List textlineBoundingBoxes,
List wordBoundingBoxes,
List stripBoundingBoxes, List characterBoundingBoxes, long recognitionTimeRequired) { this.bitmap = bitmap; this.text = text;
this.wordConfidences = wordConfidences; this.meanConfidence = meanConfidence; this.regionBoundingBoxes = regionBoundingBoxes; this.textlineBoundingBoxes = textlineBoundingBoxes; this.wordBoundingBoxes = wordBoundingBoxes; this.stripBoundingBoxes = stripBoundingBoxes; this.characterBoundingBoxes = characterBoundingBoxes; this.recognitionTimeRequired = recognitionTimeRequired; this.timestamp = System.currentTimeMillis(); this.paint = new Paint();
}
public OcrResult() { timestamp = System.currentTimeMillis(); this.paint = new Paint();
}
public Bitmap getBitmap() { return getAnnotatedBitmap();
}
private Bitmap getAnnotatedBitmap() { Canvas canvas = new Canvas(bitmap); for (int i = 0; i < wordBoundingBoxes.size(); i++) { paint.setAlpha(0xFF); paint.setColor(0xFF00CCFF); paint.setStyle(Style.STROKE); paint.setStrokeWidth(2); Rect r = wordBoundingBoxes.get(i); canvas.drawRect(r, paint);
}
return bitmap;
}
public String getText() { return text;
}
public int[] getWordConfidences() { return wordConfidences;
}
public int getMeanConfidence() { return meanConfidence;
}
public long getRecognitionTimeRequired() { return recognitionTimeRequired;
}
public Point getBitmapDimensions() { return new Point(bitmap.getWidth(), bitmap.getHeight());
}
public List getRegionBoundingBoxes() { return regionBoundingBoxes;
}
public List getTextlineBoundingBoxes() { return textlineBoundingBoxes;
}
public List getWordBoundingBoxes() { return wordBoundingBoxes;
}
public List getStripBoundingBoxes() { return stripBoundingBoxes;
}
public List getCharacterBoundingBoxes() { return characterBoundingBoxes;
}
public long getTimestamp() { return timestamp;
}
public void setBitmap(Bitmap bitmap) { this.bitmap = bitmap;
}
public void setText(String text) { this.text = text;
}
public void setWordConfidences(int[] wordConfidences) { this.wordConfidences = wordConfidences;
}
public void setMeanConfidence(int meanConfidence) { this.meanConfidence = meanConfidence;
}
public void setRecognitionTimeRequired(long recognitionTimeRequired) { this.recognitionTimeRequired = recognitionTimeRequired;
}
public void setRegionBoundingBoxes(List regionBoundingBoxes) { this.regionBoundingBoxes = regionBoundingBoxes;
}
public void setTextlineBoundingBoxes(List textlineBoundingBoxes) { this.textlineBoundingBoxes = textlineBoundingBoxes;
}
public void setWordBoundingBoxes(List wordBoundingBoxes) { this.wordBoundingBoxes = wordBoundingBoxes;
}
public void setStripBoundingBoxes(List stripBoundingBoxes) { this.stripBoundingBoxes = stripBoundingBoxes;
}
public void setCharacterBoundingBoxes(List characterBoundingBoxes) { this.characterBoundingBoxes = characterBoundingBoxes;
}
@Override public String toString() { return text + " " + meanConfidence + " " + recognitionTimeRequired + " " + timestamp;
}
}


Yüklə 3,16 Mb.

Dostları ilə paylaş:
1   ...   11   12   13   14   15   16   17   18   19




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin