필터 지우기
필터 지우기

Labelled 2D Matrix to JSON format for image segmentation deeplearning

조회 수: 6 (최근 30일)
Hannes Zedel
Hannes Zedel 2022년 8월 5일
답변: Shreeya 2023년 9월 14일
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

답변 (1개)

Shreeya
Shreeya 2023년 9월 14일
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!

Community Treasure Hunt

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

Start Hunting!

Translated by