-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feet: add FaceRecognition.CropFaces and Image.Save method
- Loading branch information
1 parent
146121a
commit 9765e23
Showing
9 changed files
with
266 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace FaceRecognitionDotNet | ||
{ | ||
|
||
/// <summary> | ||
/// Specifies the file format of the image. | ||
/// </summary> | ||
public enum ImageFormat | ||
{ | ||
|
||
/// <summary> | ||
/// Specifies that the bitmap (BMP) image format. | ||
/// </summary> | ||
Bmp, | ||
|
||
/// <summary> | ||
/// Specifies that the Joint Photographic Experts Group (JPEG) image format. | ||
/// </summary> | ||
Jpeg, | ||
|
||
/// <summary> | ||
/// Specifies that the W3C Portable Network Graphics (PNG) image format. | ||
/// </summary> | ||
Png, | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
src/FaceRecognitionDotNet/docs/ja/FaceRecognitionDotNet.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.IO; | ||
using Xunit; | ||
|
||
namespace FaceRecognitionDotNet.Tests | ||
{ | ||
|
||
public class ImageTest | ||
{ | ||
|
||
#region Fields | ||
|
||
private const string ResultDirectory = "Result"; | ||
|
||
#endregion | ||
|
||
[Fact] | ||
public void Save() | ||
{ | ||
const string testName = nameof(this.Save); | ||
|
||
var targets = new[] | ||
{ | ||
new { Name = "saved.bmp", Format = ImageFormat.Bmp }, | ||
new { Name = "saved.jpg", Format = ImageFormat.Jpeg }, | ||
new { Name = "saved.png", Format = ImageFormat.Png }, | ||
}; | ||
|
||
using (var img = FaceRecognition.LoadImageFile(Path.Combine("TestImages", "obama.jpg"))) | ||
{ | ||
var directory = Path.Combine(ResultDirectory, testName); | ||
Directory.CreateDirectory(directory); | ||
|
||
foreach (var target in targets) | ||
{ | ||
var path = Path.Combine(directory, target.Name); | ||
img.Save(path, target.Format); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters