imgproc_LineSegmentDetector_compareSegments() private method

private imgproc_LineSegmentDetector_compareSegments ( IntPtr obj, Size size, IntPtr lines1, IntPtr lines2, IntPtr image ) : int
obj IntPtr
size Size
lines1 IntPtr
lines2 IntPtr
image IntPtr
return int
コード例 #1
0
        /// <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();
            //UFIX
            //image?.ThrowIfNotReady();
            if (image != null)
            {
                image.ThrowIfNotReady();
            }

            var ret = NativeMethods.imgproc_LineSegmentDetector_compareSegments(
                ptr, size, lines1.CvPtr, lines2.CvPtr, Cv2.ToPtr(image));

            GC.KeepAlive(lines1);
            GC.KeepAlive(lines2);
            //UFIX
            //image?.Fix();
            if (image != null)
            {
                image.Fix();
            }

            return(ret);
        }