private Image <Bgr, byte> InpaintMethod(VectorOfVectorOfPoint defects, InpaintType ip) { ProgressManager.AddSteps(_conturMatrix.Size); for (int i = 0; i < defects.Size; i++) { InpaintCleaner(defects[i], ip); ProgressManager.DoStep(); } return(_orgImage); }
private static extern void cveXInpaint(IntPtr src, IntPtr mask, IntPtr dst, InpaintType algorithmType);
/// <summary> /// The function implements different single-image inpainting algorithms /// </summary> /// <param name="src">source image, it could be of any type and any number of channels from 1 to 4. In case of 3- and 4-channels images the function expect them in CIELab colorspace or similar one, where first color component shows intensity, while second and third shows colors. Nonetheless you can try any colorspaces.</param> /// <param name="mask">mask (CV_8UC1), where non-zero pixels indicate valid image area, while zero pixels indicate area to be inpainted</param> /// <param name="dst">destination image</param> /// <param name="algorithmType">algorithm type</param> public static void Inpaint(Mat src, Mat mask, Mat dst, InpaintType algorithmType) { cveXInpaint(src, mask, dst, algorithmType); }
private void InpaintCleaner(VectorOfPoint defect, InpaintType ip) { var mask = GetMaskOfDefect(defect); CvInvoke.Inpaint(_orgImage, mask, _orgImage, 1.0, ip); }
public static void Inpaint(Mat src, Mat mask, Mat dst, InpaintType algorithmType) { cveXInpaint(src, mask, dst, algorithmType); }