[:2]#图像的高度和宽度
img=cv2.rectangle(img,(50,50),(rows-50,cols-110),(255,255,0),3)#绘制矩形
img=cv2.rectangle(...,n-300),(255,255,0),3)#绘制矩形
image=cv2.rectangle(image,(50,50),(n-100,n-150),(255,0,255),5)#绘制矩形
image...",image)
cv2.waitKey()
cv2.destroyAllWindows()
算法:矩形载体是为了更好地检测出人脸,在图像上绘制不同颜色和大小的矩形的基础操作。...除此之外,还有绘制直线、矩形、圆、椭圆等多种几何图形,并且可以在图像中的指定位置添加文字说明。...image=cv2. rectangle(image, p1, p2, color[, thickness[, lineType]])
img表示待绘制图像
p1表示矩形的顶点
p2表示矩形的对角顶点