Just My Life & My Work

Archive for the ‘課業’ Category

[LibSVM] Support Vector Machine (SVM) 實驗

多媒體設計系統作業三是要我們實驗SVM
老師給我們training.txttesting.txt兩個檔案,
分別用來trainingpredicting

(繼續閱讀…)

[C++] 光線追蹤 (Ray Tracing)

關於【Ray Tracing】是一門很值得研究的學問,
在實做過程我遇到幾個瓶頸:
遞迴、折射、反射、鏡射光、散射光等,
尤其是【遞迴】如果沒有清楚的腦袋,
很難將後四者給兜起來。
首先我們來看一條「主光線」如何遞迴:

(繼續閱讀…)

[C++] 鏡射光 (Specular)

從上學期就看到此Phong Reflection Model的公式,
但也只知道表面而無法完全理解其內涵,
短短的一行等式中隱含著一個光的世界,
這時候我就把焦點放在【鏡射光(Specular)】上頭。

(繼續閱讀…)

線與球、平面的交點

RaySpherePlane的交點,
我參考WIKI的Line-sphere intersectionLine-plane intersection
這【交點】相當重要,
因為是反射與折射時重要的參考點。

(繼續閱讀…)

[C++] 反射與折射

這次作業最大的難度就在於【反射】與【折射】的【遞迴】實做,
若沒有搞清楚折射和反射的公式,
必然無法做到想要的效果!
以下是我看了「Reflections and Refractions in Raytracing」論文所得到的結論:

(繼續閱讀…)

[MatLab] Mahalanobis Distance implement with 2D class using MATLAB

3D的時候不好看出結果,
這次使用2D sample點和test點來實做。

(繼續閱讀…)

[MatLab] Mahalanobis Distance implement with 3D class using MATLAB

這次直接使用原始資料來實做,
一共有3個class,
每個class有10個sample,
而sample為3維(x1,x2,x3),
test point有4個。

(繼續閱讀…)

[MatLab] 馬氏距離的理論與實做 (Mahalanobis Distance)

總算知道【馬氏距離】的意義,
加上實際操作MATLAB來驗證理論,
真正瞭然於心。
話說MATLAB真是一個強大的工具呢!

Mahalanobis distance

From WiKi (http://en.wikipedia.org/wiki/Mahalanobis_distance)

In statistics, Mahalanobis distance is a distance measure introduced by P. C. Mahalanobis in 1936. It is based on correlations between variables by which different patterns can be identified and analyzed. It is a useful way of determining similarity of an unknown sample set to a known one. It differs from Euclidean distance in that it takes into account the correlations of the data set and is scale-invariant. In other words, it is a multivariate effect size.

Definition

Formally, the Mahalanobis distance of a multivariate vector from a group of values with mean and covariance matrix S is defined as:

(繼續閱讀…)

透視投影的結果

有關透視投影的概念,簡單來說就是同樣的物體,放在離眼睛較近的地方,物體成像看起來比較大,若放在離眼睛較遠的地方,物體成像看起來就比較小。在畫家手中的透視投影還有分一點、兩點、三點透視,這部份可參考:透視投影 (Perspective Projection)

(繼續閱讀…)

讀取標準檔參數

聽學長說一般商業軟體會如此讀檔,

往後就都按此標準來撰寫【要被讀取的檔案】,

想一想挺有道理低!

一般使用者不會去看程式碼,

若想更改某些變數來符合自己的喜好,

直接更改.txt檔裡的參數非常容易且友善!

當然若依照以往程式設計師所寫的常數,

不用多久,過了一個禮拜之後,

程式的作者也會忘了該值代表何意,

因此現在習慣撰寫在【常數】前加上【辨識單字】。 (繼續閱讀…)

標籤雲