订阅到抓虾 Add to netvibes 添加到Google Reader(阅读器) Hosted by exlast.com

Monthly Archive for 10月, 2008

图形文件格式 PPM 介绍

在做的一个项目中需要用到这种文件格式 .ppm 。网上相关的介绍并不多。摘录一篇备忘。

A PPM file consists of two parts, a header and the image data. The header consists of at least three parts normally delinineated by carriage returns and/or linefeeds but the PPM specification only requires white space. The first “line” is a magic PPM identifier, it can be “P3″ or “P6″ (not including the double quotes!). The next line consists of the width and height of the image as ascii numbers. The last part of the header gives the maximum value of the colour components for the pixels, this allows the format to describe more than single byte (0..255) colour values. In addition to the above required lines, a comment can be placed anywhere with a “#” character, the comment extends to the end of the line.

The following are all valid PPM headers.

Header example 1
P6 1024 788 255

Header example 2
P6
1024 788
# A comment
255

Header example 3
P3
1024 # the image width
788 # the image height
# A comment
1023

The format of the image data itself depends on the magic PPM identifier. If it is “P3″ then the image is given as ascii text, the numerical value of each pixel ranges from 0 to the maximum value given in the header. The lines should not be longer than 70 characters.

PPM example 4
P3
# example from the man page
4 4
15
0 0 0 0 0 0 0 0 0 15 0 15
0 0 0 0 15 7 0 0 0 0 0 0
0 0 0 0 0 0 0 15 7 0 0 0
15 0 15 0 0 0 0 0 0 0 0 0

If the PPM magic identifier is “P6″ then the image data is stored in byte format, one byte per colour component (r,g,b). Comments can only occur before the last field of the header and only one byte may appear after the last header field, normally a carriage return or line feed. “P6″ image files are obviously smaller than “P3″ and much faster to read. Note that “P6″ PPM files can only be used for single byte colours.

While not required by the format specification it is a standard convention to store the image in top to bottom, left to right order. Each pixel is stored as a byte, value 0 == black, value 255 == white. The components are stored in the “usual” order, red - green - blue.

图形文件格式列表

Tags: ,

俞敏洪在北大开学典礼上的演讲

可以说,北大是改变了我一生的地方,是提升了我自己的地方,使我从一个农村孩子最后走向了世界的地方。毫不夸张地说,没有北大,肯定就没有我的今天。北大给我留下了一连串美好的回忆,大概也留下了一连串的痛苦。正是在美好和痛苦中间,在挫折、挣扎和进步中间,最后找到了自我,开始为自己、为家庭、为社会能做一点事情。

学生生活是非常美好的,有很多美好的回忆。我还记得我们班有一个男生,每天都在女生的宿舍楼下拉小提琴,(笑声)希望能够引起女生的注意,结果后来被女生扔了水瓶子。我还记得我自己为了吸引女生的注意,每到寒假和暑假都帮着女生扛包。(笑声、掌声)后来我发现那个女生有男朋友,(笑声)我就问她为什么还要让我扛包,她说为了让男朋友休息一下(笑声、掌声)。我也记得刚进北大的时候我不会讲普通话,全班同学第一次开班会的时候互相介绍,我站起来自我介绍了一番,结果我们的班长站起来跟我说:“俞敏洪你能不能不讲日语?”(笑声)我后来用了整整一年时间,拿着收音机在北大的树林中模仿广播台的播音,但是到今天普通话还依然讲得不好。

人的进步可能是一辈子的事情。在北大是我们生活的一个开始,而不是结束。有很多事情特别让人感动。比如说,我们很有幸见过朱光潜教授。在他最后的日子里,是我们班的同学每天轮流推着轮椅在北大里陪他一起散步。(掌声)每当我推着轮椅的时候,我心中就充满了对朱光潜教授的崇拜,一种神圣感油然而生。所以,我在大学看书最多的领域是美学。因为他写了一本《西方美学史》,是我进大学以后读的第二本书。

为什么是第二本呢?因为第一本是这样来的,我进北大以后走进宿舍,我有个同学已经在宿舍。那个同学躺在床上看一本书,叫做《第三帝国的兴亡》。所以我就问了他一句话,我说:“在大学还要读这种书吗?”他把书从眼睛上拿开,看了我一眼,没理我,继续读他的书。这一眼一直留在我心中。我知道进了北大不仅仅是来学专业的,要读大量大量的书。你才能够有资格把自己叫做北大的学生。(掌声)所以我在北大读的第一本书就是《第三帝国的兴亡》,而且读了三遍。后来我就去找这个同学,我说:“咱们聊聊《第三帝国的兴亡》”,他说:“我已经忘了。”(笑声)

Continue reading ‘俞敏洪在北大开学典礼上的演讲’

Tags: , ,

尼康D80固件升级(V1.11)及更新内容

刚刚升级完D80的固件,A、B两个部分均从V1.01升级到V1.11。

了解了一下,新的固件主要有以下改变:

  • 解决了D80以及D200单反相机,在电量偏低时存在显示的BUG(图标时刻闪烁)的现象
  • 改进了白平衡。原来偏黄的问题得到了改善。
  • 色彩纯度有所提高。(非官方解释)
  • 图像细节有所提高。(非官方解释)

还有一个不靠谱的说法就是,高ISO拍摄下图片的质量得到了很大的提高。

看各方面反馈,新版本还是值得升级了。今天晚了,有时间再拍PP研究研究。

至于如何升级,网上很多介绍。可以看官方的文章(英文版),也可以看看一些论坛里的文章,例如这个

我觉得升级非常简单,就是下载固件(直接下载地址 1.12M),解压出2个文件(AD800111.bin、BD800111.bin),先把A文件放在存储卡的根目录下,在相机“设定菜单”中的“固件版本”中选择升级。待提示升级完成后,再放入B文件到存储卡根目录下重复前一步的操作。(A、B不要同时放到存储卡里哈,应该分别放入)

整个过程2-3分钟就ok了。

Tags: ,

现实照进梦想

午休,做了个梦。诡异。

梦中的场景就是我现在办公室的场景。大家都在各忙各的,时不时聊几句。

办公室里响起经典的索爱手机铃声… (大家用的都是索爱的机器M608或P1)

我想,原来是Boss回来咯。可是Boss走进房间又出去了,对铃声木有任何反应。我又想,哎,是mosi同学的手机响咯,可这时mosi同学从卫生间走到饮水机出倒水,对响了一遍又一遍的铃声也木有任何反应。我就奇怪了!哪来的铃声,莫非是我的。

没错!是我的手机在响。。抬手摸手机,关掉.。咔嚓,梦醒了,原来是现实中我手机定的闹钟在响。

哎,之前也做过类似的梦。

梦中,听见mm在身后叫我,一扭头,梦醒了,原来是mm在现实中叫我。

这就是所谓的,现实照进梦想? :roll:

Tags: