module art.video_drawing

Short summary

module code_beatrix.art.video_drawing

Draws objects on videos.

source on GitHub

Functions

function

truncated documentation

blur

Blurs a part of a picture. Uses blur. …

rectangle

Draws a rectangle. Uses blur. …

Documentation

Draws objects on videos.

source on GitHub

code_beatrix.art.video_drawing.blur(img, p1, p2, frac=0.333, kernel_size=None)

Blurs a part of a picture. Uses blur.

Paramètres:
  • img – image (numpy.array)

  • p1 – (x1,y1)

  • p2 – (x2, y2)

  • frac – if not None, if kernel_size is equal to this fraction of the original frame

  • kernel_size – kernel size for the bluring (wins over frac)

It modifies the original picture.

source on GitHub

code_beatrix.art.video_drawing.cv_blur()

blur(src, ksize[, dst[, anchor[, borderType]]]) -> dst . @brief Blurs an image using the normalized box filter. . . The function smooths an image using the kernel: . . f[texttt{K} = frac{1}{texttt{ksize.width*ksize.height}} begin{bmatrix} 1 & 1 & 1 & cdots & 1 & 1 \ 1 & 1 & 1 & cdots & 1 & 1 \ hdotsfor{6} \ 1 & 1 & 1 & cdots & 1 & 1 \ end{bmatrix}f] . . The call blur(src, dst, ksize, anchor, borderType) is equivalent to boxFilter(src, dst, src.type(), ksize, . anchor, true, borderType). . . @param src input image; it can have any number of channels, which are processed independently, but . the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. . @param dst output image of the same size and type as src. . @param ksize blurring kernel size. . @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel . center. . @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported. . @sa boxFilter, bilateralFilter, GaussianBlur, medianBlur

code_beatrix.art.video_drawing.cv_rectangle()

rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) -> img . @brief Draws a simple, thick, or filled up-right rectangle. . . The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners . are pt1 and pt2. . . @param img Image. . @param pt1 Vertex of the rectangle. . @param pt2 Vertex of the rectangle opposite to pt1 . . @param color Rectangle color or brightness (grayscale image). . @param thickness Thickness of lines that make up the rectangle. Negative values, like #FILLED, . mean that the function has to draw a filled rectangle. . @param lineType Type of the line. See #LineTypes . @param shift Number of fractional bits in the point coordinates.

rectangle(img, rec, color[, thickness[, lineType[, shift]]]) -> img . @overload . . use rec parameter as alternative specification of the drawn rectangle: r.tl() and . r.br()-Point(1,1) are opposite corners

code_beatrix.art.video_drawing.rectangle(img, p1, p2, color=(255, 255, 0))

Draws a rectangle. Uses blur.

Paramètres:
  • img – image (numpy.array)

  • p1 – (x1,y1)

  • p2 – (x2, y2)

  • kernel_size – kernel size for the bluring.

It modifies the original picture.

source on GitHub