本文整理匯總了C#中OpenCvSharp.InputOutputArray.?.ThrowIfNotReady方法的典型用法代碼示例。如果您正苦於以下問題:C# InputOutputArray.?.ThrowIfNotReady方法的具體用法?C# InputOutputArray.?.ThrowIfNotReady怎麽用?C# InputOutputArray.?.ThrowIfNotReady使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenCvSharp.InputOutputArray
的用法示例。
在下文中一共展示了InputOutputArray.?.ThrowIfNotReady方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CompareSegments
/// <summary>
/// Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.
/// </summary>
/// <param name="size">The size of the image, where lines1 and lines2 were found.</param>
/// <param name="lines1">The first group of lines that needs to be drawn. It is visualized in blue color.</param>
/// <param name="lines2">The second group of lines. They visualized in red color.</param>
/// <param name="image">Optional image, where the lines will be drawn.
/// The image should be color(3-channel) in order for lines1 and lines2 to be drawn
/// in the above mentioned colors.</param>
/// <returns></returns>
public virtual int CompareSegments(
Size size, InputArray lines1, InputArray lines2, InputOutputArray image = null)
{
if (lines1 == null)
throw new ArgumentNullException(nameof(lines1));
if (lines2 == null)
throw new ArgumentNullException(nameof(lines2));
lines1.ThrowIfDisposed();
lines2.ThrowIfDisposed();
image?.ThrowIfNotReady();
var ret = NativeMethods.imgproc_LineSegmentDetector_compareSegments(
ptr, size, lines1.CvPtr, lines2.CvPtr, Cv2.ToPtr(image));
GC.KeepAlive(lines1);
GC.KeepAlive(lines2);
image?.Fix();
return ret;
}