how to get masks from the .mat file

8 次查看(过去 30 天)
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 .

采纳的回答

Vinayak Choyyan
Vinayak Choyyan 2023-4-10
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 个评论
merzouk
merzouk 2023-4-11
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 2023-4-11
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Recognition, Object Detection, and Semantic Segmentation 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by