Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Commit 840aba6

Browse files
authored
Merge pull request #2125 from justingruenberg/GH-1974
SusanCornersDetector: Each constructor results in different SupportedFormats
2 parents 7f449f3 + d280683 commit 840aba6

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

Sources/Accord.Imaging/AForge.Imaging/SusanCornersDetector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public SusanCornersDetector()
155155
/// <param name="differenceThreshold">Brightness difference threshold.</param>
156156
/// <param name="geometricalThreshold">Geometrical threshold.</param>
157157
///
158-
public SusanCornersDetector(int differenceThreshold, int geometricalThreshold)
158+
public SusanCornersDetector(int differenceThreshold, int geometricalThreshold) : this()
159159
{
160160
this.differenceThreshold = differenceThreshold;
161161
this.geometricalThreshold = geometricalThreshold;

Unit Tests/Accord.Tests.Imaging/Accord.Tests.Imaging.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<Compile Include="Filters\RobinsonEdgeDetectorTest.cs" />
118118
<Compile Include="SpeededUpRobustFeaturesDescriptorTest.cs" />
119119
<Compile Include="SpeededUpRobustFeaturesDetectorTest.cs" />
120+
<Compile Include="SusanCornersDetectorTests.cs" />
120121
<Compile Include="TestUtils.cs" />
121122
<Compile Include="ToolsTest.cs" />
122123
<Compile Include="Filters\WaveletTransformTest.cs" />
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Accord Unit Tests
2+
// The Accord.NET Framework
3+
// http://accord-framework.net
4+
//
5+
// Copyright © César Souza, 2009-2017
6+
// cesarsouza at gmail.com
7+
//
8+
// This library is free software; you can redistribute it and/or
9+
// modify it under the terms of the GNU Lesser General Public
10+
// License as published by the Free Software Foundation; either
11+
// version 2.1 of the License, or (at your option) any later version.
12+
//
13+
// This library is distributed in the hope that it will be useful,
14+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
// Lesser General Public License for more details.
17+
//
18+
// You should have received a copy of the GNU Lesser General Public
19+
// License along with this library; if not, write to the Free Software
20+
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21+
//
22+
23+
namespace Accord.Tests.Imaging
24+
{
25+
using Accord.Imaging;
26+
using Accord.Tests.Imaging.Properties;
27+
using AForge;
28+
using NUnit.Framework;
29+
using System.Collections.Generic;
30+
using System.Drawing;
31+
32+
[TestFixture]
33+
public class SusanCornersDetectorTests
34+
{
35+
[Test]
36+
public void Can_Process_8bpp()
37+
{
38+
// test for #1974
39+
40+
UnmanagedImage image = UnmanagedImage.FromManagedImage(Accord.Imaging.Image.Clone(Resources.image1));
41+
42+
Assert.AreEqual(System.Drawing.Imaging.PixelFormat.Format8bppIndexed, image.PixelFormat);
43+
44+
SusanCornersDetector detector = new SusanCornersDetector(25, 18);
45+
46+
// this shouldn't throw
47+
var points = detector.ProcessImage(image);
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)