Giving specific values to pixels in some selected region

后端 未结 1 923
一向
一向 2021-01-26 10:09

I\'m trying to do the following in MATLAB:

  • Select some region of interest
  • Give the pixels in that region the value 1 for instanc
相关标签:
1条回答
  • 2021-01-26 10:32

    Here is a short sample. Since you mentioned imfreehand, I included that but depending on what type of ROI you want to create, impoly or imrect may do a better job:

    img = im2double(imread('cameraman.tif'));
    imshow(img);
    roi = imfreehand;
    img2 = img;
    img2(roi.createMask) = 1;
    imshow(img2);
    
    0 讨论(0)
提交回复
热议问题