提交 40cc1a65 编写于 作者: N np-csu 提交者: Waleed

fix cv2 function calling problem

function cv2.rectangle, cv2.circle and cv2.fillPoly returns None.
上级 66b02824
......@@ -280,15 +280,15 @@
" # Get the center x, y and the size s\n",
" x, y, s = dims\n",
" if shape == 'square':\n",
" image = cv2.rectangle(image, (x-s, y-s), (x+s, y+s), color, -1)\n",
" cv2.rectangle(image, (x-s, y-s), (x+s, y+s), color, -1)\n",
" elif shape == \"circle\":\n",
" image = cv2.circle(image, (x, y), s, color, -1)\n",
" cv2.circle(image, (x, y), s, color, -1)\n",
" elif shape == \"triangle\":\n",
" points = np.array([[(x, y-s),\n",
" (x-s/math.sin(math.radians(60)), y+s),\n",
" (x+s/math.sin(math.radians(60)), y+s),\n",
" ]], dtype=np.int32)\n",
" image = cv2.fillPoly(image, points, color)\n",
" cv2.fillPoly(image, points, color)\n",
" return image\n",
"\n",
" def random_shape(self, height, width):\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册