コード例 #1
0
 public static CIDetector CreateFaceDetector(CIContext context, bool highAccuracy)
 {
     // TypeFace is the only detector supported now
     using (var options = NSDictionary.FromObjectsAndKeys (new NSObject [] { highAccuracy ? AccuracyHigh : AccuracyLow },
                                   new NSObject [] { Accuracy }))
         return FromType (TypeFace, context, options);
 }
コード例 #2
0
        public static CIDetector CreateFaceDetector(CIContext context, FaceDetectorAccuracy? accuracy = null, float? minFeatureSize = null, bool? trackingEnabled = null)
        {
            CIDetectorOptions dopt = new CIDetectorOptions () {
                Accuracy = accuracy,
                MinFeatureSize = minFeatureSize,
                TrackingEnabled = trackingEnabled
            };

            using (var options = dopt.ToDictionary ())
                return FromType (TypeFace, context, options);
        }
コード例 #3
0
        public static CIDetector CreateFaceDetector(CIContext context, bool highAccuracy, float minFeatureSize)
        {
            // MinFeatureSize exists only in iOS6+, before this the field is null (and would throw if used)
            if (MinFeatureSize == null)
                return CreateFaceDetector (context, highAccuracy);

            // TypeFace is the only detector supported now
            using (var options = NSDictionary.FromObjectsAndKeys (new NSObject [] { highAccuracy ? AccuracyHigh : AccuracyLow, new NSNumber (minFeatureSize) },
                                          new NSObject [] { Accuracy, MinFeatureSize, }))
                return FromType (TypeFace, context, options);
        }
コード例 #4
0
 public static CIDetector CreateRectangleDetector(CIContext context, CIDetectorOptions detectorOptions)
 {
     using (var options = detectorOptions == null ? null : detectorOptions.ToDictionary ())
         return FromType (TypeRectangle, context, options);
 }
コード例 #5
0
ファイル: CIDetector.cs プロジェクト: zippo227/xamarin-macios
 public static CIDetector CreateTextDetector(CIContext context, CIDetectorOptions detectorOptions)
 {
     using (var options = detectorOptions == null ? null : detectorOptions.ToDictionary())
         return(FromType(TypeText, context, options));
 }