書名: Mastering OpenCV 4 with Python作者名: Alberto Fernández Villán本章字?jǐn)?shù): 106字更新時間: 2021-07-02 12:07:21
Drawing circles
The signature for the cv2.circle() function is as follows:
img = circle(img, center, radius, color, thickness=1, lineType=8, shift=0)
This function draws a circle with a radius radius centered in the center position. Some circles are defined in the following code:
cv2.circle(image, (50, 50), 20, colors['green'], 3)
cv2.circle(image, (100, 100), 30, colors['blue'], -1)
cv2.circle(image, (200, 200), 40, colors['magenta'], 10)
cv2.circle(image, (300, 300), 40, colors['cyan'], -1)
After drawing these circles, we call the show_with_matplotlib(image, 'cv2.circle()')function. The result is shown in the next screenshot:

The full code of the examples of this section can be seen in basic_drawing.py.
推薦閱讀
- Extending Jenkins
- DBA攻堅指南:左手Oracle,右手MySQL
- CMDB分步構(gòu)建指南
- 程序員面試算法寶典
- WSO2 Developer’s Guide
- Amazon S3 Cookbook
- Unreal Engine 4 Shaders and Effects Cookbook
- Scala編程實(shí)戰(zhàn)(原書第2版)
- QGIS By Example
- Advanced Express Web Application Development
- Java網(wǎng)絡(luò)編程實(shí)戰(zhàn)
- JSP程序設(shè)計實(shí)例教程(第2版)
- Python自然語言理解:自然語言理解系統(tǒng)開發(fā)與應(yīng)用實(shí)戰(zhàn)
- C語言程序設(shè)計
- 計算機(jī)軟件項(xiàng)目實(shí)訓(xùn)指導(dǎo)