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

SusanCornersDetector: Each constructor results in different SupportedFormats #1974

@justingruenberg

Description

@justingruenberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions