python 基于opencv画方框

import cv2
image = cv2.imread("girl1.jpeg")

h = 50
x_center = 264
y_center = 712

draw_0 = cv2.rectangle(image, (x_center-h, y_center-h), (x_center+h, y_center+h), (255, 0, 0), 2)
cv2.imshow('German',draw_0)

参数是对角顶点坐标,颜色空间,线宽。

python 基于opencv画方框_第1张图片

附上画圆

Python: cv2.circle(img, center, radius, color[, thickness[, lineType[, shift]]]) 

Parameters:
  • img – Image where the circle is drawn.
  • center – Center of the circle.
  • radius – Radius of the circle.
  • color – Circle color.
  • thickness – Thickness of the circle outline, if positive. Negative thickness means that a filled circle is to be drawn.
  • lineType – Type of the circle boundary. See the line() description.
  • shift – Number of fractional bits in the coordinates of the center and in the radius value.

更多数学原理小文请关注公众号:未名方略

你可能感兴趣的:(Computer,graphics,空间艺术Raumkunst)