I'm currently working on image labeling for multiple files and the labels are saved in XML. Turns out all the labels need to be shortened in height as the details in the upper part of the label are similar to other unrelated pictures. Therefore, I would like to subtract the value of all <ymax>(number)</ymax>
in all of the XML files by a certain value. Is there a way to do this using notepad++ or python?
Below is an example of a full XML file. All of the files have the same format.
<annotation>
<folder>01</folder>
<filename>S249.jpeg</filename>
<path>D:\databs\01\01\S249.jpeg</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>375</width>
<height>500</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>116</xmin>
<ymin>280</ymin>
<xmax>141</xmax>
<ymax>325</ymax>
</bndbox>
</object>
<object>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>143</xmin>
<ymin>280</ymin>
<xmax>169</xmax>
<ymax>324</ymax>
</bndbox>
</object>
<object>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>169</xmin>
<ymin>280</ymin>
<xmax>195</xmax>
<ymax>324</ymax>
</bndbox>
</object>
<object>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>220</xmin>
<ymin>280</ymin>
<xmax>241</xmax>
<ymax>324</ymax>
</bndbox>
</object>
<object>
<name>B</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>206</xmin>
<ymin>396</ymin>
<xmax>229</xmax>
<ymax>431</ymax>
</bndbox>
</object>
<object>
<name>B</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>230</xmin>
<ymin>396</ymin>
<xmax>260</xmax>
<ymax>428</ymax>
</bndbox>
</object>
<object>
<name>B</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>261</xmin>
<ymin>391</ymin>
<xmax>285</xmax>
<ymax>428</ymax>
</bndbox>
</object>
</annotation>