BuildIt.CognitiveServices.VideoAPIExtensions.MotionDetection C# (CSharp) Метод

MotionDetection() публичный статический Метод

<p>Detects motion in a video, and returns the frame and duration of the motion that was captured. <br/>&bull; The supported input video formats include MP4, MOV, and WMV. Video file size should be no larger than 100MB. <br/>&bull; User can input detection zones to set up as areas to detect motion. <br/>&bull; User can specify motion sensitivity: high, medium, and low. Higher sensitivity means more motions will be detected at a cost that more false alarms will be reported.<br/>&bull; Motion Detection is optimized for stationary background videos. <br/>&bull; User can specify whether light change events should be detected. A light change refers to a change in the frame that was caused by a light turning off and on. Some developers do not want to detect this, as they consider it a false alarm. Other developers want to make sure they capture any change, light changes included.<br/>&bull; User can specify whether successive motions should be merged together by passing in a parameter (mergeTimeThreshold) For example, if a motion happens from 1 to 4 seconds and the next motion happens from 5 to 10 seconds, some developers will want to count that as one instance of motion.<br/>&bull; User can specify which frames to be detected by passing in a parameter (frameSamplingValue).<br/>&bull; Some motion may not be detected due to technical challenges; e.g. semi-transparent objects, and some small objects. <br/>&bull; Output files are deleted after 24 hours. </p>
public static MotionDetection ( this operations, string sensitivityLevel = default(string), double frameSamplingValue = default(double?), string detectionZones = default(string), bool detectLightChange = default(bool?), double mergeTimeThreshold = default(double?), string subscriptionKey = default(string), string ocpApimSubscriptionKey = default(string) ) : void
operations this /// The operations group for this extension method. ///
sensitivityLevel string /// Specify the detection sensitivity level: “low”, “medium”, “high”. Higher /// sensitivity means more motions will be detected at a cost that more false /// alarms will be reported. The default value is “medium”. ///
frameSamplingValue double /// User may skip frames by setting this parameter. It can be used as a /// tradeoff between performance and cost, skipping frames may reduce /// processing time but result in worse detection performance. The default /// value is 1, meaning detecting motion for every frame. If set to 2, then /// the algorithm will detect one frame for every two frames. The upper bound /// is 20. ///
detectionZones string /// User can setup detection zones by passing in a string like /// “detectionZones=0,0;0.5,0;1,0;1,0.5;1,1;0.5,1;0,1;0,0.5 /// |0.3,0.3;0.55,0.3;0.8,0.3; 0.8,0.55;0.8,0.8;0.55,0.8;0.3,0.8;0.3,0.55;| /// 0,0;1,0;1,1;0,1”, each detection zone is separated by a “|” and each /// point is defined by a “x,y” pair and separated by a “;”. At most 8 /// detection zones are supported and each detection zone should be defined /// by at least 3 points and no more than 16 points. The default setting is /// “detectionZones=0,0;0.5,0;1,0;1,0.5;1,1;0.5,1;0,1;0,0.5”, i.e. the whole /// frame defined by an 8-point polygon. ///
detectLightChange bool /// Specify whether light change events should be detected. The default value /// is false. ///
mergeTimeThreshold double /// Specify the threshold on whether successive motions should be merged /// together, if the interval between successive motions is <= /// mergeTimeThreshold, they will be merged. The default value is 0.0 and /// upper bound is 10.0. ///
subscriptionKey string /// subscription key in url ///
ocpApimSubscriptionKey string /// subscription key in header ///
Результат void
            public static void MotionDetection(this IVideoAPI operations, string sensitivityLevel = default(string), double? frameSamplingValue = default(double?), string detectionZones = default(string), bool? detectLightChange = default(bool?), double? mergeTimeThreshold = default(double?), string subscriptionKey = default(string), string ocpApimSubscriptionKey = default(string))
            {
                System.Threading.Tasks.Task.Factory.StartNew(s => ((IVideoAPI)s).MotionDetectionAsync(sensitivityLevel, frameSamplingValue, detectionZones, detectLightChange, mergeTimeThreshold, subscriptionKey, ocpApimSubscriptionKey), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None,  System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }