Platforms to show: All Mac Windows Linux Cross-Platform

CIFaceFeatureMBS class

Superclass: CIFeatureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreImage MBS MacCI Plugin 12.4 ✅ Yes ❌ No ❌ No ✅ Yes All
A CIFaceFeature object describes a face detected in a picture.
Example
// find faces in a photo and check for smiles and closed eyes
Var image As New CIImageMBS(SpecialFolder.Desktop.Child("photo.jpg"))
Var options As New Dictionary
options.Value(CIDetectorMBS.CIDetectorAccuracy) = CIDetectorMBS.CIDetectorAccuracyHigh
Var detector As CIDetectorMBS = CIDetectorMBS.detectorOfType(CIDetectorMBS.CIDetectorTypeFace, Nil, options)

Var lines() As String
For Each feature As CIFeatureMBS In detector.featuresInImage(image)
If feature IsA CIFaceFeatureMBS Then
Var face As CIFaceFeatureMBS = CIFaceFeatureMBS(feature)
Var line As String = "Face at " + Format(face.bounds.left, "0") + ", " + Format(face.bounds.top, "0")
If face.hasSmile Then line = line + ", smiling"
If face.leftEyeClosed Or face.rightEyeClosed Then line = line + ", eye closed"
lines.Add line
End If
Next

MessageBox lines.Count.ToString + " faces" + EndOfLine + String.FromArray(lines, EndOfLine)

Its properties provide locations for the face's eyes and mouth.
All positions are relative to the original image.
Subclass of the CIFeatureMBS class.

Superclass CIFeatureMBS

This class has no subclasses.

Blog Entries

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacCI Plugin.


CIDetectorMBS   -   CIFeatureMBS


The biggest plugin in space...