How to write the labeled images for training a sematic clssifier without using image labeler?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Tal Nir
el 24 de Jul. de 2019
Comentada: Tal Nir
el 29 de Jul. de 2019
Hi,
I want to train a semantic classifier through images made from a simulation process, I have the ground truth classification, and therefore I don't need the image labeler app.
However, I found explanation only on how to write ground truth by the image labeler app, or by commands which add labels inside a rectangle, etc...
However, I have the ground truth image with all the labels, I just want to save it in a proper manner and traing a sematic classifier from matlab, how do I do that?
I also looked in an example ground truth data, it looks like a color image, how do I write this color image from the labels?
Please help!
Thanks,
Dr. Tal Nir
0 comentarios
Respuesta aceptada
awezmm
el 25 de Jul. de 2019
Editada: awezmm
el 25 de Jul. de 2019
You should follow this example: https://www.mathworks.com/help/vision/examples/semantic-segmentation-using-deep-learning.html
After labeling, you should have two sets of images. The first set will be the original images and the second set will be the categorial images with labels.
For semantic segmentation you should create datastores:
imds = imageDatastore(imgDir); %corresponding to the original images
pxds = pixelLabelDatastore(labelDir,classes,labelIDs); %corresponding to labeled images
The example link above explains this in more detail.
Note that imgDir and labelDir can simply be a cell array of the filepaths to the images, in corresponding order
For instance:
imgDir = {"~/Users/awz/img1.tif", "~/Users/awz/img2.tif", "~/Users/awz/img3.tif"};
labelDir = {"~/Users/awz/label1.tif", "~/Users/awz/label2.tif", "~/Users/awz/label3.tif"};
classes = ["class1", "class2", "class3"];
labelIDs = [1 2 3];
imds = imageDatastore(imgDir);
pxds = pixelLabelDatastore(labelDir,classes,labelIDs);
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!