image to text converter

Post on 19-Jan-2017

272 Views

Category:

Engineering

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Image to Text Convertor

BY, DHIRAJ RAJMANVENDRA PRIYADARSHI

Agenda :

Abstract AIM Technology Used Procedure Algo I Algo II Algo III Algo IV (Part 1 & 2) Algo V (Part 1 & 2) Advantage Limitations Conclusion

Abstract : Image to text converter is a type of application that can be used to translate images of any format

to the text format. This application helps one to convert the texts in image files into editable text files.

It has some pre-requisite conditions saying first that the text captured should be aligned horizontally straight. Then the text in the image to be converted contains only A, B, C, and D of pre-defined fonts or human written fonts. The image should be captured in a way that the pixel of any of the text should not be present at the coordinate (0, 0). And also the image captured should have texts with intensity of dark color and the background with intensity of light color.

This program basically uses five specific algorithms where the first algorithm deals with converting the text pixels and the background pixels other than text into opposite ranges of RGB so that the text pixels could be identified with ease.

In the second algorithm the image obtained previously is horizontally searched for all the portion of text (in black) area and the dimension of each sentence is found. An array of BufferedImage type is used to store the separated images containing each sentence. The dimension for the portion of image is defined to that array, which is separated by using predefined method drawImage().

The third algorithm deals with extracting each word from each of these sentences into specific images. The words are separated using drawImage() and stored in an array of BufferedImage type.

Abstract Contd. The forth algorithm has two parts. The first part deals with extracting each letters from

each of the words which contain letters of predefined uppercase texts format and the second part deals with extracting each of the letters from each of the words which contain letters of joint lowercase texts format.

The last algorithm deals with extracting each letters from each the words and convert each letter into specific images. The obtained image of letter is then converted into a size with 100x100 pixels using predefined method drawImage() for changing the pixels of the image. The image is matched with predefined strips of co-ordinate. If the image matches every strips condition for letters (particularly for A, B, C & D) then it gets validated for that letter. And, we display the corresponding letter as an output.

Aim :

To build an application to covert in to editable text from image(with standard text/human handwritting).

Technology Used :

Language : Java IDE : NetBeans

Procedure :

Step 1 : Firstly, we have change the color of background to be white and the color of text to be black.

Step 2 : Now, we separate every sentence from the given segment. Step 3 : Then, we split each sentence into words. Step 4 : Each word will then split into letters. Step 5 : Now, we convert the obtained letter into 100x100 pixels. Step 6 : Then, we match the letter with predefined strips of co-

ordinate and validate the letter to be specified one. Step 7 : Finally, we display the corresponding letter as an output.

Algo I :

To change the color of image, we have used predefined class ‘Color’ which is available in java.awt package.

Color c1 = new Color(255, 255, 255); // for White Color c2 = new Color(0, 0, 0); // for Black

Input : Output :

Algo II :

Now, we separate each sentence from the given segment. We start searching horizontally, all the portion of text (in black)

area and count it separately for every horizontal line and store it into an array.

Then we look for that line which has white portion and the previous line should have some text portion and store the co-ordinate of that line into an array.

Then we also look for that line which has white portion and the next line should have some text portion and store the co-ordinate of that line into the same array.

Now, we have the co-ordinates of image from which we need to separate the image.

Algo II continues…. We have created an array of BufferedImage type to store the separated

images. BufferedImage imgs[ ] = new BufferedImage[size]; Then we defined the dimension for the portion of image to that array, which

is need to be separated. We used predefined method drawImage() for separating the image.

Output :Input :

Algo III :

Now, we split each word from the sentence. We start searching vertically, all the portion of text (in black) area and

count it separately for every vertical line and store it into an array. Then we look for that line which has white portion and the increment

the counter by one until we find a line which has text portion onto it and store value of counter into an array and the co-ordinate of that line into another array and use ‘continue’ keyword to skip that iteration and execute next iteration. Also, assign zero to counter so that it calculate next gap.

Then we find the maximum value from the counter and store the co-ordinate of the corresponding line into an array .

Now, we have the co-ordinates of image from which we need to separate the image.

Algo III continues….

Again, we have created an array of BufferedImage type to store the separated images.

BufferedImage imgs[ ] = new BufferedImage[size]; Then we defined the dimension for the portion of image to that array, which

is need to be separated. We used predefined method drawImage() for separating the image.

Input : Output :

Algo IV (Part 1 : Font Text)

Now, we split each letter (font text) from the word. We start searching vertically, all the portion of text (in black) area

and count it separately for every vertical line and store it into an array.

Then we look for that line which has white portion and the previous line should have some text portion and we shift the value to adjust the gap then store the co-ordinate of that line into an array.

Now, we have the co-ordinates of image from which we need to separate the image.

Algo IV (Part 1 : Font Text) continues….

Again, we have created an array of BufferedImage type to store the separated images.

BufferedImage imgs[ ] = new BufferedImage[size]; Then we defined the dimension for the portion of image to that array, which

is need to be separated. We used predefined method drawImage() for separating the image.

Input : Output :

Algo IV (Part 2 : Hand written Text)

Now, we split each letter (hand written text) from the word. We start searching vertically, all the portion of text (in black) area

and count it separately for every vertical line and store it into an array.

Then we look for that line which has minimum portion of text and store the co-ordinate of that line into an array.

We find the line which is next to the stored co-ordinate of minimum portion of text and if it is more than all the minimum portions stored in the array then we shift the value to adjust the gap then store the co-ordinate of that line into another array.

Now, we have the co-ordinates of image from which we need to separate the image.

Algo IV (Part 2 : Hand written Text) continues….

Again, we have created an array of BufferedImage type to store the separated images.

BufferedImage imgs[ ] = new BufferedImage[size]; Then we defined the dimension for the portion of image to that array, which

is need to be separated. We used predefined method drawImage() for separating the image.

Input : Output :

Algo V (Part 1) :

We convert the obtained image of letter into 100x100 pixels. For this purpose we convert the size of image into 100x100

pixels. We used predefined method drawImage() for changing the pixels

of the image.

Input : Output :

Algo V (Part 2) :

We have defined some strips condition for letters (particularly for A, B, C & D).

We match the image with predefined strips of co-ordinate. If the image matches every strips condition then it get validated

for that letter. And, we display the corresponding letter as an output.

Input : Output :

ABCD

Advantage :

Image to text converter utility helps in format portability and compatibility that serves the purpose of using conversion from one format to another. In the present scenario, interchangeable formats are more in demand and software developers around the world need utilities that can convert files from one format to another easily and without too much hassle. This is where the ‘Image To Text Converter’ utility comes into play and the benefits of using the same are required. Further, many of the media houses use the converted files to store and retrieve data whenever they need. This helps in files restoring of image files at one's convenience making life easier for everyone in the process.

Limitations :

The first co-ordinate (0,0) of the image should not be the portion of text.

The handwritten text extracting process is successful for few letters yet.

The joining portion of the hand written text should not have more thickness.

Conclusion :

By this project we can come to the conclusion that we can convert image’s texts into editable text.

Thank You

top related