数字图像处理二值化程序%KITTLERMETbinarizesagrayscaleimage'imag'intoabinaryimage%Input:%imag:thegrayscaleimage,withblackforeground(0),andwhite%background(255).%Output:%imagBW:thebinaryimageofthegrayscaleimage'imag',withkittler's%minimumerrorthresholdingalgorithm.