GoodScanner

OTHER License

Stars
3

GoodScanner

Text Recognition Details

  • Text Recognition

    • StillImageActivity.kt
      • onGlobalLayout(), onActivityResult() tryReloadAndDetectInImage()
      • tryReloadAndDetectInImage()
        • imageUri image BitmapUtils.getBitmapFromContentUri() image Bitmap
        • Bitmap size Text Recognition AI model input size resize resizedBitmap .
        • imageProcessor!!.processBitmap(resizedBitmap, graphicOverlay) resizedBitmap graphicOverlay .
          • imageProcessor = TextRecognitionProcessor(this, KoreanTextRecognizerOptions.Builder().build())
          • processBitmap() VisionProcessorBase.kt
    • VisionProcessorBase.kt
      • processBitmap()
        • requestDetectInImage()
      • requestDetectInImage()
        • tryReloadAndDetectInImage() resizedBitmap input(image: InputImage)
        • setUpListener
          • detectInImage(image)
          • detectInImage() OnSuccessListener OnFailureListener (addOnSuccessListener, addOnFailureListener)
    • TextRecognitionProcessor.kt
      • detectInImage()
        • VisionProcessorBase.kt abstract fun TextRecognitionProcessor.kt
        • textRecognizer.process(image)
        • textRecognizer: TextRecognizer = TextRecognition.getClient(textRecognizerOptions)
      • process()
        • AI model
        • JNI Native code OnSuccessListner onSuccess() OnFailureListner onFailure()
      • onSuccess()
        • graphicOverlay TextGraphic(graphicOverlay, text, shouldGroupRecognizedTextInBlocks) text
        • text add TextGraphic.kt draw()
  • Text Recognition

    • VisionProcessorBase.kt
    • TextRecognitionProcessor.kt
      • onSuccess(text: Text, graphicOverlay: com.good.scanner.GraphicOverlay)
    • TextGraphic.kt
      • private val text: Text
      • Text class .
  • Text class

    • text.text:

    • text.textBlocks detection textblock for

      for (textBlock in text.textBlocks) { // Renders the text at the bottom of the box.
        Log.d(TAG, "TextBlock text is: " + textBlock.text)
        Log.d(TAG, "TextBlock boundingbox is: " + textBlock.boundingBox)
        Log.d(TAG, "TextBlock cornerpoint is: " + Arrays.toString(textBlock.cornerPoints))
      
    • textblock lines for

    for (line in textBlock.lines) {
      Log.d(TAG, "Line text is: " + line.text)
      Log.d(TAG, "Line boundingbox is: " + line.boundingBox)
      Log.d(TAG, "Line cornerpoint is: " + Arrays.toString(line.cornerPoints))
    
    • line elements for
    for (element in line.elements) {
      Log.d(TAG, "Element text is: " + element.text)
      Log.d(TAG, "Element boundingbox is: " + element.boundingBox)
      Log.d(TAG, "Element cornerpoint is: " + Arrays.toString(element.cornerPoints))
      Log.d(TAG, "Element language is: " + element.recognizedLanguage)
    

  1. StillImageActivity.kt imageProcessor.!!processBitmap() Text Recognition bitmap OpenCV bitmap(image) bitmap

    • bitmap pdf !

    • bitmap processBitmap parameter text recognition !

  2. Text Recognition visualization

    • web textblock visualization

    • Best docx layout visualization(?)

      • Text size bounding box layout
      • bounding box image layout