Fork me on github

IUSEP研修报告

Introduction

记录记录IUSEP 2019的经历,总结总结。

Alberta - Edmonton

Alberta(阿尔伯塔)是加拿大的一个省,Edmonton(埃德蒙顿)是Alberta的省会。

Edmonton只有130万的人口,这在中国是一个五六线小城的配置了。走在哪里都有一种空旷的感觉。North Saskatchewan River(北萨斯卡切温河)穿城而过,将Edmonton分成西北和东南两个部分。纬度比长春还高的Edmonton,在夏天只能说是很凉爽。夏天在这里短暂拜访的我们,倒是觉得很惬意。

University of Alberta

University of Alberta(阿尔伯塔大学),简称UA,是坐落于Edmonton的一所世界著名大学。

加拿大的大学相较于中国显得更加开放。公交车站,地铁站散布于校园,围栏更是找不到的。UA的绿化和城市绿化一样好,校园很美。


校园风光

我很有感触的一点,就是国外大学是完全为了学术科研服务的,更准确来说,是为了学生服务。很多教学楼之间都有通道连接,以方便师生通行。很多教学楼都有一块休息区,休息区有各种快餐店,包括汉堡店,你随时都可以买到食物,而不是像国内食堂定点开饭。如果不想买午饭,休息区都有微波炉,你可以早餐做个sandwich,中午热一下就可以吃。休息区还有许多沙发桌子,打个盹,或者就在那学习都没有问题。

IUSEP

IUSEP全称是International Undergraduate Summer Enrichment Program in Mathematics,是UA组织的数学方面的暑期增益项目。从7月6日到达到8月10日离开,大约一个月的时间。项目主页上有这个项目的三点内容:Lectures and Tutorials,Problem-solving Group Projects,Social Activities,自由时间还是很充足。这个项目全程由阿尔伯塔大学的李毅(Michael Li)教授组织,用李老师的话说,这个项目就是带我们玩儿。当然,学习上也是有很多收获的。


TAQ CS 合影

Schoolwork and Project

前三周基本上都是上午下午各一节两小时的讲座,关于不同课题。周末去公园游玩,野炊。后两周就都是组队选定一个课题,做一个小专题研究。我们做的是wavelets on image beautification。简单介绍一下我的部分吧,关于如何用小波美颜。(过于懒惰直接copy谷歌翻译的讲稿了)

Principle of Face Image Beautification

How to Adjust Skin Tone

In most aesthetics, white-light skin is considered good-looking. So we are committed to how to whiten and brighten the skin area of the picture.

First we need to detect the skin area of the picture. For color images, we can use simple threshold skin color recognition based on RGB color space. Here is the corresponding formula:

\[R > 95\ And\ G > 40\ And\ B > 20\ And\ R > G\ And\ R > B \]

\[And\ Max(R, G, B) - Min(R, G, B) > 15\ And\ Abs(R - G) > 15 \]

When the value of three channels of a pixel RGB satisfies such a condition, we consider it to be part of the skin.

After identifying the skin area according to the formula, we can adjust the RGB value of the area to make the skin whiter and brighter. Simply put, we only need to increase the value of RGB to a larger point. Then the image will be brighter and whiter. By the way, if you like bronzed skin, you can make the skin's RGB closer to it.

How to Smooth the Skin

Maybe you are worried about the acne on the photo. So we consider how to make the skin smoother. If you think of acne as noise, smoothing your skin is a process of denoising image. We want to use wavelet to achieve this denoising function.

The Process to Denoise the Image

After wavelet transform, the image is decomposed into low frequency coefficents and high frequency coefficents. The low frequency coefficients represent the image approximation signal and the high frequency coefficients represent the image detail signals. Among them, most of the noise and some edge details in the image belong to the high frequency sub-band. We perform bilateral filtering on the low frequency coefficients to make the skin smoother, and threshold denoising on the high frequency portion to reduce the effect of noise on the image. Finally we reconstruct the denoised image by wavelet reconstruction.

Filters

Other Filters

Mean Filtering

