現代科技高速發展,人們對於電子產品需求上升,而電子產品中包含了許多光學元件,因此光學檢測是非常重要的。Shack-Hartmann wavefront sensor在檢測上是一個非常有用的工具,其表現並不遜於傳統的相位干涉儀(phase-shifting interferometer)。而其量測結果好壞將由點定位(centroiding)的演算法的準確度(accuracy)所決定。 本論文將運用四種不同的演算法來模擬,探討演算法對於CCD輸出雜訊及背景值的影響情況,並對於雜訊(random noise)將利用定點拍攝多張圖的方式,對其光強度取平均值以達到降低雜訊的效果,在考量準確度以及計算花費時間長短找出最佳的拍攝張數,並比較各演算法之優劣。後續將真實量測結果帶入演算法中。然而,要計算真實誤差必須知道光點確切位置,而光點真實位置無法得知,因此本論文將利用入射角度以及偏移量的關係設計了一組實驗,並利用最小平方法擬合來得到實際誤差值,比較各演算法在實際量測時之表現。在最後運用演算法中的非線性最小平方法的擬合實際光點,利用擬合結果與實際光點之差值,定義一個判斷光點好壞的參數,以便量測時可以判斷光點之品質。 ;With the development of science and technology, people is increasing in demand for electronic products, which includes a lot of optical components, and thus the optic testing is very important. Shack-Hartmann wavefront sensor is a very powerful tool in optical testing, and its performance is comparable to the traditional phase-shifting interferometer. The accuracy of measurements depends on algorithm of centroiding. Thesis paper will use four different algorithms to simulate. Investigating the effect of CCD readout noise and background values for all algorithms. To reduce noise influence, we take different frame number of spot intensity, and using each result of average those pictures’ intensity to calculate center of gravity, finally compare the strengths and weakness of all algorithms. And then taking the real measurement results into the algorithms. In order to calculate the actual error, we need to know the true position of center, but it’s very hard to know that. In this paper,we designs the experiment by using the relationship between angle of incidence and shift,and use the least squares fitting to calculate the actual error. The final, using the difference of the result of non-linear least squares method and actual spot to definite a parameter for judging quality of spot.