Ejemplo n.º 1
0
        /// <summary>
        /// Restores the selected region in an image using the region neighborhood.
        /// </summary>
        /// <param name="src">Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.</param>
        /// <param name="inpaintMask">Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.</param>
        /// <param name="dst">Output image with the same size and type as src.</param>
        /// <param name="inpaintRadius">Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.</param>
        /// <param name="flags">Inpainting method that could be cv::INPAINT_NS or cv::INPAINT_TELEA</param>
        public static void Inpaint(InputArray src, InputArray inpaintMask,
                                   OutputArray dst, double inpaintRadius, InpaintMethod flags)
        {
            if (src == null)
            {
                throw new ArgumentNullException(nameof(src));
            }
            if (inpaintMask == null)
            {
                throw new ArgumentNullException(nameof(inpaintMask));
            }
            if (dst == null)
            {
                throw new ArgumentNullException(nameof(dst));
            }
            src.ThrowIfDisposed();
            inpaintMask.ThrowIfDisposed();
            dst.ThrowIfNotReady();

            NativeMethods.HandleException(
                NativeMethods.photo_inpaint(src.CvPtr, inpaintMask.CvPtr, dst.CvPtr, inpaintRadius, (int)flags));

            dst.Fix();
            GC.KeepAlive(src);
            GC.KeepAlive(inpaintMask);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// restores the damaged image areas using one of the available intpainting algorithms
 /// </summary>
 /// <param name="src"></param>
 /// <param name="inpaintMask"></param>
 /// <param name="dst"></param>
 /// <param name="inpaintRadius"></param>
 /// <param name="flags"></param>
 public static void Inpaint(InputArray src, InputArray inpaintMask,
     OutputArray dst, double inpaintRadius, InpaintMethod flags)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (inpaintMask == null)
         throw new ArgumentNullException("inpaintMask");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     inpaintMask.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.photo_inpaint(src.CvPtr, inpaintMask.CvPtr, dst.CvPtr, inpaintRadius, (int)flags);
     dst.Fix();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// restores the damaged image areas using one of the available intpainting algorithms
 /// </summary>
 /// <param name="src"></param>
 /// <param name="inpaintMask"></param>
 /// <param name="dst"></param>
 /// <param name="inpaintRadius"></param>
 /// <param name="flags"></param>
 public static void Inpaint(InputArray src, InputArray inpaintMask,
                            OutputArray dst, double inpaintRadius, InpaintMethod flags)
 {
     if (src == null)
     {
         throw new ArgumentNullException("src");
     }
     if (inpaintMask == null)
     {
         throw new ArgumentNullException("inpaintMask");
     }
     if (dst == null)
     {
         throw new ArgumentNullException("dst");
     }
     src.ThrowIfDisposed();
     inpaintMask.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.photo_inpaint(src.CvPtr, inpaintMask.CvPtr, dst.CvPtr, inpaintRadius, (int)flags);
     dst.Fix();
 }
Ejemplo n.º 4
0
 public static extern void cvInpaint(IntPtr src, IntPtr mask, IntPtr dst, double inpaintRadius, InpaintMethod flags);
Ejemplo n.º 5
0
 internal static extern void cvInpaint(Arr src, Arr inpaint_mask, Arr dst, double inpaintRange, InpaintMethod flags);
Ejemplo n.º 6
0
 private void radioButton2_CheckedChanged(object sender, EventArgs e)
 {
     iMethod = InpaintMethod.Telea;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Restores the selected region in an image using the region neighborhood.
 /// </summary>
 /// <param name="src">Input 8-bit 1-channel or 3-channel image.</param>
 /// <param name="inpaintMask">
 /// Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.
 /// </param>
 /// <param name="dst">Output image with the same size and type as <paramref name="src"/>.</param>
 /// <param name="inpaintRange">
 /// Radius of a circular neighborhood of each point inpainted that is considered by the algorithm.
 /// </param>
 /// <param name="flags">Specifies the inpainting method.</param>
 public static void Inpaint(Arr src, Arr inpaintMask, Arr dst, double inpaintRange, InpaintMethod flags)
 {
     NativeMethods.cvInpaint(src, inpaintMask, dst, inpaintRange, flags);
 }