Beispiel #1
0
        /// <summary>
        /// 枠だけの楕円,楕円弧,もしくは塗りつぶされた扇形の楕円を描画する
        /// </summary>
        /// <param name="img">楕円が描画される画像</param>
        /// <param name="center">楕円の中心</param>
        /// <param name="axes">楕円の軸の長さ</param>
        /// <param name="angle">回転角度</param>
        /// <param name="startAngle">楕円弧の開始角度</param>
        /// <param name="endAngle">楕円弧の終了角度</param>
        /// <param name="color">楕円の色</param>
        /// <param name="thickness">楕円弧の線の幅 [既定値は1]</param>
        /// <param name="lineType">楕円弧の線の種類 [既定値はLineType.Link8]</param>
        /// <param name="shift">中心座標と軸の長さの小数点以下の桁を表すビット数 [既定値は0]</param>
#else
        /// <summary>
        /// Draws simple or thick elliptic arc or fills ellipse sector
        /// </summary>
        /// <param name="img">Image. </param>
        /// <param name="center">Center of the ellipse. </param>
        /// <param name="axes">Length of the ellipse axes. </param>
        /// <param name="angle">Rotation angle. </param>
        /// <param name="startAngle">Starting angle of the elliptic arc. </param>
        /// <param name="endAngle">Ending angle of the elliptic arc. </param>
        /// <param name="color">Ellipse color. </param>
        /// <param name="thickness">Thickness of the ellipse arc. [By default this is 1]</param>
        /// <param name="lineType">Type of the ellipse boundary. [By default this is LineType.Link8]</param>
        /// <param name="shift">Number of fractional bits in the center coordinates and axes' values. [By default this is 0]</param>
#endif
        public static void Ellipse(Mat img, CvPoint center, CvSize axes, double angle, double startAngle, double endAngle, CvScalar color,
            int thickness, LineType lineType, int shift)
        {
            if (img == null)
                throw new ArgumentNullException("img");
            
            CvInvoke.cvEllipse(img.ToIplImage().CvPtr, center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift);
        }
Beispiel #2
0
        /// <summary>
        /// 円を描画する
        /// </summary>
        /// <param name="img">画像</param>
        /// <param name="center">円の中心</param>
        /// <param name="radius">円の半径</param>
        /// <param name="color">円の色</param>
        /// <param name="thickness">線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1]</param>
        /// <param name="line_type">線の種類. [既定値はLineType.Link8]</param>
        /// <param name="shift">中心座標と半径の小数点以下の桁を表すビット数. [既定値は0]</param>
#else
        /// <summary>
        /// Draws a circle
        /// </summary>
        /// <param name="img">Image where the circle is drawn. </param>
        /// <param name="center">Center of the circle. </param>
        /// <param name="radius">Radius of the circle. </param>
        /// <param name="color">Circle color. </param>
        /// <param name="thickness">Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1]</param>
        /// <param name="line_type">Type of the circle boundary. [By default this is LineType.Link8]</param>
        /// <param name="shift">Number of fractional bits in the center coordinates and radius value. [By default this is 0]</param>
#endif
        public static void Circle(Mat img, CvPoint center, int radius, CvScalar color, int thickness, LineType line_type, int shift)
        {
            if (img == null)
                throw new ArgumentNullException("img");
            CvInvoke.cvCircle(img.ToIplImage().CvPtr, center, radius, color, thickness, line_type, shift);
        }
Beispiel #3
0
        /// <summary>
        /// 枠のみ,もしくは塗りつぶされた矩形を描画する
        /// </summary>
        /// <param name="img">画像</param>
        /// <param name="pt1">矩形の一つの頂点</param>
        /// <param name="pt2">矩形の反対側の頂点</param>
        /// <param name="color">線の色(RGB),もしくは輝度(グレースケール画像).</param>
        /// <param name="thickness">矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1]</param>
        /// <param name="lineType">線の種類. [既定値はLineType.Link8]</param>
        /// <param name="shift">座標の小数点以下の桁を表すビット数. [既定値は0]</param>
#else
        /// <summary>
        /// Draws simple, thick or filled rectangle
        /// </summary>
        /// <param name="img">Image. </param>
        /// <param name="pt1">One of the rectangle vertices. </param>
        /// <param name="pt2">Opposite rectangle vertex. </param>
        /// <param name="color">Line color (RGB) or brightness (grayscale image). </param>
        /// <param name="thickness">Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1]</param>
        /// <param name="lineType">Type of the line, see cvLine description. [By default this is LineType.Link8]</param>
        /// <param name="shift">Number of fractional bits in the point coordinates. [By default this is 0]</param>
#endif
        public static void Rectangle(Mat img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness, LineType lineType, int shift)
        {
            if (img == null)
                throw new ArgumentNullException("img");
            
            CvInvoke.cvRectangle(img.ToIplImage().CvPtr, pt1, pt2, color, thickness, lineType, shift);
        }
Beispiel #4
0
        /// <summary>
        /// 円を描画する
        /// </summary>
        /// <param name="img">画像</param>
        /// <param name="center">円の中心</param>
        /// <param name="radius">円の半径</param>
        /// <param name="color">円の色</param>
#else
        /// <summary>
        /// Draws a circle
        /// </summary>
        /// <param name="img">Image where the circle is drawn. </param>
        /// <param name="center">Center of the circle. </param>
        /// <param name="radius">Radius of the circle. </param>
        /// <param name="color">Circle color. </param>
#endif
        public static void Circle(Mat img, CvPoint center, int radius, CvScalar color)
        {
            if (img == null)
                throw new ArgumentNullException("img");
            CvInvoke.cvCircle(img.ToIplImage().CvPtr, center, radius, color, 1, LineType.Link8, 0);
        }
Beispiel #5
0
        /// <summary>
        /// 2点を結ぶ線分を画像上に描画する.
        /// </summary>
        /// <param name="img">画像</param>
        /// <param name="pt1">線分の1番目の端点</param>
        /// <param name="pt2">線分の2番目の端点</param>
        /// <param name="color">線分の色</param>
#else
        /// <summary>
        /// Draws a line segment connecting two points
        /// </summary>
        /// <param name="img">The image. </param>
        /// <param name="pt1">First point of the line segment. </param>
        /// <param name="pt2">Second point of the line segment. </param>
        /// <param name="color">Line color. </param>
#endif
        public static void Line(Mat img, CvPoint pt1, CvPoint pt2, CvScalar color)
        {
            if (img == null)
                throw new ArgumentNullException("img");

            CvInvoke.cvLine(img.ToIplImage().CvPtr, pt1, pt2, color, 1, LineType.Link8, 0);
        }