-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Missing binding to cvtColorTwoPlane #891
Comments
It would look something like this. It is missing the bindings in the cveCvtXXXX public static void CvtColorTwoPlane(IInputArray src1, IInputArray src2, IOutputArray dest, System.Type srcColor, System.Type destColor)
{
try
{
CvtColorTwoPlane(src1, src2, dest, CvToolbox.GetColorCvtCode(srcColor, destColor));
}
catch (Exception ex)
{
throw new NotSupportedException($"There is an error converting {(object)srcColor.ToString()} to {(object)destColor.ToString()}: {(object)ex.Message}", ex);
}
}
/// <summary>
/// Converts an image from one color space to another where the source image is stored in two planes.
/// This function only supports YUV420 to RGB conversion as of now.
/// </summary>
/// <param name="src1">The source 8-bit (8u) image</param>
/// <param name="src2">image containing interleaved U/V plane</param>
/// <param name="dst">The destination image of the same data type as src1. The number of channels will be different</param>
/// <param name="code">Specifies the type of conversion. See remarks for supported conversion codes</param>
/// <remarks>
/// Doc: https://docs.opencv.org/4.8.0/d8/d01/group__imgproc__color__conversions.html#ga8e873314e72a1a6c0252375538fbf753
///
/// Supported conversion codes:
/// COLOR_YUV2BGR_NV12
/// COLOR_YUV2RGB_NV12
/// COLOR_YUV2BGRA_NV12
/// COLOR_YUV2RGBA_NV12
/// COLOR_YUV2BGR_NV21
/// COLOR_YUV2RGB_NV21
/// COLOR_YUV2BGRA_NV21
/// COLOR_YUV2RGBA_NV21
/// </remarks>
public static void CvtColorTwoPlane(IInputArray src1, IInputArray src2, IOutputArray dst, ColorConversion code)
{
using var inputArray1 = src1.GetInputArray();
using var inputArray2 = src2.GetInputArray();
using var outputArray = dst.GetOutputArray();
cveCvtColorTwoPlane((IntPtr) (UnmanagedObject) inputArray1, (IntPtr) (UnmanagedObject) inputArray2, (IntPtr) (UnmanagedObject) outputArray, code);
}
[DllImport("cvextern", CallingConvention = CallingConvention.Cdecl)]
private static extern void cveCvtColorTwoPlane(IntPtr src1, IntPtr src2, IntPtr dst, ColorConversion code); |
Fixed in this commit: e7860dd Will be included in the next release. |
ty! |
We do not use the new "using" syntax without curly braces, such that our code can be compiled by compilers older than c# 8.0 (e.g. Unity 3D). |
Describe the bug
For some reason this method cvtColorTwoPlane, available since opencv v3 is not bound:
** OS / Platform **
all
** .Net version **
Xamarin
** Emgu CV package used**
4.8.1
The text was updated successfully, but these errors were encountered: