>> Image=imread('eg1.jpg');
>> Image=imresize(Image,0.3);
>> Image_R=Image(:,:,1);
>> Image_R0=((Image_R>100)&(Image_R<150));
>> figure(1);
>> imshow(Image_R0);
>> figure(2);
>> imshow(~Image_R0);
>> Image=imresize(Image,0.3);
>> Image_R=Image(:,:,1);
>> Image_R0=((Image_R>100)&(Image_R<150));
>> figure(1);
>> imshow(Image_R0);
>> figure(2);
>> imshow(~Image_R0);
>> Image_R1=~Image_R0;
>> Image_G=fspecial('gaussian',3,0.8) %sigma=0.8的3x3模板
>> Image_Rf=imfilter(Image_R0,Image_G); %高斯平滑
>> figure(3);
>> imshow(Image_Rf);