0

Friends, I have images(more 100) with their ground truths (Their black white masks). How can I get them automatically bound in the pascal voc format, bounding box values, ie xml files.

I mean that creating xmin,xmax,ymin,ymax values from masks and saved them as xml files. I used LabelImg, but there was automatic way, I did not find. I will use them for deep learning pascal voc. Is there a code, tool or link how to do?

Lux
  • 17,835
  • 5
  • 43
  • 73
pascaltx
  • 23
  • 3

1 Answers1

0

If you want to get bounding box from masks, then you just need to use numpy.where() to get indexes of each max, then you simply get the max and min values of those indexes, and those are exactly the coordonates of the bounding box

  • Thanks. After this, how to save this output for pascal voc dataset style. Could you share if possible a similar script matlab or python. Thanks again. – pascaltx Jan 18 '20 at 15:21