From 3833d86f0f5928246075b2543a480d929c8a5040 Mon Sep 17 00:00:00 2001 From: SchultzC Date: Thu, 6 Jun 2019 03:02:45 -0700 Subject: [PATCH] Merge pull request #14733 from SchultzC:3.4 * cast positional arguments to int * Changed to integer division based * removed white space * removed white space --- .../basic_geometric_drawing.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py b/samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py index ec25d64a45..f80c2f108c 100644 --- a/samples/python/tutorial_code/imgProc/BasicGeometricDrawing/basic_geometric_drawing.py +++ b/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)