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).
Diego Barragán (2021). Optical Character Recognition (OCR) (https://www.mathworks.com/matlabcentral/fileexchange/18169-optical-character-recognition-ocr), MATLAB Central File Exchange. Retrieved .
Inspired: Music Note Recogination, asphere parameters, OPTICAL CHARACTER RECOGNITION(lower case and space included)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
I got an error in read_letter : "Not enough input arguments. Error in read_letter (line 10) for n=1:num_letras"
Can anyone help me to solve it ?
Can someone explain me how to use this in MATLAB??
Sir ! Only images given by you are working. I have tried other images but I am getting incorrect results !please help me with this !
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)
pls can anyone take me through how to rectify this error
great work, sir i tried running the OCR.m file and it giving me this 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)
pls can anyone take me through how to rectify this error
Excellent work sir
does 'load templates' command works with 2014a? or not..?as in my case its giving error.
how to find accuracy of character?
Dear Sir, honestly thus far I am struggling with the template that has the .bmp files. I mean I am looking ways to have the templates downloaded or some means to create it! Any help or hint I'd be very grateful.
Cheers
Ataliba
hello sir, i trued to make use this code in my project where i need to recognize characters after taking images through a car. But this code doesn't show exact output when i use other images immediately taken from camera. it seems it can not recognize characters when the image contains other stuffs along with the characters. can u please help me in this case ?
Is there any algorithm that has been used in this code?
thanks
OCR in matlab use what or algorithms does it use neural network or dNN CNN please provide with an answer
for what font and letter size do this code run?
i am new to this....
can somebody please tell me how to download this file?
thx
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?
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?
Thank you very much, and Can I find any documents or papers about this method.
good
When can i get or generate letters for Cyrillic?
Really useful, but I think that the function "ocr.m" in Matlab is much simple and powerful.
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!
Good job. How can I modify the code for other languages?
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,
...
i am doing a project on extracting OCR from video,please guide me..
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
Excellent contribution , thank you very much . Now how I can create other templates for use with sensitive or other text font.
regards,
Mauricio
i am doing project on english handwritten recognition .please guide me ti this
thanks a lot
how to download this file
very god link
hi
Very simply perfect
Very simple but powerful idea.
Thx..
from where can i download this code. I am under character recognition. Please help me for getting the code
please from where i get source cod?
Please let me know, how can use this OCR with SVM. Thank a lot!
Good working
good
Anyone can help, How to run this code ?
Nice work.
sir it is not able to detect the text from video frame. please help
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
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
hav used this image and getting errors
http://i275.photobucket.com/albums/jj286/onedrunkirishman/RagTagBanner6.jpg
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..
nice code...
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.
Can anybody tell me that how to understand this code for character recognition?
or what is the way
please help.
Its Urgent!!
maximum rather
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.
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??
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!
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....
Quite good!
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?
Thx!
It helps me so much!
Really good job , you helped me out :) thnx
It is perfect code, really thanks
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?
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
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.
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
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
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,.
Dear sir,
how do we detect blank spaces between the characters?
and print them in the output
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.
Problem solved. The problem was the performance of my PC.
Thanks again for the program
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
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
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....
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.
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?
Hello Bogdan
I use IMCROP instead CLIP.
Kind regards.
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
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.
Sid H, come on!
If you can do better, we are waiting!
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.
thank you
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?
good job!
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
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
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.
hello sir please give me as a compltet report in ocr
cz
?????
these files really works..
result not being 100%..
fine
hi author
i am using matlab 6.5 version. Can i work your project my matlab?
can u tell me wat feature algorithm r u using??
Dear Sir, I'm doing handwritten english character recognition.Please guide me to progress this project. thanks lot.
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.
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!
Good application
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.
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.