/// <summary> /// Draw a contour. /// </summary> /// <param name="contour"> Chain code contour.</param> /// <param name="img">Image to draw on.</param> public static void RenderContourChainCode(CvContourChainCode contour, IplImage img) { RenderContourChainCode(contour, img, new CvScalar(255, 255, 255, 0)); }
/// <summary> /// Draw a contour. /// </summary> /// <param name="contour"> Chain code contour.</param> /// <param name="img">Image to draw on.</param> /// <param name="color">Color to draw (default, white).</param> public static void RenderContourChainCode(CvContourChainCode contour, IplImage img, CvScalar color) { if (contour == null) throw new ArgumentNullException("contour"); if (img == null) throw new ArgumentNullException("img"); CvBlobInvoke.cvb_cvRenderContourChainCode(contour.CvPtr, img.CvPtr, color); }
/// <summary> /// Convert a chain code contour to a polygon. /// </summary> /// <param name="cc">Chain code contour.</param> /// <returns>A polygon.</returns> public static CvContourPolygon ConvertChainCodesToPolygon(CvContourChainCode cc) { if (cc == null) throw new ArgumentNullException("cc"); IntPtr ptr = CvBlobInvoke.cvb_cvConvertChainCodesToPolygon(cc.CvPtr); if (ptr == IntPtr.Zero) return null; else return new CvContourPolygon(ptr); }