Professional Documents
Culture Documents
Report On
ENGINEERING
(Computer Engineering)
By
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:
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.
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;
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
<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" />
</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. PROBLEM STATEMENT
2. INTRODUCTION
3. MATHEMATICAL MODEL
4. METHODOLOGY
4.1 ALOGORITHMS
6. RESULTS
7. CONCLUSION
8. REFRENCES