白底换红底 局部阈值调整 边界高斯滤波 function demo global R global threshold global img global dstColor global rect global mask global biasStep biasStep = 5; dstColor = [255 0 0]; %% background color img = imread('g.jpg'); %% load photo R = img(:,:,1); [mm, nn] = siz