File Exchange

image thumbnail

Optical Character Recognition (OCR)

version 1.4 (95.6 KB) by

The aim of OCR is to classify optical patterns corresponding to alphanumeric or other characters.

4.11594
71 Ratings

356 Downloads

Updated

View License

Editor's Note: Popular File 2011 2012 2013

The aim of Optical Character Recognition (OCR) is to classify optical patterns (often contained in a digital image) corresponding to alphanumeric or other characters. The process of OCR involves several steps including segmentation, feature extraction, and classification. This program use Image Processing Toolbox to get it.
For more information, visit: http://www.matpic.com (spanish).

Comments and Ratings (119)

zxf

zxf (view profile)

zxf

zxf (view profile)

thanks

OCR in matlab use what or algorithms does it use neural network or dNN CNN please provide with an answer

Huda Dr

balram naik

for what font and letter size do this code run?

Asma@

Asma@ (view profile)

i am new to this....
can somebody please tell me how to download this file?

11

11 (view profile)

thx

SHAOYU LI

Firstly,I convey my gratitude to you!secondly,i want to say that the ocr can not accomplish the recognition of plate number.SO,can you help me?

Sumita Das

When i try to run this exact code, it shows error.

Error using fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in OCR (line 58)
    fprintf(fid,'%s\n',word);%Write 'word' in text file (upper)

What should I do?

hyun-woo

Thank you very much, and Can I find any documents or papers about this method.

Duc Hoang

Olek San

When can i get or generate letters for Cyrillic?

Javineto

Really useful, but I think that the function "ocr.m" in Matlab is much simple and powerful.

Jacob Berube

Ok, so how do I run this. I need to copy and paste something, but It wont let me do it on a certain program I use, so I went looking for something and I found this. It would be decent if you could add a .exe file!

Arya Arya

Good job. How can I modify the code for other languages?

Nivetha m

HELLOW SIR I TRY THIS CODE BUT I GET BELOW ERROR PLZ HELP METO SOLVE MY PROBLEM
??? Undefined function or method
'detectMSERFeatures' for input arguments of type
'uint8'.

Error in ==> OCRMETHOD at 8
[mserRegions, mserConnComp] = detectMSERFeatures(I,
...

Vishal Gupta

Nandhini R

i am doing a project on extracting OCR from video,please guide me..

Jan Simon

Jan Simon (view profile)

I miss a documentation.
Using a function would be more useful than a script, which disables all warnings (warnings are important to be considered!) and which kills all of my results in the Matlab workspace by a "clc, clear all, close all".

please tell me how to create other fonts for templates.when I have changed my templates to my own it is not working properly
please guide me.
Also what is the font and process used to create template in the code.
Pls answer my question

Mohamed Meska

Fmvelandia

Excellent contribution , thank you very much . Now how I can create other templates for use with sensitive or other text font.
regards,
Mauricio

JIBU mathew

 i am doing project on english handwritten recognition .please guide me ti this
thanks a lot

anh hoang

how to download this file

amir abdi

very god link

amir abdi

amir abdi

hi

Ghaffar gh

Ghaffar gh

ekrem

ekrem (view profile)

Very simply perfect

amandeep

alex yang

Very simple but powerful idea.
Thx..

student s

from where can i download this code. I am under character recognition. Please help me for getting the code

Lutful Kabir

omveer

omveer (view profile)

please from where i get source cod?

QUANG HUY

Please let me know, how can use this OCR with SVM. Thank a lot!

hussein Ali

Good working

sad

sad (view profile)

good

Angie

Angie (view profile)

Wej

Wej (view profile)

Anyone can help, How to run this code ?

Nice work.

msp

msp (view profile)

sir it is not able to detect the text from video frame. please help

thebohr

excuse me for all people,i'm newbie about this..i am a student of computer science departmen and i have an interest of making OCR buat read the character or text from hand writing. for example, i write something on the paper and convert it to digital..is it possible ?
thanks before

Latte

Latte (view profile)

samira

samira (view profile)

Hola diego, tengo una pregunta estoy tratando de hacer un algoritmo que me reconozca las letras usando redes neuronales con una interfaz grafica, pero el manuscrito de prueba lo tengo que cargar, queria saber si habia alguna manera de crear un recuadro sobre el GUI que sea como "paint" y se pueda dibujar la letra directamente ahi con el mouse

tiago

tiago (view profile)

Nice code. I used it to generate the templates for 187 fonts in english. I dont know where to upload it for everyone to use..

OCR_try

nice code...

imran

imran (view profile)

imran

imran (view profile)

Sir its a nice code. i am getting little problem with understanding of this code. can you let me know how did you create the template.mat file from the letters. my is the same i also want to extend this code for lower case letters and local languages. one other thing is that when i replace
 sem=corr2(templates{1,n},imagn); in read_letter.m to directly read the letters images and compare or find the correlation. but it does not gives the accurate results. if you read please must reply me.

Shavi

Shavi (view profile)

Can anybody tell me that how to understand this code for character recognition?
or what is the way
please help.
Its Urgent!!

Wyfi Mcfly

maximum rather

Wyfi Mcfly

nicely done. for more robust results i found preforming a skeletal reduction of the input image text (when properly prepared), and making a template of skeletal comparisons for the correlation coefficient calculation can get around most font issues.
The next thing is properly aligning the input letter to that of the template. This can be accomplished in many ways, or you can simply preform an image rotation of all 360 degrees at take the minimum confidence coefficient of that process.

Shavi

Shavi (view profile)

Hello Diego...
Cheers for ur code..
I want to know that how to recognize special characters like +,/,| etc..??
Also your code is not applicable for lowercase letters so please give me some information that how to tackle this.

Thanks!!

Hello sir
It is perfect code, really thanks
Please send this project pdf

hello sir,the code works well for majority of the images..perhaps doesnt work for joined text.sir,if u cud plz send a text file describing the objective if all the four .m files??

pankaj Durve

i use matlab 6.5,wheh i run oCR project,then templates loading error is come.why error is come?how to error is removed?

Quite good!

sanjana

plz anyone can give me the logic behind this program....on wht basis feature extraction has been done...nd hw Image proceesing tool box is used for simulatin...plz help me out asap....

Mr Smart

Fabio Bento

Quite good!

Popescu

Hello! Did any one succeeded to add some new character templates? I am trying to add the OCR-B font templates but I don't know how to do it. I tried in photoshop but it didn't work. Does anyone know if is there a special program to do it?

Fukuo

Fukuo (view profile)

Thx!
It helps me so much!

Lamis zaki

Really good job , you helped me out :) thnx

