Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Sign in to follow this  
devilzrr

Ocr - Optical character recognition

Recommended Posts

devilzrr

Boas, venho por este meio questionarme acerca de como funciona ocr.

Ja percebi mais ou menos como funciona ocr, agora a minha questao é como e' q o programa reconhece o caracter pois este, pode ter diferentes formas e tipos de letra.

Ja googlei bastante e encontrei algumas coisas mas continuo sem perceber.

Determining character lines

Enumeration of character lines in a character image (‘page’) is essential in delimiting the bounds within which the detection can proceed. Thus detecting the next character in an image does not necessarily involve scanning the whole image all over again.

Algorithm:

   1. start at the first x and first y pixel of the image pixel(0,0), Set number of lines to 0

   2. scan up to the width of the image on the same y-component of the image

         1. if a black pixel is detected register y as top of the first line

         2. if not continue to the next pixel

         3. if no black pixel found up to the width increment y and reset x to scan the next horizontal line

   3. start at the top of the line found and first x-component pixel(0,line_top)

   4. scan up to the width of the image on the same y-component of the image

         1. if no black pixel is detected register y-1 as bottom of the first line. Increment number of lines

         2. if a black pixel is detected increment y and reset x to scan the next horizontal line

   5. start below the bottom of the last line found and repeat steps 1-4 to detect subsequent lines

   6. If bottom of image (image height) is reached stop.

ii. Detecting Individual symbols

Detection of individual symbols involves scanning character lines for orthogonally separable images composed of black pixels.

Algorithm:

   1. start at the first character line top and first x-component

   2. scan up to image width on the same y-component

         1. if black pixel is detected register y as top of the first line

         2. if not continue to the next pixel

   3. start at the top of the character found and first x-component, pixel(0,character_top)

   4. scan up to the line bottom on the same x-component

         1. if black pixel found register x as the left of the symbol

         2. if not continue to the next pixel

         3. if no black pixels are found increment x and reset y to scan the next vertical line

   5. start at the left of the symbol found and top of the current line, pixel(character_left, line_top)

   6. scan up to the width of the image on the same x-component

         1. if no black characters are found register x-1 as right of the symbol

         2. if a black pixel is found increment x and reset y to scan the next vertical line

   7. start at the bottom of the current line and left of the symbol, pixel(character_left,line_bottom)

   8. scan up to the right of the character on the same y-component

         1. if a black pixel is found register y as the bottom of the character

         2. if no black pixels are found decrement y and reset x to scan the next vertical line

Obrigado

Share this post


Link to post
Share on other sites
djthyrax

Todos as letras são quase sempre escritas da mesma forma, embora possam ter tamanho diferentes e curvas mais ou menos acentuadas. Usando heuristicas, consegue-se ver qual é o caracter. Claro está, por vezes há caracteres que não são reconhecidos.


Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum!

Share this post


Link to post
Share on other sites
debliu

Na FNAC há umas canetas que têm um scanner na ponta, passa-se por cima de um texto escrito num papel (pode ser escrito à mão) e depois esse texto passa para o computador e dá pa editar... imagino que use esse tipo de tecnologia...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.