function deutRGB = deuteranopia(normalRGB) %DEUTERANOPIA Simulate an image with M-cone deficiency (deuteranopia). % % DEUT = DEUTERANOPIA(RGB) % % Reference: http://www.tsi.enst.fr/~brettel/CRA24/table2.html cmaps = load('color_anomalies.mat'); % Convert the RGB image to an indexed image using the normal colormap. normalInd = rgb2ind(normalRGB, cmaps.normal ./ 255); % Convert back to an RGB image using the anomalous colormap. deutRGB = ind2rgb(normalInd, cmaps.deut ./ 255);