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

SusanCornersDetector: Each constructor results in different SupportedFormats #1974

Closed
justingruenberg opened this issue Nov 1, 2019 · 0 comments

Comments

@justingruenberg
Copy link
Contributor

justingruenberg commented Nov 1, 2019

The parameter-less constructor adds in Format8bppIndexed, Format24bppRgb, Format32bppRgb, Format32bppArgb to the SupportedFormats array, which the other constructor does not. Finding corners from an object created with the second constructor will throw an exception on 8bpp images (at least).

public SusanCornersDetector()
{
base.SupportedFormats.UnionWith(new[] { PixelFormat.Format8bppIndexed,
PixelFormat.Format24bppRgb,
PixelFormat.Format32bppRgb,
PixelFormat.Format32bppArgb });
}

Inside the InnerProcess the image gets converted to 8bpp if it isn't already:

if (image.PixelFormat == PixelFormat.Format8bppIndexed)
{
grayImage = image;
}
else
{
// create temporary grayscale image
grayImage = Grayscale.CommonAlgorithms.BT709.Apply(image);
}

The second constructor should call the parameterless constructor.

cesarsouza added a commit that referenced this issue May 30, 2020
SusanCornersDetector: Each constructor results in different SupportedFormats
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant