I want to remove the green pixels in this image and replace it with white background as a preliminary step to do canny detection on this picture to detect only the spanner. I converted it into hsv and considered h without green as follows, But didn't work. Please Help.
image = imread('F:\03.jpg');
hsv = rgb2hsv(image);
hChannel = hsv(:, :, 1);
sChannel = hsv(:, :, 2);
vChannel = hsv(:, :, 3);
newH = hsv(:,:,1) > 0.25 & hsv(:,:,1) < 0.41;
newV = (0.1) * vChannel; % I am trying to change brightness
newHSVImage = cat(3, newH, sChannel, newV);
newRGBImage = hsv2rgb(newHSVImage);
imshow(newRGBIMage)