I would like to remove the black area(background) of these images so that I can segment only the targetted region, which is the circle. Please help, thank you in advance.

댓글 수: 2

darova
darova 2021년 3월 22일
Did you try to binarize?
Ramanaesh Rao
Ramanaesh Rao 2021년 3월 23일
Hi, yes I did but i lost the region of interest too.

댓글을 달려면 로그인하십시오.

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 3월 23일
편집: KALYAN ACHARJYA 2021년 3월 23일

0 개 추천

You can direct thresold the largest black area. Here the shown code is quite lengthy, but it is easier to understand.
bwImage=imbinarize(rgb2gray(rgbImage));
mask=bwareafilt(~bwImage,1);
R_data=rgbImage(:,:,1);
G_data=rgbImage(:,:,2);
B_data=rgbImage(:,:,3);
R_data(mask)=255;
G_data(mask)=255;
B_data(mask)=255;
result=cat(3,R_data,G_data,B_data);
figure,imshow(result);

댓글 수: 3

Ramanaesh Rao
Ramanaesh Rao 2021년 3월 23일
Hi Sir, I am getting Unrecognized function or variable 'rgbImage'
KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 3월 23일
편집: KALYAN ACHARJYA 2021년 3월 23일
You have to load the image first-
rgbImage=imread('Imagefilename.jpg');
%......................^Check the image file name & extention
%After this paste previous code
Ramanaesh Rao
Ramanaesh Rao 2021년 3월 23일
Thank you so much sir.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 3월 22일

댓글:

2021년 3월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by