28非线性灰度变换

176 阅读1分钟

close all;clear all;clc;

R=imread('微信图片_20220429194904_512_512.bmp'); %读入图像,赋值给R

G=rgb2gray(R); %转成灰度图像

G2=double(G); %数据类型转换成双精度

O=(log(G2+1))/10; %进行基于常用对数的非线性灰度变换

subplot(121),imshow(G);

subplot(122),imshow(O);