matlab 修改rbg图像中指定范围内像素点的rgb值

来源:互联网 发布:悦游网络加速器安卓 编辑:程序博客网 时间:2024/06/05 10:15
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 bottomimgto=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    endreturn;end

0 0
原创粉丝点击