You are on page 1of 11

Mini Project

Report On

“Text Scanner Application”

SUBMITTED TO SAVITRIBAI PHULE PUNE UNIVERSITY BACHELOR OF

ENGINEERING

(Computer Engineering)

By

1. Tejas Kolambe (A-29)

2. Shivam Gade (A-17)

3. Abhishek Ingle (B-15)

UNDER THE GUIDANCE OF

Prof .Bharti Kudale

Department of Computer Engineering

Genba Sopanrao Moze College Of Engineering,

Balewadi,Pune-

2022-2023
Problem Statement:

This project is to create a Text Scanner from which user can scan text from image. To
develop an instant Text to enable users to seamlessly detect text from image. The project
should be very easy to use enabling even a novice person to use it.

Introduction:

Text Scanner is the electronic or mechanical conversion of images of typed, handwritten or


printed text into machine-encoded text, whether from a scanned document, a photo of a
document, a scene-photo (for example the text on signs and billboards in a landscape photo)
or from subtitle text superimposed on an image .
Widely used as a form of data entry from printed paper data records – whether passport
documents, invoices, bank statements, computerized receipts, business cards, mail, printouts
of static-data, or any suitable documentation – it is a common method of digitizing printed
texts so that they can be electronically edited, searched, stored more compactly, displayed on-
line, and used in machine processes such as cognitive computing, machine translation,
(extracted) text-to-speech, key data and text mining. OCR is a field of research in pattern
recognition, artificial intelligence and computer vision.

Merits of proposed system:

1. Reduce expenses
2. Increase Scale
3. Improve customer service and loyality
4. Discover customer pain points.
5. Faster problem resolution.
6. Customer convenience
7. Competitive advantages.
8. Expand market reach.
9. Proactive outreach
10. Reports and analytics

Methodology:
User modules:

After Installation is done user will get a pop up of giving permission to take to use camera ,
storage and use all features.

Scanner Module:
You can convert an image file to a searchable PDF as well. The optical character recognition
is performed on the image file to enable full-text searching across the file. After the
conversion, you can find, for example, a contract document converted from an image by
performing a search using the names of the contracting parties or any other text included in
the original image file.

Hardware Software requirements:

Software:

 Android Studio
 Microsoft Windows 7/8/10 (32 or 64 bit)
 Java Development Kit (JDK) 8

Hardware Requirements:
 2 GB RAM minimum, 8 GB recommended
 2 GB of available disk space minimum, 4 GB recommended (500 MB for IDE + 1.5
GB for Android SDK and emulator system image)
 1280 x 800 minimum screen resolution

Advantages:
 Anonymity.
 The chance to meet new people with different views.
 The opportunity to get perspectives from around the world.
 Easy to find people based on your age, gender identity, interests, and goals free and
easy to use.
Disadvantages:
 It works efficiently with the printed text only and not with handwritten text. Hand-
writing must be learnt by the pc.
 There is the need of lot of space required by the image produced.
 The quality of the image can be lose during this process.
 Quality of the ultimate image depends on quality of the first image.
 All the documents got to be checked over carefully then manually corrected.
 Not 100% accurate, there are likely to be some mistakes made during the method.
 Not worth doing for little amounts of text.

Code:
MainActivity.java
package com.example.textdemo;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.ml.vision.FirebaseVision;
import com.google.firebase.ml.vision.common.FirebaseVisionImage;
import com.google.firebase.ml.vision.text.FirebaseVisionText;
import com.google.firebase.ml.vision.text.FirebaseVisionTextRecognizer;

public class MainActivity extends AppCompatActivity {

ImageView imageView;
TextView textView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//find imageview
imageView = findViewById(R.id.imageId);
//find textview
textView = findViewById(R.id.textId);
//check app level permission is granted for Camera
if (checkSelfPermission(Manifest.permission.CAMERA) !=
PackageManager.PERMISSION_GRANTED){
//grant the permission
requestPermissions(new String[]{Manifest.permission.CAMERA}, 101);
}
}
public void doProcess(View view) {
//open the camera => create an Intent object
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 101);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bundle bundle = data.getExtras();
//from bundle, extract the image
Bitmap bitmap = (Bitmap) bundle.get("data");
//set image in imageview
imageView.setImageBitmap(bitmap);
//process the image
//1. create a FirebaseVisionImage object from a Bitmap object
FirebaseVisionImage firebaseVisionImage = FirebaseVisionImage.fromBitmap(bitmap);
//2. Get an instance of FirebaseVision
FirebaseVision firebaseVision = FirebaseVision.getInstance();
//3. Create an instance of FirebaseVisionTextRecognizer
FirebaseVisionTextRecognizer firebaseVisionTextRecognizer =
firebaseVision.getOnDeviceTextRecognizer();
//4. Create a task to process the image
Task<FirebaseVisionText> task =
firebaseVisionTextRecognizer.processImage(firebaseVisionImage);
//5. if task is success
task.addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() {
@Override
public void onSuccess(FirebaseVisionText firebaseVisionText) {
String s = firebaseVisionText.getText();
textView.setText(s);
}
});
//6. if task is failure
task.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(),
Toast.LENGTH_LONG).show();
}
});
}
}

Activity_Main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:id="@+id/imageId"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="take pic"
android:onClick="doProcess"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textId"/>

</LinearLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.textdemo">

<uses-permission android:name="android.permission.CAMERA"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="ocr" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
</application>

</manifest>
Output:
Result:
Conclusion :

There is always a room for improvements in any apps. Right now we are just dealing with
text Scan. There are several android apps which serve similar purpose as this project, but
these apps were rather difficult to use and provide confusing interfaces. A positive first
impression is essential in human relations hip as well as in human computer interaction. This
project hopes to develop a text scan service Android app with high quality user interface

References:

1.Anon., 2015. Development of a Health Care Assistant App for the


Seniors. International Journal of Applied Science and
Engineering, pp. 3-5.
2.Jianye Liu; Jiankun Yu, Research on Development of Android
Applications, 4th International Conference on Intelligent
Networks and Intelligent Systems, 15 December 2011

3.Abhinav Kathuria et al, Challenges in Android Application


Development: A Case Study, Vol.4 Issue.5, May- 2015, pg.
294-299

4. Li Ma et al, Research and Development of Mobile Application


for Android Platform, International Journal of Multimedia and
Ubiquitous Engineering 9(4):187-198 • April 2014
TABLE OF CONTENTS

1. PROBLEM STATEMENT

2. INTRODUCTION

3. MATHEMATICAL MODEL

4. METHODOLOGY

4.1 ALOGORITHMS

4.2 SOFTWARE AND HARDWARE DETAILS

4.3 LIBRARIES / PACKAGES USED

5. ADVANTAGES , DISADVANTAGES & APPLICATION

6. RESULTS

7. CONCLUSION

8. REFRENCES

You might also like