public double Update(Array2DBase image, DRectangle guess) { this.ThrowIfDisposed(); if (image == null) { throw new ArgumentNullException(nameof(image)); } if (guess == null) { throw new ArgumentNullException(nameof(guess)); } image.ThrowIfDisposed(); guess.ThrowIfDisposed(); if (guess.IsEmpty) { throw new ArgumentException($"{nameof(guess)} must not be empty"); } var inType = image.ImageType.ToNativeArray2DType(); var ret = Native.correlation_tracker_update(this.NativePtr, inType, image.NativePtr, guess.NativePtr, out var confident); switch (ret) { case Dlib.Native.ErrorType.InputArrayTypeNotSupport: throw new ArgumentException($"Input {inType} is not supported."); } return(confident); }
public void StartTrack(Array2DBase image, DRectangle rect) { this.ThrowIfDisposed(); if (image == null) { throw new ArgumentNullException(nameof(image)); } if (rect == null) { throw new ArgumentNullException(nameof(rect)); } image.ThrowIfDisposed(); rect.ThrowIfDisposed(); if (rect.IsEmpty) { throw new ArgumentException($"{nameof(rect)} must not be empty"); } var inType = image.ImageType.ToNativeArray2DType(); var ret = Native.correlation_tracker_start_track(this.NativePtr, inType, image.NativePtr, rect.NativePtr); switch (ret) { case Dlib.Native.ErrorType.InputArrayTypeNotSupport: throw new ArgumentException($"Input {inType} is not supported."); } }
public DRectangle(DRectangle drect) { if (drect == null) { throw new ArgumentNullException(nameof(drect)); } drect.ThrowIfDisposed(); this.NativePtr = Native.drectangle_new4(drect.NativePtr); }
public DRectangle Operator(DRectangle drectangle) { if (drectangle == null) { throw new ArgumentNullException(nameof(drectangle)); } drectangle.ThrowIfDisposed(); var ptr = Native.rectangle_transform_operator_d(this.NativePtr, drectangle.NativePtr); return(new DRectangle(ptr)); }
public void AddOverlay(DRectangle rect, HsiPixel color) { this.ThrowIfDisposed(); if (rect == null) { throw new ArgumentNullException(nameof(rect)); } rect.ThrowIfDisposed(); Native.image_window_add_overlay3(this.NativePtr, rect.NativePtr, Dlib.Native.Array2DType.HsiPixel, ref color); }
public DRectangle Intersect(DRectangle drect) { if (drect == null) { throw new ArgumentNullException(nameof(drect)); } drect.ThrowIfDisposed(); var result = Native.drectangle_intersect(this.NativePtr, drect.NativePtr); return(new DRectangle(result)); }
public static DRectangle CenteredRect(DRectangle drect, double width, double height) { if (drect == null) { throw new ArgumentNullException(nameof(drect)); } drect.ThrowIfDisposed(); var result = Native.drectangle_centered_rect(drect.NativePtr, width, height); return(new DRectangle(result)); }
public static DRectangle Translate(DRectangle drect, DPoint point) { if (drect == null) { throw new ArgumentNullException(nameof(drect)); } if (point == null) { throw new ArgumentNullException(nameof(point)); } drect.ThrowIfDisposed(); point.ThrowIfDisposed(); var result = Native.drectangle_translate_rect_d(drect.NativePtr, point.NativePtr); return(new DRectangle(result)); }