You didn't extract the green channel, you set the red channel and blue channel to zero. That's not the same. Here, use this code:
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
To do the filter, you'd use intlut() if you want to change the image values.
map = gray(256);
map(1:slow) = slow;
map(shigh: You finish the rest!
To change the gray levels:
newGreenChannel = intlut(You finish the rest!
or to just change the display of it without changing the actual image itself,
imshow(greenChannel);
colormap(You finish the rest!
colorbar;
I've left parts undone for you to finish because that's what you requested. For noise reduction, you can blur the image with conv2().
noiseReducedImage = conv2(greenChannel, kernel);
kernel could be an N by N box with all ones. Make sure the kernel elements sum to 1 or else you're going to change the mean brightness of the image (so divide by N^2). Convolution is linear filtering. You could also use imfilter to do almost the same thing. imfilter is supposedly a little faster (according to the developer) and it doesn't flip the kernel like convolution does, though that doesn't make any difference if your kernel is symmetric.
Best Answer