MATLAB: How to change the value of many pixel in RGB image

digital image processingimageimage acquisitionimage analysisimage processingImage Processing Toolboximage segmentation

Hi I am a beginner in Matlab, I have a RGB image, and I want to change the value of some pixels in black ..
If you can help me …
Thank you in advance
attached an image
image.bmp

Best Answer

  • img = imread('image.bmp');
    hsv = rgb2hsv(img);
    mask = hsv(:,:,1) >= 0.1 & hsv(:,:,1) <= 0.2;
    img2 = img;
    img2(repmat(mask,1,1,3)) = 0;
    imshow(img2)