for row = 1 : SIZE :Image_size(1)-SIZE for col = 1 : SIZE :Image_size(2)-SIZE rgb_mean = zeros(3); for k = 1:3 temp = original_Img(row:row+SIZE-1 ,col:col+SIZE-1,k); rgb_mean(k) = mean(mean(temp)); end
deviation = zeros(1,img_num); for k = 1:img_num deviation(k) = abs(average_rgb(k,1) - rgb_mean(1)) + abs(average_rgb(k,2) - rgb_mean(2)) + abs(average_rgb(k,3) - rgb_mean(3)); 求目标区域与每一个素材图片的RGB误差 end