image labelling for background
이전 댓글 표시
I want to label images in order to use it in semantic segmentation
However, i want to label only specific area,
so if i only mark specific areas in whole image dataset
the areas which are not mark are automatically assumed as background?
Or do i have to mark it manually mark it as background as well?
답변 (2개)
Image Analyst
2019년 4월 8일
0 개 추천
It depends on what you want to do. If you only process the things you have labeled, then you don't need to worry about the background being labeled since even if it were, you'd not process it. If you want to process it, then you need to label it.
댓글 수: 5
fatihveysel nurcin
2019년 4월 8일
Bashar Saad
2019년 6월 17일
Sir, did you volve this problem or yet?
i need the solution of it
Gurpreet Singh Tuteja
2019년 10월 9일
Same problem I also want to segment one object, have you got the solution?
Please help
Image Analyst
2019년 10월 10일
You do not need to label the background (i.e. with bwconncomp or bwlabel). All you need to do is to segment out the foreground and process it (like find the area, brightness or whatever you want to do.) I go over all this in my Image Segmentation Tutorial
OJ27
2020년 4월 22일
any solution to this? is there an automatic way to label the undefined pixels as background? I want to use a cnn to do semantic segmentation of a specific object. The examples MATLAB offers come with datasets that two classes and no undefined pixels.
OJ27
2020년 4월 22일
So I solved this by only labeling the desired areas in my images with the class cat and the background was left without a label.
pxDir = fullfile('...'); % insert your directory
imds = imageDatastore('...'); % insert your directory
classNames = ["cat"];
pixelLabelID = [1];
pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
C = readimage(pxds,1);
undefinedPixels = isundefined(C);
If you look at C, the entries are either '<undefined>' or 'cat'. Also if you look at undefinedPixels you'll see how many of the pixels have this label and you can even plot it. So I replaced these two lines
classNames = ["cat","background"];
pixelLabelID = [1,0];
and now C shows either 'background' or 'cat'. If you run the
undefinedPixels = isundefined(C);
again, you'll find sum(sum(undefinedPixels)) is zero.
카테고리
도움말 센터 및 File Exchange에서 Semantic Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!