Sadegh

Sadegh (view profile)

It is perfect code, really thanks

King Lee

Hi, im planning to improve your code to be able to recognize about the small cases alphabet also,but i cannot access the thumb.db files in the letter number's folder...
Can you tell me it need what to open?

SURYA

SURYA (view profile)

sir, nice your OCR project...i also using your code for my character recognition for my project...but i code some error because of edge of image...can sir look my project and suggest a solution...i need ur help sir..tq

here is my project

http://www.filehosting.org/file/details/203684/my_project.rar

vipin vc

good program
Dear Bogdan

Suppose that we have an image with two lines of text. With "clip", only obtain one line and leave the rest.

Khaing Thaw

Hi Hannah,
these images of letters are in the letters_numbers folder. there are 36 image file, if u also want to recognize lower case letters u can add lower letter image files into that folder. and need to edit and add some coding in .m file in OCR folder.
clip is not built-in function, it is a sub function use in line.m function to crop the lines, u can see it lower part of line.m function.
good luck,
thaw

Claus Becker

Hi Diego and everyone,
Good program, but I have a few questions:
Where/how did you make these images of the letters that are in the template? I need to be able to identify lower case letters as well as upper case and have tried just using microsoft paint but although they are .bmp the appear the wrong format. Any ideas anyone?
Also - what is 'clip'? my matlab doesn't seem to support it but when i changed it to imcrop it stalls.
Thanks,
Hannah

Khaing Thaw

Hi Diego, Nice ur coding, complete in a few lines, functions, templates ,... except clip function :P

Hi Ashley, to find the spaces calculate the spacing of components in image Labeled,. it is my suggestion, how Diego?

Hi Priyanka, add some coding in create_templates.m and image files (BMP, 42x24) for lower characters,.

Thanks Diego,.

Ashley Figer

Dear sir,
how do we detect blank spaces between the characters?
and print them in the output

pupu QQ

not very good for car plate in China.

hi sir, ur work is really good.
i am too trying to implement the same as a part of my academics, so like to know more about the subject. can u please help me ?
i did like to know about the different steps involved in character recognition. can u provide me with some pdf documents which i can depend to complete my project.

Alexandru

Problem solved. The problem was the performance of my PC.

Thanks again for the program

Alexandru

hello,

i use Matlab 7.9.0 (R2009b) and i received an error "Segmentation violation detected" while i tried to run the OCR program. i'm beginner in matlab so can anyone help me please?

