public TestImage(FaceEncodingData faceEncoding, Rect faceLocation, Mat img, HeadRotation horizontalHeadRotation, DateTime dateCreated, bool isReferenceImg, long userId) { if (faceLocation.Width <= 0 || faceLocation.Height <= 0) { throw new ArgumentException($"Invalid faceLocation"); } if (img.Empty()) { throw new ArgumentException("Empty img"); } if (img.Rows <= 0 || img.Cols <= 0) { throw new ArgumentException("Invalid img size"); } if (horizontalHeadRotation == HeadRotation.Unknown) { throw new ArgumentException("Unknown headRotation"); } FaceEncoding = faceEncoding ?? throw new ArgumentException("Null faceEncodingData"); FaceLocation = faceLocation; Img = img; HorizontalHeadRotation = horizontalHeadRotation; DateCreated = dateCreated; IsReferenceImg = isReferenceImg; UserId = userId; }
public TestImageBuilder AddFaceEncoding(FaceEncodingData faceEncoding) { FaceEncoding = faceEncoding; return(this); }