OCRusingOpenGL
| OCR using OpenGL Release status: experimental [box doku] | |
|---|---|
| | |
| Description | Captcha-erkennung mit Hilfe von OpenGL |
| Author(s) | siro |
| Last Version | 0.1 (27.06.11) |
| Platform | WIN32, Linux |
| License | |
| Download | nyet |
This page is about OCR using modern graphic cards and OpenGL to keep this project cross-platform usable.
Inhaltsverzeichnis |
[Bearbeiten] Idea
Solve CAPTCHAs by brute force every section of the image with each character in an alphabet.
What should be possible:
- load any kind of graphic format (PNG, JPG, BMP, GIF, ...)
- laod any size of graphics
- load one or more ttf fonts to use on the captcha
- use OpenGL and modern graphic hardware to accelerate this process
- output bench statistics
[Bearbeiten] requirements
You need:
- a c++ compiler
- FREEGLUT libs
- freetype2 libs
- OpenGL 1.4 compatible graphic card that support FBO
- libpthread
[Bearbeiten] Version 1
Used libs:
Description:
This software checks if the renderd letter matches with the part of the image below. The letter is moved all over the image and after each turn it it's rotated a slight degree or its size is being changed. Due to the many iterations this process might be (very) slow. I'm trying to keep the process simple to speed things up.
The code:
* load captcha image * load ttf font FOR EACH CHARACTER -FOR EACH POSITION --FOR EACH PITCH/ROLL * copy captcha image to FBO destination surface * draw a letter (x,y, pitch, roll) by XOR with the background * copy it into an array * count matching and non matching pixels * save result somewhere --NEXT -NEXT NEXT
I found out, that GLUTs statemachine is way to slow (60 renderingcalls per second using MESA drivers, 170 using binaries). I'm using pthread, to split the rendering and offscreen-rendering.
* evaluate the results
Speed: 400.000 checks per second ?? -> TODO
[Bearbeiten] TODO
- move to FreeGlut
- implement multithreading