PS: thank you Diego for the OCR program

uet taxila

Eurico

Eurico (view profile)

Hi Mr. Diego,
at the moment i'm developing a computer vision system to detect and recognize license plates.I experienced your project and works very well but i have a question. What method are you using to do the recognition? SVM's? Neural Networks?

kind regards

Priyanka M

Hi Diego..
dis is priyanka,from India
It was a very nice job.Can u plz help me with dis project..???
Plz tell me how to recognize lower case letters..?? and also plz help me with how to obtain the bitmap images of the letters u place in letters_numbers folder so dat I can try for the regional languages...
Plz plz plz do reply me....

Diego Barragán

Diego Barragán (view profile)

Dear Bogdan

Suppose that we have an image with two lines of text. With "clip", only obtain one line and leave the rest.

Kind regards.

blue

blue (view profile)

Thank you for answare, but I have a nother question : in lines.m file exist next line:
im_texto=clip(im_texto);
What exactly make cilp in this expresion?

Diego Barragán

Diego Barragán (view profile)

Hello Bogdan

I use IMCROP instead CLIP.

Kind regards.

blue

blue (view profile)

I hava a question for Mr Diego Barragán.
 In the Zip file I cannt find the function clip, but On this page link http://www.matpic.com/MATLAB/MATLAB_OPTICAL_CHARACTER_RECOGNITION.html, exist!!!! Where is integrate this function?

Please can anyone tell me how to implement this code on fpga??
Its urgent....mail me at varun.rampal@yahoo.com

thank you very much

nurul

nurul (view profile)

dear sir,
it was a very nice job. however for certain pics it cant read the image correctly. do u have any idea on how to add the image filtering codes to make this program read the image more accurate?
i really need ur help on this matter.

nurul

nurul (view profile)

Thabit

Thabit (view profile)

Sid H, come on!

If you can do better, we are waiting!

Sid H

Sid H (view profile)

Amateur work, both code and concepts. Not robust. Cant support fonts, noise or files different from what the up-loader provides. But great as a concepts demo for undergrad-and-below classes.

chaogui xia

thank you

Hooman

Hooman (view profile)

Very nice job, I have 2 questions the code ignores white space which should not and also it does not detect lowercase letters.
how should we detect white spaces between words?

Cong Zhou

good job!

Cong Zhou

this program is not working for other image files. i created some image files using paint in ariel and times new roman font. the program failed to give correct result

yusor

yusor (view profile)

Anybody can help me? My FYP is about converting an image to text. Image may be frim newpaper (anywhere) and should be converted into text and saved into Doc. or pdf but it must retain the oiginal format.

Thank u,
Yusser

Rushmi

Rushmi (view profile)

It works great.But for images with dots or small patches the result is ambiguous.If the code can eliminate this problem,(not recognizing non characters) it will be a good algorithm for character recognition.

athi rayan

hello sir please give me as a compltet report in ocr

ved vrath

cz

firas aakroum

?????

manish arora

these files really works..
result not being 100%..

minnal sagi

fine

Bilal KONUK

hi author
i am using matlab 6.5 version. Can i work your project my matlab?

eklil alwrd

Paul Paul

raghav khanna

can u tell me wat feature algorithm r u using??

Tran Dinh Vuong

Dear Sir, I'm doing handwritten english character recognition.Please guide me to progress this project. thanks lot.

Pradeep Mapitigama

Dear Sir,
I'm doing handwritten english character recognition.Please guide me to progress this project.I'm doing this for fullfill the MSc.in computer science.
thanks lot.

Vihang Patil

Nice work. Tried creating my own images of numbers and names alike and found sometimes some letters being wrongly identified, especially I, 1, O,0,Q
Other than that nice work!

John Smith

Good application

Diego Barragán

Hi, this is Diego Barragán, from Ecuador.

I appreciate your comments about OCR.

The error perhaps is due the version of MATLAB. I use version 7.1.0.246 (R14) Service Pack 3.

And other restriction of OCR is the size of letter. The size must be bigger or equal to 42 x 24 pixels.

Regards.

Austin K

this is a very good work.
a very good logic and simple to understand .
yet there are lot of sectors which can improve.
and i dont know why it happens is that there is a error while loading the templates.
always shows that the file was corrupted.
any way best wishes and once again good work.

Updates

1.4

update

1.3

uupdate

1.2

Update.

1.1

update

update

update

Update

MATLAB Release
MATLAB 7.1.0 (R14SP3)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video