title: How can I convert .xml files which contain image information to jpeg or png
body: <p>My task is to prepare the data for a Human Action Detection algorithm. To sum up I have been given some image .xml files (that have been taken with a Kinect sensor) that I want to convert to jpeg or png to be readable from the algorithm. I assume I have to use OpenCV.</p>
  
  <p>I'm sure it's a beginners question but I've searched the internet and found nothing. </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;opencv_storage&gt;
  &lt;depthImg190 type_id="opencv-image"&gt;
    &lt;width&gt;320&lt;/width&gt;
    &lt;height&gt;240&lt;/height&gt;
    &lt;origin&gt;top-left&lt;/origin&gt;
    &lt;layout&gt;interleaved&lt;/layout&gt;
    &lt;dt&gt;w&lt;/dt&gt;
    &lt;data&gt;
      0 0 0 0 27120 27384 27120 27120 27384 27120 27120 27120 27120 27384
      27384 27664 27664 27944 27944 27664 27664 27944 27944 27944 28224
      27944 27944 28224 28224 28224 28224 28520 28816 29120 29120 29120
      29120 29120 29120 29120 29432 29744 30072 30072 29744 29744 30072
      30072 30072 30400 30400 30736 30736 31080 31080 31080 31440 31440
      31440 31440 31800 31800 31800 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  
      0 0 0 0 27120 27120 27120 27120 27384 27384 27384 27384 27384 27384
      27664 27944 27944 27944 27944 27944 27944 27944 27944 27944 28224
      27944 28224 28224 28224 28224 28224 28520 29120 29120 29120 29120
      29120 29120 29120 29432 29432 29744 29744 30072 30072 30072 30072
      30400 30400 30400 30400 30736 30736 31080 31080 31440 31440 31440
      31440 31440 31800 31800 31800 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
      0 0 0 0 27120 27120 27120 27120 27664 27384 27384 27384 27120 27384
      27664 27944 27944 27944 27944 27664 27944 27944 27944 27944 28224
  
  </code></pre>