//求出初始最小灰度值和初始閾值for intLoop:=255 downto 0 doif intGrayLevel[intLoop]>0 thenbeginintRGrayLevel:=intLoop