Qian's Blog

March 14, 2010

Face Tracking & 3D

Filed under: 未分类 — Tags: , , — Qian He @ 12:46 am

最近几天一直在琢磨毕设换题的事情,即要和以后读究所在实验室的研究方向match,又要我感兴趣。

记得之前看过一则关于Apple专利的报道,对其中的想法比较感兴趣,而且觉得也比较容易上手,于是今天花了点时间写了一百多行代码,用OpenCV和OpenGL简单的实现了一下其中的想法。由于用的是OpenCV自带的haarcascade,识别的效果并不是特别好,在我录制的这段视频中可以看到有几次false positive和negetive,反正就是那么个意思吧,玩玩儿嘛~

(用MacBook内置的摄像头检测人脸位置,显示的3D内容随用户与显示器的相对位置而变化)

计划毕设做个比这更好玩儿的东东,现在正在酝酿中⋯⋯

BTW:大牛Johnny Chung Lee的牛B程序:Head Tracking for Desktop VR Displays using the Wii Remote

March 11, 2010

3 geeklets for Geektool

Filed under: 未分类 — Tags: , — Qian He @ 5:56 pm

监控系统状态:

top -l1 -ocpu | grep ‘: ‘

监控亚洲地区卫星云图:(此图片每小时更新一次)

http://sirocco.accuweather.com/sat_mosaic_640x480_public/IR/isasia.jpg

监控Twitter上的replies:(username和password是你在twitter上的账号密码,api_url可以是twitter.com,也可以是API proxy的地址)

python -c “import json, urllib;
for tweet in json.load(urllib.urlopen(‘http://username:password@api_url/statuses/replies.json?count=3′)): print(‘{0}: {1}’.format(tweet['user']['screen_name'], tweet['text'].encode(‘utf8′)))”

发张我桌面的接图吧:

My Desktop

March 5, 2010

Using OpenCV on Mac OS X

Filed under: 未分类 — Tags: , , — Qian He @ 5:18 pm

昨天checkout了OpenCV最新的代码,发现make_framework.sh这个用于在Mac OS平台上编译OpenCV的脚本已经被移除了,具体开始移除的版本是r2528,而最后一个能成功使用该脚本编译的版本是r2492。阅读了一下OpenCV的wiki,发现这个条目在2010-02-28更新过。说明了make_framework.sh这个脚本已经被从trunk中移除的原因,理由是以后要全面使用CMake来做cross-platform build。

但是有意思的是,作者在讲解如何使用CMake在Mac OS上build的章节题目叫做:

2. Building from source using the new CMake build system (currently unstable and difficult)

The GNU autotools methods (make && make install) are being outdated. Volunteers to edit this section?

灰常不理解OpenCV的开发团队为什么要在B方案都还不稳定的情况下裁撤A方案。

于是,我在Mac OS X 10.6.2 + Xcode 3.2.1的环境下编译了OpenCV r2492这个版本,并且打包了一个放在:Dropbox,嫌麻烦的朋友可以直接下载这个Universal的Private Framework。另外,还有一个别人编译了的OpenCV 2.0 Gold Release的版本。这个版本有一个问题,在挂在.dmg文件后,它给出的目的文件目录是“/System/Library/Frameworks”。而根据Apple的说明

Third-party frameworks should never be installed in the /System/Library/Frameworks directory. Access to this directory is restricted and is reserved for Apple-provided frameworks only.

Most public frameworks should be installed at the local level in /Library/Frameworks.

If your framework should only be used by a single user, you can install it in the ~/Library/Frameworks subdirectory of the current user; however, this option should be avoided if possible.

If they are to be used across a local area network, they can be installed in /Network/Library/Frameworks; however, this option should be avoided if possible.

该目录应该是“Apple-provided frameworks only”的。实践也证明,将OpenCV.framework放在“/System/Library/Frameworks”目录下,项目可以add这个framework,但是无法正确找到头文件。正确的放置目录应该是“/Library/Frameworks”。

用OpenCV提供的sample: FaceTracker测试一下吧~(记得检查一下framework和haarcascade在项目里面配置的文件位置)

Powered by WordPress