官术网_书友最值得收藏!

Understanding advanced shapes

In this section, we are going to see how to draw clip lines, arrowed lines, ellipses, and polylines. These shapes are not as straightforward to draw as the shapes we saw in the previous section, but they are simple to understand. The first step is to create an image where the shapes will be drawn. For this, a 300  300 image with the 3 channels (to properly display a BGR image) and a uint8 type (8-bit unsigned integers) will be created:

# We create the canvas to draw: 300 x 300 pixels, 3 channels, uint8 (8-bit unsigned integers)
# We set the background to black using np.zeros()
image = np.zeros((300, 300, 3), dtype="uint8")

We set the background to light gray using the colors dictionary:

# If you want another background color, you can do the following:
image[:] = colors['light_gray']

At this point, we can start drawing the new shapes.

主站蜘蛛池模板: 鄢陵县| 玛多县| 海晏县| 绍兴县| 苍山县| 永康市| 乡宁县| 资讯 | 定结县| 湟中县| 米易县| 济南市| 景宁| 桑日县| 襄城县| 盐津县| 乾安县| 金乡县| 广元市| 托里县| 涞源县| 海林市| 绥芬河市| 平果县| 东乡县| 呼和浩特市| 仁怀市| 康马县| 江达县| 深圳市| 苏尼特左旗| 苍南县| 蒲城县| 长沙市| 枣强县| 德江县| 伽师县| 香河县| 阿巴嘎旗| 德钦县| 司法|