RGB2GS - RGB to gray scale

  • Convert RGB image to gray scale image.
  • <m>f = 0.299R+0.587G+0.114B</m>
% RGB to GrayScale
function [gs]=RGB2GS(rgb)
 
% GS = 0.299R+0.587G+0.114B
gs = 0.299*rgb(:,:,1)+0.587*rgb(:,:,2)+0.114*rgb(:,:,3);
 
return;
programming/matlab/imageprocessing/rgb2gs.txt · Last modified: 2018-06-21 19:48 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0