Merge pull request #14733 from SchultzC:3.4

* cast positional arguments to int

* Changed to integer division based

* removed white space

* removed white space
pull/14744/head
SchultzC 6 years ago committed by Alexander Alekhin
parent 94ec0e9b74
commit 3833d86f0f
  1. 18
      samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py

@ -8,8 +8,8 @@ def my_ellipse(img, angle):
line_type = 8
cv.ellipse(img,
(W / 2, W / 2),
(W / 4, W / 16),
(W // 2, W // 2),
(W // 4, W // 16),
angle,
0,
360,
@ -24,7 +24,7 @@ def my_filled_circle(img, center):
cv.circle(img,
center,
W / 32,
W // 32,
(0, 0, 255),
thickness,
line_type)
@ -82,7 +82,7 @@ my_ellipse(atom_image, 45)
my_ellipse(atom_image, -45)
# 1.b. Creating circles
my_filled_circle(atom_image, (W / 2, W / 2))
my_filled_circle(atom_image, (W // 2, W // 2))
## [draw_atom]
## [draw_rook]
@ -93,7 +93,7 @@ my_polygon(rook_image)
## [rectangle]
# 2.b. Creating rectangles
cv.rectangle(rook_image,
(0, 7 * W / 8),
(0, 7 * W // 8),
(W, W),
(0, 255, 255),
-1,
@ -101,10 +101,10 @@ cv.rectangle(rook_image,
## [rectangle]
# 2.c. Create a few lines
my_line(rook_image, (0, 15 * W / 16), (W, 15 * W / 16))
my_line(rook_image, (W / 4, 7 * W / 8), (W / 4, W))
my_line(rook_image, (W / 2, 7 * W / 8), (W / 2, W))
my_line(rook_image, (3 * W / 4, 7 * W / 8), (3 * W / 4, W))
my_line(rook_image, (0, 15 * W // 16), (W, 15 * W // 16))
my_line(rook_image, (W // 4, 7 * W // 8), (W // 4, W))
my_line(rook_image, (W // 2, 7 * W // 8), (W // 2, W))
my_line(rook_image, (3 * W // 4, 7 * W // 8), (3 * W // 4, W))
## [draw_rook]
cv.imshow(atom_window, atom_image)
cv.moveWindow(atom_window, 0, 200)

Loading…
Cancel
Save