One of the most representative filters is the mean filtering. This is the formula for mean filtering.

\[A'(i,j)=\frac{1}{(2L+1)^2}\sum_{k=-L}^{L}\sum_{l=-L}^{L}A(i+k,j+l) \]

It uses the average gray level of the pixel neighborhood to replace the pixel value, which is suitable for impulse noise. However, the mean filtering itself has the inherent drawback that it does not protect the image details well, and the image denoising also destroys the details of the image, which makes the image blurred and does not remove the noise points well.

Median Filtering

Another common filter is the median filter. It first determines a filter window and position (usually it contains an odd number of pixels), then sorts the pixel values in the window by grayscale, and finally takes the median to replace the pixel value in the center of the original window. However, when the number of noise pixels is greater than half of the total number of window pixels, since the intermediate value of the gray scale order is still the gray value of the noise pixel, the filtering effect is poor. At this time, if the window size is increased, the probability that the original edge pixel is replaced by other area pixels is increased, the image is more likely to be blurred, and the amount of calculation is greatly increased.

Bilateral Filtering

Disadvantage of Other Filters

In addition to their own shortcomings, the above filters have a drawback in terms of portrait processing: the edges of the image cannot be maintained. The reason is that the previous filters only took the numerical factors into account and did not take the spatial factors into account.

Bilateral Filtering

So this is the formula for bilateral filtering.

\[g(i,j)=\frac{\sum_{k,l}f(k,l)w(i,j,k,l)}{\sum_{k,l}w(i,j,k,l)} \]

\[w(i,j,k,l)=exp(-\frac{(i-k)^2+(j-l)^2}{2\theta_d^2}-\frac{||f(i,j)-f(k,l)||^2}{2\theta_r^2}) \]

Look at w, this is the weight coefficient of each pixel. The exponential part of this coefficient is composed of two functions. One function is to determine the filter coefficients from the geometric spatial distance. The other determines the filter coefficients from the pixel value difference. So it considers both spatial domain and value domain information, and can achieve the effect of edge preservation and denoising. Also it is simple and non-iterative. In this way we can smooth the picture.

Threshold Denoising

Threshold Determination

Then we come to the threshold denoising of the high coefficents. When the threshold is chosen to be large, the resulting image may be smoother but more blurred; when the threshold is smaller, the final image may be sharper but not smooth enough. During the test, we found that the picture high frequency signal value is between 30 and 70. Finally we choose 50 as the threshold.

Adaptive Threshold Function

After determining the threshold, we need a suitable threshold function to process the high frequency signal. This is an expression of the adaptive threshold function.

\[\widehat{w}_{j,k}=\begin{cases} [sgn(w_{j,k})](|w_{j,k}|-(\alpha-\frac{\alpha(1-\alpha)}{exp(w_{j,k})})\lambda),\quad |w_{j,k}|>\lambda \\ 0,\quad |w_{j,k}|<\lambda \end{cases}\]

You will find that when alpha approaches 0, it is equivalent to a hard threshold function, so that the image will be sharper but with some mutations; when alpha approaches 1, it is equivalent to a soft threshold function, and the image will be smoother but more blurred. In the end we take the alpha to 0.5.

Effect

So here is the result of our experiment. As expected, the image is whiter and brighter and the skin is smoother.


美颜效果

For Fun

作为一个只会Hello World连求导都不会的CS渣渣,来到这样一个数学项目,在生活娱乐上的收获自然是远超学业了(x

Diet

Fast Food

住的地方有个小厨房。很多同学这一个月对做饭乐此不疲,厨艺精进不少。作为肥宅只能有一顿没一顿地吃汉堡了。


肥宅的快乐生活

这里KFC或者金拱门并没有那么火,倒是有许多本土的汉堡店。我们公寓附近就有许多汉堡连锁店,Harvey's,Denny's,Wendy's...其中Tim Hortons在加拿大最为流行。Tim Hortons最出名的可能不是汉堡,而是它的咖啡。在这点上,它在加拿大可能比星巴克还流行。

不过我在这吃的最习惯的还是KFC了,因为本土品牌的汉堡一般都会加又酸又辣的黄瓜以及超多的cheese。

Steak

百度百科上说Alberta是加拿大草原三省之一,我想因之Alberta五星级牛肉才世界闻名吧。只是这边牛排的做法都是medium rare(三分熟)起步,medium(五分熟)都是不被推荐的,甚至流行的是rare(一分熟),带血牛排着实劝退。


阿尔伯塔牛排,横切面除了白色的一圈都是生的

Elk Island National Park

第一周的周五集体去麋鹿岛国家公园游玩了一天。国外的公园很大,信号很不好,在里面走丢可能没有那么有趣。

很多免费的BBQ场所。很多家庭选择一起来野炊度过美好的下午时光。风景很美,有大大的湖,可以看到许多水鸟包括海鸥在天际飞翔。

Edmonton Heritage Festival

这是Edmonton一个为期三天的节日活动,旨在发扬Alberta的文化和遗产多样性。这个活动每年在八月于William Hawrelak Park举办。在公园的草地上有近100个代表不同国家和文化的帐篷。帐篷里有美食和展品,帐篷外有具有文化特色的歌舞表演。

今年Festival的主题是Adventures await!

在草坪上行走稍微费劲些,但是脚底软软的很舒服。走时间久了再走到硬地面会觉得十分轻松。

作为一个观光客,看到的加拿大的生活永远是这样的悠闲自在。这样的景色不知该怎样描述才好。天空很美,湖水很清,植被茂密,游人乐在其中。


公园景色

各式各样的民族文化展览。危地马拉的民谣(?)乐队,俄罗斯的姑娘小伙载歌载舞,中国馆的舞狮表演,等等。


危地马拉乐队

意大利的地图真的是在踢足球

中国馆

不得不提一句,俄罗斯小姐姐是真的好看。外国的小萝莉不仅好看还可爱~

台湾馆叉烧包和bubble tea好评!emmm最后严肃地建议台湾馆香港馆和大陆馆并馆。

Shopping

不会购物的直男摘抄一下购物攻略。

加拿大购物是要交税的,但税每个省的要求不同,通常是联邦税5%+地方税。如安大略省地方税是8%。加元汇率是5.2-5.3之间。而阿尔伯塔省是没有地方税的,所以只有5%的联邦税。

West Edmonton Mall

这在北美也算是很大的一个购物中心了,集购物、娱乐为一体。牌子很多很全,但是活动不多,力度不大。游客去得多,公交也方便。


西贸的Vans店

西贸的酒店。冰酒是加拿大的一种特产。它以经冬在藤上被霜冰冻的葡萄作为酿酒原料,因此得名。

西贸不仅是个购物中心,同时也是个娱乐中心。有个很大的游泳馆,还有室内过山车。有一次去的时候,里面的冰球场被改成了掰手腕比赛的场地,有大人也有小孩在台上比试臂力。


室内过山车

South Gate

比起前面两个商场,南门就没有那么大了。但是它也是Edmonton比较有名的商场,折扣活动很多,美妆产品也很多,Mac好像挺便宜的。


乐高

South Edmonton Common

在城市的很南边,这里打折力度特别的大,都是工厂店,但是不是奥特莱斯。当地人去都是开车在里面逛的,因为太大了步行浪费时间。这里的工厂店没有奢侈品和轻奢品牌,都是比较亲民的。CK、Tommy比国内便宜很多。

End

写了许多,总还有许多回忆被遗落,也许偶尔还能想起吧。

这一个月,我依然觉得自己更多的是作为一个观光客的角色,在Edmonton美丽的天空下短暂停留。Edmonton大约还有很多不一样的景色吧。但这段经历,想来也是很宝贵的。

感谢唐班提供这次机会。

感谢李毅老师尽心尽力的组织。

感谢同行的同学,互相的温暖让异乡人不那么孤单。

以上。

posted @ 2019-08-09 17:19  acboyty  阅读(367)  评论(1编辑  收藏  举报