Effacer les filtres
Effacer les filtres

how to get masks from the .mat file

6 vues (au cours des 30 derniers jours)
merzouk
merzouk le 7 Avr 2023
Commenté : Vinayak Choyyan le 11 Avr 2023
Hello, I am building a semantic segmentation CNN, I made my lables on matlab with image labler but I don't know how to get the masks I need to train my neural network.
Is there a way to get masks, knowing that I have several lables?
thank you and have a nice day .

Réponse acceptée

Vinayak Choyyan
Vinayak Choyyan le 10 Avr 2023
Dear merzouk,
As per my understanding, you have used the Image Labeler app in MATLAB to label some images and exported the results to a .mat file. You would now like to know how to access the labels in this .mat file.
Please refer to this link https://www.mathworks.com/help/vision/ug/get-started-with-the-image-labeler.html#mw_72146e4f-e569-457d-91b9-9ac80caffb67 to know more about how to access the labels in the .mat file. The data is stored in ‘groundTruth’ format and you can read more about ‘groundTruth’ format here https://www.mathworks.com/help/vision/ref/groundtruth.html?s_tid=doc_ta.
Alternatively, if you are looking for how to read any mat file into a code, you can use the ‘load’ function to do the same. Please refer to this https://www.mathworks.com/help/matlab/ref/load.htmlto know more about ‘load’ function.
I hope this resolves the issue you are facing.
  2 commentaires
merzouk
merzouk le 11 Avr 2023
Thanks for your help but I wanted to have a mask in tiff or png format from the .mat file same as we can get with labkit of imagej do you think that's possible ?
Vinayak Choyyan
Vinayak Choyyan le 11 Avr 2023
I am glad that I was able to help you.
Once you have the labels, you could use the 'label2rgb' function to convert the labels into an image. Then you could use the 'imwrite' function to save the image in tiff format by specifing the image file format.
Please refer to the following documentation to read more about
I hope this resolves the issue you are facing.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Tags

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by