本論文提出利用四元樹切割法的權重切換之三態中值濾波器(tri-state median filter, TSM)。四元樹的切割是以標準差做為判斷條件，利用四元樹的切割法區分出平滑區塊，再由統計直方圖的資料來區分出複雜區塊。在平滑區塊中TSM濾波器使用低權重而複雜區塊使用高權重。由實驗結果可知，在不同的雜訊比例下，平滑與複雜的影像對於脈衝雜訊的移除都有好的效果。 This paper presents the tri-state median (TSM) filter with weight switching based on quad-tree decomposition. Quad-tree decomposition condition is based on standard deviation. Then, the smooth regions are separated by quad-tree decomposition and the complex regions are determined by histogram statistics. Finally, the TSM filter uses lower weights in the smooth regions and higher weights in the complex regions. In the experiment results, smooth and complex images in different noise ratios will have the well effect for removing the impulse noise.