Skip to main content

Posts

Notes on Color #1: Misconceptions

In my childhood I learned about the three primary colors: red, yellow and blue. They are "primary" because any other color may be obtained by mixing these colors, on the other hand the primary colors cannot be obtained in this way. Years later I learned about RGB and HSL for UI and digital painting. At that point I thought I've got a solid understanding of the colors, until now. Having been learning color therories for a few weeks, I realized that how much I do not know about colors. This is the first study notes on color theory, which lists a few misconceptions that I have had for years. Color is a physical property of lights or objects. Right? Right and wrong. When we say "the apple is red", we actually mean "under the standard daylight illuminant, the spectrum reflected by the apple is perceived similarly as other objects that are commonly known as red". The light source and the spectral reflectance are apparently important, yet the observer is also...

Chasing a Wifi Ghost

For quite a while, I have not been so confused (and excited) by a technical issue. The problem is: I got very slow download speed (~10Mbps) on my Windows laptop, when connected to Wifi. To make it a bit more puzzling: - The upload speed is much better (~60Mbps). - Sometimes the download speed may reach ~100Mbps for a few seconds, before quickly fall back to ~10Mbps. Having been suffering from it for a few months, I finally decide to take on this issue today. Beginning of the Journey As usual, there are some troubleshooting routine I should do. Also as usual, they don't help much. - Try other devices with the same Wifi - Try to connect to other Wifi - Try to connect to Ethernet - Reset the Wifi router - Run Windows troubleshooter Well, eventually I did get some information. The download & upload speed is actually normal for all my other devices, which includes Android/iOS phones, MacBook Pro etc.  This pieced of info narrowd the root cause down to the laptop itself: The rou...

Determine Perspective Lines With Off-page Vanishing Point

In perspective drawing, a vanishing point represents a group of parallel lines, in other words, a direction. For any point on the paper, if we want a line towards the same direction (in the 3d space), we simply draw a line through it and the vanishing point. But sometimes the vanishing point is too far away, such that it is outside the paper/canvas. In this example, we have a point P and two perspective lines L1 and L2. The vanishing point VP is naturally the intersection of L1 and L2. The task is to draw a line through P and VP, without having VP on the paper. I am aware of a few traditional solutions: 1. Use extra pieces of paper such that we can extend L1 and L2 until we see VP. 2. Draw everything in a smaller scale, such that we can see both P and VP on the paper. Draw the line and scale everything back. 3. Draw a perspective grid using the Brewer Method. #1 and #2 might be quite practical. #3 may not guarantee a solution, unless we can measure distances/p...

ChromeVFX Prototype

TLDR: ChromeVFX uses Chrome as a MLT filter Demo In the demo, I'm editing a mlt file with WebVfx filter using Shotcut. Shotcut is connected with a Chrome instance via ChromeVFX. As shown in the video, every frame is direcly rendered in Chrome and reflected in Shotcut. I can also modify the web page directly in Chrome (zooming in/out). In this setup Shotcut is running in a Linux VM and Chrome is running in a Windows Host. So technically this is already a remote Chrome. Local or headless Chrome should also work in theory. Background I'm been using MLT and WebVfx for a while, they together allow me to render various stuff using web technologies. WebVfx internally uses QtWebKit to render HTML/JS. QtWebKit obviously uses Qt to enable communication between C++ and Javascript. It is quite easy to pass messages/events in between with the Qt language bindings. However QtWebKit is not the ideal choice. It has been officially removed from Qt 5.5, althougth we can s...

关于电影评分

电影不像游戏,书籍或者其他大多数商品,几乎没有退货这么一说。为了避免踩雷,预判电影好坏就显得非常重要。这里好坏并不是电影艺术水平,社会反响或者制作质量,而是针对单一观看者的喜好。例如,如果我不爱看动作片,那动作电影拍得再好我也不爱看。 不知道是不是因为制作门槛降低了,我感觉现在每年电影太多了,可惜保持不变的是好片的数量而不是比例。似乎游戏产业也有类似现象。 我对电影(包括电视剧)的态度是不看新片,等上映后过几个月或者几年如果还有人记得,还能在网络上提起“这不是XX电影的经典片段吗?”,我才会觉得这电影基本靠谱,再去网上继续调查。在电影上映前和上映时能够作为判断依据的资料不多,预告片大概能算一主要信息,然而我觉得预告片只能大致证明影片的类型,别的不能过多参考。我踩雷的一个例子就是看了一个10分钟左右的预告片,觉得不错去看了一个动作片,然而发现这个片子最精彩的动作部分都在预告片里了。你说预告片骗人了吗,没有。我上当了吗,那肯定上当了。 另外我经常看电影简介,虽然里面是吐槽的为主。很多电影被压成不到15分钟的小故事反而 挺有趣的。极少数的电影,我了解了剧情,了解了结局还去看的,而且看了还很喜欢,比如《カメラを止めるな!》。而大多数的电影通过了简介这么一层过滤也就没了兴趣。 评分则是另一个大致有效的过滤标准,比如国内比较有影响力的豆瓣。“豆瓣评分X.Y”大概是在豆瓣网之外最有效最简短的电影评价。对于评分我一直也觉得参考意义不大,依据是豆瓣的评分是来自于“愿意在豆瓣上评分的人”,而不是来自于所有人(例如在街上随机抽人调查)。“愿意在网站上评分”大致取决于性格以及影片观后感。而我从来都不属于这种人。 不过去年跟朋友讨论之后,我觉得可以做一个量化实验,判断各个电影评分对我能有多大参考意义。简单来说就是我看若干影片,自己打个分,然后跟各个电影评分算相关性。我自己打分分为4档:好看,一般,勉强以及难看,分值分别是2, 1, 0和-1。另外看电影之前我根据网上的信息预测电影的评分,作为比对。 下面是根据十七部电影的统计结果,九部国外八部国内。图表显示了各个评分系统对于我实际观感的Pearson相关系数,数值越高越相关: 可以看出相关性都不咋样,最高的是我自己的预测,豆瓣相比其他的系统要高不少。最有趣的是Metacritic的相关性几乎为0,甚至是负数。 ...