AppSettings and Configuration changes,
major changes to E_Distance and minor for D_Face
This commit is contained in:
@ -471,7 +471,7 @@ public sealed class FaceRecognition : DisposableObject
|
||||
/// <returns>An enumerable collection of face location correspond to all faces in specified image.</returns>
|
||||
/// <exception cref="NullReferenceException"><paramref name="image"/> is null.</exception>
|
||||
/// <exception cref="ObjectDisposedException"><paramref name="image"/> or this object is disposed.</exception>
|
||||
public List<Location> FaceLocations(Model model, Image image, int numberOfTimesToUpsample, bool sortByPixelPercentage)
|
||||
public List<Location> FaceLocations(Model model, Image image, int numberOfTimesToUpsample, bool sortByNormalizedPixelPercentage)
|
||||
{
|
||||
if (image == null)
|
||||
throw new NullReferenceException(nameof(image));
|
||||
@ -487,8 +487,8 @@ public sealed class FaceRecognition : DisposableObject
|
||||
face.Dispose();
|
||||
results.Add(new Location(confidence, ret, image.Width, image.Height));
|
||||
}
|
||||
if (sortByPixelPercentage)
|
||||
results = (from l in results orderby l.PixelPercentage select l).ToList();
|
||||
if (sortByNormalizedPixelPercentage)
|
||||
results = (from l in results orderby l.NormalizedPixelPercentage select l).ToList();
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -64,31 +64,31 @@ public sealed class Image : DisposableObject
|
||||
/// <summary>
|
||||
/// Saves this <see cref="Image"/> to the specified file.
|
||||
/// </summary>
|
||||
/// <param name="filename">A string that contains the name of the file to which to save this <see cref="Image"/>.</param>
|
||||
/// <param name="fileName">A string that contains the name of the file to which to save this <see cref="Image"/>.</param>
|
||||
/// <param name="format">The <see cref="ImageFormat"/> for this <see cref="Image"/>.</param>
|
||||
/// <exception cref="NullReferenceException"><paramref name="filename"/> is null.</exception>
|
||||
/// <exception cref="NullReferenceException"><paramref name="fileName"/> is null.</exception>
|
||||
/// <exception cref="ObjectDisposedException">This object is disposed.</exception>
|
||||
public void Save(string filename, ImageFormat format)
|
||||
public void Save(string fileName, ImageFormat format)
|
||||
{
|
||||
if (filename == null)
|
||||
throw new NullReferenceException(nameof(filename));
|
||||
if (fileName == null)
|
||||
throw new NullReferenceException(nameof(fileName));
|
||||
|
||||
ThrowIfDisposed();
|
||||
|
||||
string? directory = Path.GetDirectoryName(filename);
|
||||
string? directory = Path.GetDirectoryName(fileName);
|
||||
if (!Directory.Exists(directory) && !string.IsNullOrWhiteSpace(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case ImageFormat.Bmp:
|
||||
DlibDotNet.Dlib.SaveBmp(Matrix, filename);
|
||||
DlibDotNet.Dlib.SaveBmp(Matrix, fileName);
|
||||
break;
|
||||
case ImageFormat.Jpeg:
|
||||
DlibDotNet.Dlib.SaveJpeg(Matrix, filename);
|
||||
DlibDotNet.Dlib.SaveJpeg(Matrix, fileName);
|
||||
break;
|
||||
case ImageFormat.Png:
|
||||
DlibDotNet.Dlib.SavePng(Matrix, filename);
|
||||
DlibDotNet.Dlib.SavePng(Matrix, fileName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user