I cannot get hold of the XMP standard at the moment, all linked pages seem to be down. I would like to know how it defines the region of interest, e.g. to mark a face. As far as I remember, I should specify the centre of RoI and its width and height, with relative coordinates. But which corners do (0, 0) and (1, 1) correspond to?
The XMP files created by Lightroom seems to follow the MWG description (website currently down), as it contains this link to describe its content :
I took a random XMP file from one of my picture containing a recognized person : the part mwg-rs:Region is structured as follows :
<mwg-rs:Regions rdf:parseType="Resource"> <mwg-rs:AppliedToDimensions stDim:w="4731" stDim:h="3154" stDim:unit="pixel"/> <mwg-rs:RegionList> <rdf:Bag> <rdf:li> <rdf:Description mwg-rs:Rotation="-0.15987" mwg-rs:Name="The name part" mwg-rs:Type="Face"> <mwg-rs:Area stArea:h="0.17613" stArea:w="0.11730" stArea:x="0.42527" stArea:y="0.35826"/> </rdf:Description> </rdf:li> </rdf:Bag> </mwg-rs:RegionList> </mwg-rs:Regions>
You can see that for this image, the region is specified by an "Area" structure, containing 4 values, which appear to be percentages relative to the whole image :
- stArea:x and stArea:y are the coordinates of the center of the area, relative to the upper left corner of the image
- stArea:h and stArea:w are the height and the width
So to answer your question, (0,0) is the upper left corner of the pictures and (1,1) is the lower right corner.
As a side note, I don't know how the "Rotation" parameter of the mwg-rs Description part comes to play: at your place, I would make some tests :)