shimat / opencvsharp

OpenCV wrapper for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CornerMinEigenVal() changes format of src input array

MWHID opened this issue · comments

Summary of your issue

When I call into CornerMinEigenVal() with the "src" input array format CV_8UC1, after the call returns the format of "src" has changed to CV_32FC1. This caught me off guard as I did not expect "src" to change at all, and the format of "src" does not change in the Python version of CovernMinEigenVal(). Is this the expected behavior for OpenCVSharp?

Environment

Windows 11 x64
Microsoft Visual Studio 2022
C# .NET Framework 4.7.2
OpenCVSharp4 v4.8.0.20230708
OpenCVSharp4.runtime.win 4.8.0.20230708

What did you do when you faced the problem?

Trying to figure out if it's a bug or intended behavior

Example code:

            // myfile.bmp is a (1080 x 1920) 24bpp RGB image.  Note it is 1080 wide and 1920 tall (tall and skinny)
            Mat src = Cv2.ImRead("myfile.bmp", ImreadModes.Grayscale);
            // src is now format CV_8UC1
            OutputArray dst = OutputArray.Create(src);
            Cv2.CornerMinEigenVal(src, dst, 2, 5, BorderTypes.Default);
            // src is now format CV_32FC1

Output:

See above, format of src input array has changed

What did you intend to be?

Intended src to remain unchanged