function imgto=color_mark(img, diam,color_to )
%UNTITLED2 Summary of this function goes here
% img is input image which is a rgb image
% diam is a pixel scale in image [208,313,375,705]; [208 313] is
% lefttop,[375,705] is right bottom
imgto=img;
for x = diam(2):diam(4)
for y = diam(1):diam(3)
R=imgto(x,y,1);
G=imgto(x,y,2);
B=imgto(x,y,3);
if (R~=255|G~=255|B~=255);
imgto(x,y,1)=color_to(1);
imgto(x,y,2)=color_to(2);
imgto(x,y,3)=color_to(3);
end
end
end
return;
endmatlab 修改rbg图像中指定范围内像素点的rgb值
色彩标记函数详解
最新推荐文章于 2023-12-30 11:18:02 发布
本文介绍了一个用于色彩标记的MATLAB函数color_mark。该函数接受一张ARGB图片作为输入,并允许指定一个像素范围来更改该区域内的颜色。通过给定的直径参数设置左上角和右下角坐标来定义要修改的颜色区域。对于该区域内的每个像素,如果其红绿蓝值不全为255,则使用新的颜色值进行替换。
639

被折叠的 条评论
为什么被折叠?



