I am not familiar with python for the first time. Some of them are easy to remember.
1. Install Python and Pil
My centos6 does not know when python is installed.
[Root @ foxni/home/lelefox/simple verification code/image/font] # Python
Python 2.6.6 (r266: 84292, Dec 7 2011, 20:48:22)
[GCC 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "Copyright", "Credits" or "License" for more information.
>>>
2. Install PIL
Reference: http://bluecrystal.iteye.com/blog/146490
At the beginning, I only executed $ Python setup. PY, the result is in the image. open (""). convert ("1") (note that the Number 1 is converted to a bilevel image)
, Refer to: Pil document. Readme should take a closer look. If you want to process PNG images, you need to install http://www.zlib.net/, processing JPG images to install other. (These are available in readme and can be found using $ Python selftest. py .)
$ Python setup. py build_ext-I
$ Python selftest. py
$ Python setup. py install
3. By default, image. Open ("). Show () does not respond if XV is not installed.
Install: XV download http://www.trilon.com/xv/downloads.html
When installing the source code out of a small problem, refer to: ftp://ftp.trilon.com/pub/xv/xv-redhat6-readme.txt. Remove the error in the header file. Add comments
/* # Ifndef _ NetBSD _ extern char * sys_errlist []; this too... # endif */
In addition, you need to change the MAKEFILE file to a local location.
Mchn =-dlinux-L/usr/x11r6/lib
I just removed the comment above this sentence, which is also very useful. The LIB path of X11 is not found.
Refer:
1. http://xiaoxia.org/2011/05/31/boring-entry-the-fabled-verification-code-recognition-technology-learning-notes/