{"id":21278587,"url":"https://github.com/pranaypatel512/mlkittextrecognize","last_synced_at":"2025-09-07T14:12:51.521Z","repository":{"id":91029088,"uuid":"135563042","full_name":"pranaypatel512/MLKitTextRecognize","owner":"pranaypatel512","description":"Detect text using Firebase ML Kit Text Recognition API","archived":false,"fork":false,"pushed_at":"2018-05-31T10:48:40.000Z","size":12764,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T10:33:54.382Z","etag":null,"topics":["android","firebase","kotlin","kotlin-android","ml-kit"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pranaypatel512.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-31T09:33:38.000Z","updated_at":"2022-08-29T09:08:45.000Z","dependencies_parsed_at":"2023-04-29T23:31:29.438Z","dependency_job_id":null,"html_url":"https://github.com/pranaypatel512/MLKitTextRecognize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pranaypatel512/MLKitTextRecognize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranaypatel512%2FMLKitTextRecognize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranaypatel512%2FMLKitTextRecognize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranaypatel512%2FMLKitTextRecognize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranaypatel512%2FMLKitTextRecognize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pranaypatel512","download_url":"https://codeload.github.com/pranaypatel512/MLKitTextRecognize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranaypatel512%2FMLKitTextRecognize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274046000,"owners_count":25212982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","firebase","kotlin","kotlin-android","ml-kit"],"created_at":"2024-11-21T10:15:12.245Z","updated_at":"2025-09-07T14:12:51.512Z","avatar_url":"https://github.com/pranaypatel512.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"MLKitTextRecognize \n============\n\n### App will:\nUtilize the ML Kit Text Recognition API to detect text in images.\n\n### You'll learn:\nHow we can use Firebase ML Kit SDK in Android with Machine learning capability.\n\n* Get [FirebaseVisionText](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/vision/text/FirebaseVisionText) object from Bitmap:\n```kotlin\n     private fun runTextRecognition() {\n        val image = mSelectedImage?.let { FirebaseVisionImage.fromBitmap(it) }\n        val detector = FirebaseVision.getInstance().visionTextDetector\n        button_text.isEnabled = false\n        image?.let {\n            detector.detectInImage(it)\n                    .addOnSuccessListener {\n                        button_text.isEnabled = true\n                        processTextRecognitionResult(it)\n                    }\n                    .addOnFailureListener {\n                        button_text.isEnabled = true\n                        showToast(it.localizedMessage)\n                    }\n        }\n\n\n     }\n``` \n* Get texts elements result from FirebaseVisionText :\n```kotlin\n     private fun processTextRecognitionResult(firebaseVisionText: FirebaseVisionText?) {\n        firebaseVisionText?.let {\n            val blocks = firebaseVisionText.blocks\n            when (blocks.size) {\n                0 -\u003e showToast(\"No texts found\")\n                else -\u003e {\n                    graphic_overlay.clear()\n                    for (block in blocks.indices) {\n                        val lines = blocks[block].lines\n                        for (line in lines.indices) {\n                            val elements = lines[line].elements\n                            for (element in elements.indices) {\n                                val textGraphic = TextGraphic(graphic_overlay, elements[element])\n                                graphic_overlay.add(textGraphic)\n                            }\n                        }\n                    }\n                }\n            }\n        }\n     }\n``` \n### Output:\n\nImage One result           |Image Two result           | Image Three result            \n:-------------------------:|:-------------------------:|:-------------------------:\n\u003cimg align=\"left\" height=\"350\" src=\"https://github.com/pranaypatel512/MLKitTextRecognize/blob/master/screenshots/image_one_ml_kit_result.png\"\u003e  |\u003cimg align=\"center\" height=\"350\" src=\"https://github.com/pranaypatel512/MLKitTextRecognize/blob/master/screenshots/image_two_ml_kit_result.png\"\u003e | \u003cimg height=\"350\" src=\"https://github.com/pranaypatel512/MLKitTextRecognize/blob/master/screenshots/image_three_ml_kit_result.png\"\u003e\n\n### NOTE:\nTo successfully sync this project, need to set up this app into your Firebase project. \nKindly follow below link to \"Add Firebase to Your Android Project\":\nhttps://firebase.google.com/docs/android/setup \n\n### References: \n\n* [Recognize text in images with ML Kit for Firebase](https://codelabs.developers.google.com/codelabs/mlkit-android/#0)\n* [ML Kit - Text Recognition](https://firebase.google.com/docs/ml-kit/recognize-text)\n\n#### Built With\n\n* [Android Studio](https://developer.android.com/studio/index.html) - The Official IDE for Android\n* [Kotlin](https://kotlinlang.org/) - The Official Language for Android ❤️\n* [Gradle](https://gradle.org/) - Build tool for Android Studio\n\n#### Pull Requests\n\nI welcome and encourage all pull requests to learn something new.\n\n#### Find this project useful ? ❤️\n\nSupport it by clicking the ⭐️ button on the upper right of this page. ✌️\n\n### Images credits\nhttps://unsplash.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranaypatel512%2Fmlkittextrecognize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranaypatel512%2Fmlkittextrecognize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranaypatel512%2Fmlkittextrecognize/lists"}