How do I select the pixels outside my region of interest?

3 ビュー (過去 30 日間)
Andreea Stancu
Andreea Stancu 2019 年 6 月 7 日
コメント済み: darova 2019 年 6 月 7 日
So, as you can see beside the skin lesion I also have some dark pixels in the corners and also in the immediate area of the lesion that I want to set as white in the mask. I am a bit stuck here, I was thinking about using roicolor but I am open to suggestons
Capture.JPG

採用された回答

darova
darova 2019 年 6 月 7 日
Untitl1ed.png
m = size(I,1); % number of rows
n = size(I,2); % number of columns
R = 100; % radius region
[X,Y] = meshgrid(1:n,1:m);
ind = (X-n/2).^2+(Y-m/2).^2 > R^2; % circle from the center
I(ind) = 1; % set white color to pixels outside
  2 件のコメント
Andreea Stancu
Andreea Stancu 2019 年 6 月 7 日
The thing is I work on a database of images and the lesion is not always centered in the middle. What can I do in this case?
darova
darova 2019 年 6 月 7 日
Just replace m/2 and n/2 with coordinates of a circle center
x0 = n/2;
y0 = m/2;
ind = (X-x0).^2+(Y-y0).^2 > R^2;

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by