Labelled 2D Matrix to JSON format for image segmentation deeplearning

5 Ansichten (letzte 30 Tage)
Hannes Zedel
Hannes Zedel am 5 Aug. 2022
Beantwortet: Shreeya am 14 Sep. 2023
Dear community,
I am trying to train a neural network for 2D panoptic image segmentation that uses JSON formatted label data as input. I look at very complex irregular shapes (metallurgical micrographs) and to avoid manual labelling, I'd like to use deterministic image analysis instead.
My thresholding-based instance segmentation method generates 2D matrices of the same dimensions as the original image and allocates each pixel to a target class by the same number, objects are identified as adjacent same numbers. I base this on the label output L of bwboundaries for each target class: [B,L]= bwboundaries()
As a snapshot, my labelled matrix/mask looks something like this (indicating 3 target classes and in this case 4 distinct objects):
[1 1 2 1 1;
1 2 2 2 1;
2 2 3 3 3]
Is there a way to convert such labels/masks, either the individual (binary) labels per target class or the complete labelled matrix, into a JSON format that I can use to train a neural network?
Thank you

Antworten (1)

Shreeya
Shreeya am 14 Sep. 2023
I understand that you have a labeled dataset for image segmentation training task and would want to convert it to JSON format. You can follow the steps outlined below to achieve it:
I hope this helps!

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by