how to get masks from the .mat file

4 ビュー (過去 30 日間)
merzouk
merzouk 2023 年 4 月 7 日
コメント済み: Vinayak Choyyan 2023 年 4 月 11 日
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 Center および File ExchangeConvert Image Type についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by