Commit 3833d86f authored by SchultzC's avatar SchultzC Committed by Alexander Alekhin

Merge pull request #14733 from SchultzC:3.4

* cast positional arguments to int

* Changed to integer division based

* removed white space

* removed white space
parent 94ec0e9b
...@@ -8,8 +8,8 @@ def my_ellipse(img, angle): ...@@ -8,8 +8,8 @@ def my_ellipse(img, angle):
line_type = 8 line_type = 8
cv.ellipse(img, cv.ellipse(img,
(W / 2, W / 2), (W // 2, W // 2),
(W / 4, W / 16), (W // 4, W // 16),
angle, angle,
0, 0,
360, 360,
...@@ -24,7 +24,7 @@ def my_filled_circle(img, center): ...@@ -24,7 +24,7 @@ def my_filled_circle(img, center):
cv.circle(img, cv.circle(img,
center, center,
W / 32, W // 32,
(0, 0, 255), (0, 0, 255),
thickness, thickness,
line_type) line_type)
...@@ -82,7 +82,7 @@ my_ellipse(atom_image, 45) ...@@ -82,7 +82,7 @@ my_ellipse(atom_image, 45)
my_ellipse(atom_image, -45) my_ellipse(atom_image, -45)
# 1.b. Creating circles # 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_atom]
## [draw_rook] ## [draw_rook]
...@@ -93,7 +93,7 @@ my_polygon(rook_image) ...@@ -93,7 +93,7 @@ my_polygon(rook_image)
## [rectangle] ## [rectangle]
# 2.b. Creating rectangles # 2.b. Creating rectangles
cv.rectangle(rook_image, cv.rectangle(rook_image,
(0, 7 * W / 8), (0, 7 * W // 8),
(W, W), (W, W),
(0, 255, 255), (0, 255, 255),
-1, -1,
...@@ -101,10 +101,10 @@ cv.rectangle(rook_image, ...@@ -101,10 +101,10 @@ cv.rectangle(rook_image,
## [rectangle] ## [rectangle]
# 2.c. Create a few lines # 2.c. Create a few lines
my_line(rook_image, (0, 15 * W / 16), (W, 15 * W / 16)) 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 // 4, 7 * W // 8), (W // 4, W))
my_line(rook_image, (W / 2, 7 * W / 8), (W / 2, 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, (3 * W // 4, 7 * W // 8), (3 * W // 4, W))
## [draw_rook] ## [draw_rook]
cv.imshow(atom_window, atom_image) cv.imshow(atom_window, atom_image)
cv.moveWindow(atom_window, 0, 200) cv.moveWindow(atom_window, 0, 200)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment