摘要: 在数学上,Look-and-say sequence为一整数序列,举例如下: 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ...序列的生成过程如下(后一个数为前一个数的数字个数+数字本身的序列): 1 读为 1个1,所以后一个数记为 11 11 读为 2个1,所以后一个数记为 21 21 读为 1个2,1个1,所以后一个数记为 1211 1211 读为 1个1,1个2,2个1,所以后一个数记为 111221 111221 读为 3个1,2个2,1个1,所以后一个数记为 312211 ...假设 d为 0-9的数字,... 阅读全文
posted @ 2012-04-04 23:22 Goodpy 阅读(2266) 评论(0) 推荐(0) 编辑
摘要: PIL 提供了丰富的功能模块:Image,ImageDraw,ImageEnhance,ImageFile 等等。最常用到的模块是 Image, ImageDraw,ImageEnhance 这三个模块。1、Image模块 最基本的模块,每个Image对象对应了一幅图像,基本的功能如下: 1 from PIL import Image2 img = Image.open('pic.jpg')#打开一幅图像3 new_img = img.resize((128.128),Image.BILINEAR)#调整图像大小4 new_img.save('pic_r.jp' 阅读全文
posted @ 2012-04-04 01:23 Goodpy 阅读(4653) 评论(0) 推荐(0) 编辑