Python

共 17 篇文章

Intro to Python Image Processing in Computational Photography

Intro to Python Image Processing in Computational Photography

Computational photography is about enhancing the photographic process with computation. While we normally tend to think that this applies only to post-processing the end result (similar to photo editing), the possibilities are much richer since computation can be enabled at every step of the photographic process—starting with the scene illumination, continuing with the lens, and eventually even at the display of the captured image. This is important because it allows for doing much more and in different ways than what can be achieved with a normal camera. It is also important because the most prevalent type of camera nowadays—the mobile camera—is not particularly powerful compared to its larger sibling (the DSLR), yet it manages to do a good job by harnessing the computing power it has available on the device. We’ll take a look at two examples where computation can enhance photography—more precisely, we’ll see how simply taking more shots and using a bit of Python to combine them can create nice results in two situations where mobile camera hardware doesn’t really shine—low light and high dynamic range.

python版成绩查询又前进一步

python版成绩查询又前进一步

学了点python后,看到各种爬虫教程,原本想做个统计平均学分绩的小爬虫。当真正动手时,发现了各种难题,由于网上多数都是没有验证码的模拟登录,而方正教务系统却是存在验证码的,于是出现了之前关于“ubuntu 14.04 下安装 PyTesser 进行OCR识别”漫长安装。原本以为可以简简单单的完成验证,但意外总是会有的,它竟然仅支持最简单的那种没有任何变形的验证码,再次深入百度发现关于验证码的问题是个长期而浩瀚的任务,就自己目前这点含量。。。 最终无奈地对这条路宣布了死刑,然而幸运总是于不经意间到来,偶然的一次搜索,找到了不需要验证码的登录界面,在之后的实验中我竟然找到了第二个不需要验证码的界面。 终于可以按照教程改自己的了,但这次不出现登陆界面改出现系统繁忙的提示。那么问题来了,这是为什么呢/。后来仔细对照,发现 [callout class=“info” title=""] 提交post请求后获取登录后的页面即可[/callout],而我依旧在请求打开登陆界面= =。 由于网络基础比较薄弱,抓包什么的也都是现学现用,之后就按照登录的写法去请求成绩页面,去总是在成绩的默认页面,获取不到其他的成绩方式,在实验了“一七得七,二七四十八,三八妇女节,五一劳动节,六一儿童节”反正好多次,另开了n次.py文件后,终于误打误撞的成功了。回首之前写的那些‘无用’代码,感觉主要问题应该是存在在头文件(Headers)或(PostData)上。 [callout class=“info” title=""] 最大的可能是Cookies值没有一直统一,或__VIEWSTATE取值错误,或两者都有问题。 [/callout] 能力有限,目前能想到的原因也就这些。至于代码及各种参考资料,会在真正完成第一版后公布出来。 至于现在。。就到这里吧。最后附上初步成功查询的结果图,至于成绩,就不在这现眼啦O(∩_∩)O~

ubuntu 14.04 下安装 PyTesser 进行OCR识别

ubuntu 14.04 下安装 PyTesser 进行OCR识别

玩python期间,看到好多用python做的爬虫,感觉挺好玩,就开始了爬虫之旅的学习,期间受一些教程的启发想去试试学校的教务系统,可惜登录需要验证码,于是四处寻找解决方法,最终找到这个大致能看懂的。 网上重复的不少,很多都是直接ctrl+c/v出来的,文章排版一类的难免让人不忍直视,加之安装过程有点繁琐,暂且整理记录于此,供自己这样的小白以用之。