Face matching

The code snippet below demonstrates matching two images with printed faces.

var request = new Regula.MatchFacesRequest();
firstImage = new Regula.Image()
secondImage = new Regula.Image()
request.images = [image1, image2]
Regula.Face.matchFaces(jsonEncode(request)).then((response) {
print(response);
});

Declaring an image type is required for correct comparison. It influences matching results.

Response

MatchFacesResponse
└── error
└── matchedFaces
| └── first
| | └── tag
| | └── imageType
| | └── position
| └── second
| | └── tag
| | └── imageType
| | └── position
| └── similarity
| └── error
└── unmatchedFaces
| └── first
| | └── tag
| | └── imageType
| | └── position
| └── second
| | └── tag
| | └── imageType
| | └── position
| └── similarity
| └── error

Parameter

Description

error

Error

matchedFaces

Matched faces

unmatchedFaces

Unmatched faces

first

First image

second

Second image

tag

Tag

imageType

Image type

position

Position an image in the array