It only looks like the red channel. Your code is extracting the luminance (rgb2gray(data)
) from the red channel (data(:,:,1)
), which would give a kind of normalized red channel except that negative values are truncated to zero.
If data
is an unsigned integer (probably uint8
), the subtraction cannot give negative values, so any pixel without a prominent red component will be set to zero. You can see a map of these pixels by subtracting in a signed data type and comparing the result:
redMap = diff_im > (double(data(:,:,1))-double(rgb2gray(data)))