Hi Chengxin
If you have a gray scale image with these 3 pixels: 10, 2, 254.
The Median is the value that you get if you order all your gray values
sequentially: 2, 10, 254 and take the middle one. Here it is 10.
(Max+Min)/2 = (254 + 2)/2 = 128
The idea of Adaptive Thresholding is that you do the thresholding
operation in each square of a grid instead of globally.
I think that Mask is the size of a local square in the grid.
-Sami Badawi
http://www.shapelogic.org