灰度反转


公式

\(g(x,y)\) 为转换图像对应的 \(x,y\) 处的值, \(f(x,y)\) 为原灰度图像的值,L为灰度级数(一般为256)

\(g(x,y) = L - 1 - f(x,y)\)

matlab实现

clc;
close all;
clear all;

imGray = imread('gray1.png');

% 直接变换
imVers = 256 - imGray - 1;
imVers = uint8(imVers);
subplot(1,1,1);
imshow(imVers);

总结

这个代码整体也算是比较简单,用途就是字面意思,反转灰度值

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2021-07-12
  • 2021-09-22
  • 2021-11-30
  • 2021-11-23
  • 2021-10-03
猜你喜欢
  • 2021-11-27
  • 2021-06-10
  • 2022-02-14
  • 2022-01-05
  • 2021-12-18
相关资源
相似解决方案