Quantcast
Channel: XnView Software
Viewing all articles
Browse latest Browse all 4990

Face Recognition

$
0
0
by Andreas1974 (Posted Tue May 17, 2016 8:47 am)
Is there still no support for showing Face tags in the XnView Software?

As I see it: face tag support does not need to deal with actual automatic face recognition, but to make me switch from Windows Photo Gallery there has to be a way to display the face rectangles and names "on top of" the photo. I've been adding face tags for many years, using Photo Gallery in different versions. And there has to be a way to manually select a face (rectangle) and add a name to it, saving it into the XMP data using the current standard.

The face tag data is stored in XMP "rdf:Bag" elements, but there are a few variants of exactly how. I had a look at it a few years ago, and then I found three ways of storing the rectangle and face data inside the Bag.

Sample code:
Code: Select all
         // Pick out Windows Live Face Tags (pairs of a rectangle and a name)
         // First try to get a "Description" parent node for the face areas
         XmlNodeList nodes;
         
         XmpStructs.XmpFaceStorageType xmlType = XmpStructs.XmpFaceStorageType.Unknown;
         int nodesTotalCount = 0;

         XmlNodeList DescNodes = xmlDoc.SelectNodes("//rdf:Bag/rdf:li[rdf:Description]", nsmgr);
         if (DescNodes.Count > 0)
         {
            // There was a Description element (At least the older version of Photo Gallery Live and Piccasa use the Description element, but in slightly different ways)
            nodes = xmlDoc.SelectNodes("//rdf:Bag/rdf:li[rdf:Description[MPReg:Rectangle and MPReg:PersonDisplayName]]", nsmgr);
            nodesTotalCount = nodes.Count;
            if (nodesTotalCount>0) xmlType = XmpStructs.XmpFaceStorageType.Old;

            if (nodesTotalCount == 0)
            {
               nodes = xmlDoc.SelectNodes("//rdf:Bag/rdf:li[rdf:Description[@mwg-rs:Name]/mwg-rs:Area]", nsmgr);
               nodesTotalCount = nodes.Count;
               if (nodesTotalCount > 0) xmlType = XmpStructs.XmpFaceStorageType.Picasa;
            }

         } else {
            
            // People tags can be stored in more than one way. ExifTool stores them without the "description" elements
            nodes = xmlDoc.SelectNodes("//rdf:Bag/rdf:li[MPReg:Rectangle and MPReg:PersonDisplayName]", nsmgr);
            nodesTotalCount = nodes.Count;
            if (nodesTotalCount > 0) xmlType = XmpStructs.XmpFaceStorageType.ExifTool;

         }


There are also some (similar) differences when it comes to storing the rectangles.

The aforementioned (Nov 16, 2009) AvPicFaceXmpTagger is using ExifTool, which I see is included in XnViewMp (as a tab).

Is displaying and editing the PersonDisplayName and its accompanying rectangle considered for future versions of xnView?

Read Main Topic

Viewing all articles
Browse latest Browse all 4990

Trending Articles