MATLAB分段线性点运算

分段线性点运算
对图像进行线性点运算
>> clear all;
R=imread('peppers.png');
J=rgb2gray(R);
[M,N]=size(J);
x=1;y=1;
for x=1:M
  for y=N
    if (J(x,y)<=35);
      H(x,y)=J(x,y)*10;
    elseif (J(x,y)>35&J(x,y)<=75);
      H(x,y)=(10/7)*(J(x,y)-5)+55;
    else (J(x,y)>75);
      H(x,y)=(105/180)*(J(x,y)-75)+150;
     end
  end
end
figure;
subplot(1,2,1);imshow(J);
title('原始图像');
subplot(1,2,2);imshow(H);
title('变换后图像');
>> 

猜你喜欢

转载自blog.csdn.net/weixin_43914278/article/details/89008439