Semantic segmentation for grayscale image
Mostra commenti meno recenti
How can implement semantic segmentation for gray scale image? How to train that network?
2 Commenti
Walter Roberson
il 27 Giu 2022
Yes. At worst case, repmat() the grayscale along the third dimension to make it an RGB image.
Zara Khan
il 28 Giu 2022
Risposte (2)
Image Analyst
il 27 Giu 2022
0 voti
Start here:
I'm working on a simplified version where you simply just locate your input images, and labeled images folder but it's not ready to share yet.
2 Commenti
Zara Khan
il 28 Giu 2022
Image Analyst
il 28 Giu 2022
If the Mathworks demo isn't working then make sure your input is correct (whether color image or gray scale, and size of image, if that matters). If it is correct then call tech support and tell them the demo doesn't work.
Zara Khan
il 28 Giu 2022
0 voti
12 Commenti
Zara Khan
il 28 Giu 2022
Walter Roberson
il 29 Giu 2022
Please attach your image1.png
Zara Khan
il 29 Giu 2022
Image Analyst
il 29 Giu 2022
OK, but what did tech support say when you called them?
Zara Khan
il 29 Giu 2022
Walter Roberson
il 29 Giu 2022
When I run with your "image 1.png" and your code, I do not see any problem. It just gives an empty final plot, which is what should be expected since there are no triangles in the input image.
Zara Khan
il 29 Giu 2022
Walter Roberson
il 29 Giu 2022
This is the code I used:
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1050055/image%201.png';
data = load('triangleSegmentationNetwork');
net = data.net;
net.Layers;
I = imread(filename);
[C,scores] = semanticseg(I,net,'MiniBatchSize',32);
B = labeloverlay(I, C);
figure
imshow(B);
figure
imagesc(scores)
axis square
colorbar
BW = C == 'triangle';
figure
imshow(BW)
The code ran without error. The final image was empty...
Oh wait, the final images BW are not empty. What is happening is that every location is being detected as triangle, so the output is pure white (all locations match.)
Zara Khan
il 29 Giu 2022
In the below example, everything that shows up black is labeled 'background'.
The implication is that the triangle segmentation network is not very specific at all.
Your sign-language images are being segmented... but the segmentation is saying that everything in the image is part of some triangle.
filename = 'baby.jpg';
data = load('triangleSegmentationNetwork');
net = data.net;
net.Layers;
I = imread(filename);
[C,scores] = semanticseg(I,net,'MiniBatchSize',32);
B = labeloverlay(I, C);
figure
imshow(B);
figure
imagesc(scores)
axis square
colorbar
BW = C == 'triangle';
figure
imshow(BW)
Zara Khan
il 30 Giu 2022
Walter Roberson
il 30 Giu 2022
Perhaps you should be training your own network; see https://www.mathworks.com/help/deeplearning/ug/create-simple-semantic-segmentation-network-in-deep-network-designer.html
The pre-trained Triangle Semantic Segmentation Network might simply be too weak for your purposes, especially since your sample sign images are not very triangular.
Categorie
Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


