mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 5b822ad516872b035de3112840270ee3e05aa2e2 Former-commit-id: 0cd7c02e8b19ca034d519796a3cbd049c36294c1 Former-commit-id: 6b2493b3e95b7325c8d87471ae0ba749a5924b03pull/1/head
1 changed files with 47 additions and 0 deletions
@ -0,0 +1,47 @@ |
|||||
|
// <copyright file="DetectEdges.cs" company="James Jackson-South">
|
||||
|
// Copyright (c) James Jackson-South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
|
||||
|
namespace ImageProcessorCore.Benchmarks |
||||
|
{ |
||||
|
using System.IO; |
||||
|
|
||||
|
using BenchmarkDotNet.Attributes; |
||||
|
|
||||
|
using CoreImage = ImageProcessorCore.Image; |
||||
|
|
||||
|
public class DetectEdges |
||||
|
{ |
||||
|
private CoreImage image; |
||||
|
|
||||
|
[Setup] |
||||
|
public void ReadImage() |
||||
|
{ |
||||
|
if (image == null) |
||||
|
{ |
||||
|
using(FileStream stream = File.OpenRead("../ImageProcessorCore.Tests/TestImages/Formats/Bmp/Car.bmp")) |
||||
|
{ |
||||
|
image = new CoreImage(stream); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[Benchmark(Description = "ImageProcessorCore DetectEdges")] |
||||
|
public void ImageProcessorCoreDetectEdges() |
||||
|
{ |
||||
|
image.DetectEdges(EdgeDetection.Kayyali); |
||||
|
image.DetectEdges(EdgeDetection.Kayyali); |
||||
|
image.DetectEdges(EdgeDetection.Kirsch); |
||||
|
image.DetectEdges(EdgeDetection.Lapacian3X3); |
||||
|
image.DetectEdges(EdgeDetection.Lapacian5X5); |
||||
|
image.DetectEdges(EdgeDetection.LaplacianOfGaussian); |
||||
|
image.DetectEdges(EdgeDetection.Prewitt); |
||||
|
image.DetectEdges(EdgeDetection.RobertsCross); |
||||
|
image.DetectEdges(EdgeDetection.Robinson); |
||||
|
image.DetectEdges(EdgeDetection.Scharr); |
||||
|
image.DetectEdges(EdgeDetection.Sobel); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue