Optical Character Recognition (OCR) App, Assignments of Environmental science

The OCR (Optical Character Recognition) project utilizes machine learning to convert scanned documents or images into editable digital text. The main objective is to automate the digitization and text extraction process, improving efficiency and accuracy in data entry, document management, and text analysis. The OCR software employs computer vision and natural language processing techniques to identify characters and patterns, and convert them into machine-readable format. The project involves training the algorithm on large datasets to enhance its accuracy and performance. OCR technology has broad applications in various industries, and its successful implementation can lead to increased productivity, reduced costs, and better access to information, driving innovation and growth.

Typology: Assignments

2021/2022

Uploaded on 05/14/2023

pratham-sharma-9
pratham-sharma-9 🇮🇳

2 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
i
SCHOOL OF ENGINEERING AND TECHNOLOGY
Project Work
On
“Optical Character Recognition”
For the requirement of 6th Semester (4BCS603 – Mobile Application Development) B.Tech. in Computer
Science and Engineering
Submitted By
Name USN
Pratham Sharma (20BBTCS115)
Pratham Singh (20BBTCS116)
Submitted to
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CMR University
Off Hennur - Bagalur Main Road,
Near Kempegowda International Airport, Chagalahatti,
Bengaluru, Karnataka-562149
Academic Year - 2022-23
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Optical Character Recognition (OCR) App and more Assignments Environmental science in PDF only on Docsity!

i

SCHOOL OF ENGINEERING AND TECHNOLOGY

Project Work

On

“Optical Character Recognition” For the requirement of 6th^ Semester (4BCS603 – Mobile Application Development) B.Tech. in Computer Science and Engineering

Submitted By

Name USN

Pratham Sharma (20BBTCS115)

Pratham Singh (20BBTCS116)

Submitted to

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CMR University

Off Hennur - Bagalur Main Road, Near Kempegowda International Airport, Chagalahatti, Bengaluru, Karnataka- Academic Year - 2022-

ii

SCHOOL OF ENGINEERING AND TECHNOLOGY

Chagalahatti, Bengaluru, Karnataka-

Department of Computer Science and Engineering

CERTIFICATE

Certified that the Project Work entitled “OCR(Optical Character Recognition) ” carried out by

(20BTCS115) and (20BTCS116) bonafide students of SCHOOL OF ENGINEERING AND

TECHNOLGY , in partial fulfillment for the award of BACHELOR OF TECHNOLOGY in 6 th

Semester Computer Science and Engineering of CMR UNIVERSITY , Bengaluru during the year

2021. It is certified that all corrections/suggestions indicated for the Internal Assessment have been

incorporated in the report. The project has been approved as it satisfies the academic requirements in

respect of project work prescribed for the said degree.

Signature of Course In-charge Signature of HOD Signature of Dean …………………… …………………… …………………… Dept. of CSE SoET, CMRU, Bangalore Dept. of CSE SoET, CMRU, Bangalore SoET, CMRU, Bangalore Name of the Examiners: Signature with Date:

  1. …………………… ……………………
  2. …………………… ……………………

iv

ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of this project would be incomplete without the mention of the people who made it possible, without whose constant guidance and encouragement would have made efforts go in vain. I express my sincere gratitude to my project guide Dr. T. Parameswaran, Associate Professor, Dept of CSE , without whose constant guidance and support the project would not be successful. I would like to express my thanks to Dr. Rubini P, Associate Professor and Head , Department of Computer Science and Engineering, School of Engineering and Technology, CMR University, Bangalore, for his encouragement that motivated me for the successful completion of Project work. I express my heartfelt sincere gratitude to Dr. V. R. Manjunath, Dean, School of Engineering and Technology, CMR University for his support. TABLE OF CONTENTS Pratham Sharma(20BBTCS115) Pratham Singh(20BBTCS116)

v

CHAPTER

NO.

CONTENTS PAGE

NO.

1 ABSTRACT 1

2 2.1 INTRODUCTION

2.2 Problem Statement and I/O

3 LITERATURE SURVEY 3

4 SOFTWARE AND HARDWARE REQUIREMENTS 4

5 Design 5 6 IMPLEMENTATION 6.1) Implementation 6 .2) Function used 6.3) Code

7 Result 7.1) Output 7.2) Feature

8 Conclusion 8.1) Conclusion and future work 8.2) Reference

vii

ABSTRACT The OCR (Optical Character Recognition) project is a software development project that utilizes machine learning algorithms to convert scanned documents or images containing printed or handwritten text into editable and searchable digital text. The main objective of the project is to automate the process of digitizing and extracting text from physical documents to increase efficiency and accuracy in data entry, document management, and text analysis. The OCR software uses computer vision techniques to identify characters and patterns in images, and then applies natural language processing to interpret the text and convert it into machine-readable format. The project involves training the OCR algorithm on large datasets of labeled text and images to improve its accuracy and performance. The OCR technology has broad applications in various industries, including finance, healthcare, and legal, where large volumes of paper documents are still prevalent. The project requires a team of skilled software developers, machine learning experts, and domain experts to work together to ensure the OCR software is accurate and reliable. Successful implementation of an OCR project can lead to increased productivity, reduced costs, and better access to information, thereby driving innovation and growth in various industries

2.2 Input/Output: The input a image containing words through the camera or accessing gallery.The output is the functional text which is on the image Application: Optical Character Recognition converts printed texts into digital image files Problem Statement: The problem statement for an OCR app is that traditional methods of digitizing text from physical documents are time-consuming and error-prone. Manual data entry is not only slow but also prone to human errors, which can lead to significant inaccuracies in the extracted data. Moreover, physical documents such as receipts, invoices, and contracts often have different formats and layouts, making it challenging to extract the relevant information accurately. OCR technology can solve these problems by automating the process of digitizing text from physical documents

Chapter III Literature Survey The OCR app was developed using the ArthurHub Image Cropping Library and Java programming language. The following reference documents were used during the development of the app:  Android Developer Documentation: https://developer.android.com/docs/  Java Documentation: https://docs.oracle.com/javase/8/docs/api/  ArthurHub Image Cropping Library: https://github.com/ArthurHub/Android-Image-Cropper

Chapter V System Design Module Level Block Diagram: The OCR comprises two main modules:  The User Interface module: This module includes the UI components that allow users to input the location name and view the weather information.  The App Logic module: This module retrieves data through the library. FIG 5.1: MODULE LEVEL BLOCK DIAGRAM

Chapter VI Implementation: The implementation of an OCR (Optical Character Recognition) app involves the following steps:

  1. Data Collection: Collect a large dataset of labeled images and text to train the OCR algorithm. The dataset should include images of different fonts, styles, and sizes to ensure that the OCR app can accurately recognize text in a variety of formats.
  2. Pre-processing: Pre-process the images to remove any noise or distortion and enhance the text. This can include operations such as cropping, resizing, and contrast adjustment.
  3. OCR Algorithm Development: Develop an OCR algorithm that can accurately recognize and extract text from the pre-processed images. This involves applying computer vision techniques to identify characters and patterns in the images and using natural language processing to interpret the text.
  4. User Interface Design: Design a user interface that allows users to upload images or documents and view the extracted text. The interface should be intuitive and easy to use.
  5. Integration: Integrate the OCR algorithm into the user interface and test the app for accuracy and performance.
  6. Deployment: Deploy the OCR app on a cloud platform or server to make it accessible to users. Ensure that the app is secure and scaleable to handle large volumes of data.
  7. Continuous Improvement: Continuously improve the OCR app by collecting feedback from users and refining the algorithm based on their input. This can include adding new features, improving accuracy, and optimizing performance.
  8. Overall, the implementation of an OCR app requires a combination of technical expertise in computer vision and natural language processing, as well as user interface design and software development skills. A well-designed OCR app can significantly improve the efficiency and accuracy of data entry, document management, and text analysis, making it an invaluable tool for businesses and organizations across various industries. **6.2 Functions Used:-
  9. cropImageActivity(): Used to Crop image using the arthur hub library
  10. getActivityResult():- Get Cropped Image
  11. getTextFromImage():- Extract text from image. 6.3 CODE**

android:visibility="gone" android:id="@+id/button_copy" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="Copy Text" android:layout_margin="8dp"/> Main-Activity.java file: package com.example.ocrapp; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.util.SparseArray; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast;

import com.google.android.gms.vision.Frame; import com.google.android.gms.vision.text.TextBlock; import com.google.android.gms.vision.text.TextRecognizer; import com.theartofdev.edmodo.cropper.CropImage; import com.theartofdev.edmodo.cropper.CropImageView; import java.io.IOException; import java.security.PrivateKey; public class MainActivity extends AppCompatActivity { Button button_capture , button_copy; TextView textview_data; Bitmap bitmap; private static final int REQUEST_CAMERA_CODE = 100; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button_capture = findViewById(R.id.button_capture); button_copy = findViewById(R.id.button_copy); textview_data = findViewById(R.id.text_data); if(ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(MainActivity.this,new String[]{ Manifest.permission.CAMERA },REQUEST_CAMERA_CODE); } button_capture.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { CropImage.activity().setGuidelines(CropImageView.Guidelines.ON).start(MainActivity.this); }

StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < textBlockSparseArray.size();i++){ TextBlock textBlock = textBlockSparseArray.valueAt(i); stringBuilder.append(textBlock.getValue()); stringBuilder.append("\n"); } textview_data.setText(stringBuilder.toString()); button_capture.setText("Retake"); button_copy.setVisibility(View.VISIBLE); } } private void copyToClipBoard(String text) { ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText("Copied Data",text); clipboardManager.setPrimaryClip(clip); Toast.makeText(MainActivity.this, "Copied to Clipboard", Toast.LENGTH_SHORT).show(); } } AndroidManifest.xml file

android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.OCRapp" tools:targetApi="31"> <intent-filter> </intent-filter> Chapter VII