RegionInfo for faces . X and Y = TopLeft or Center position

Started by berliner_ffm, October 01, 2022, 05:04:31 PM

Previous topic - Next topic

berliner_ffm

I am a bit confused about the X and Y-Fields of the area-struct within RegionInfo.
I thought this would be the Top-left-position of the face found in an image, so that the rectangle around the face would be:
(X,Y,X+W,Y+H) (all values in percentage of the image)

However it seems to me as if Lightroom would use X and Y as the centerpoint of the image, making the rectangle
(Y-W/2,Y-H/2,X+W/2,Y+W/2)

Is X & Y indeed the center of the face? Thanks for your help!

Phil Harvey

Are you talking about the Microsoft RegionInfo, or the MWG RegionInfo?

Microsoft defines x/y as upper/left, while MWG defines it as center.  (This makes perfect sense since Microsoft is part of the MWG group, and they always do their best to keep programmers guessing.)

I didn't remember this offhand, and it took me about 20 minutes to look up the relevant specifications to be able to answer this question.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

berliner_ffm

Thank you Phil, I appreciate your time! The more you drive into metadata, the more it becomes a mess I guess.