質問編集履歴
1
不必要部分の削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,43 +26,11 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
def add_circle(im):
|
30
|
-
|
31
|
-
y0_min=480-150 #960/2±150
|
32
|
-
|
33
|
-
y0_max=480+150
|
34
|
-
|
35
|
-
x0_min=640-300 #1280/2±300
|
36
|
-
|
37
|
-
x0_max=640+300
|
38
29
|
|
39
30
|
|
40
|
-
|
41
|
-
r_m
|
31
|
+
X_pre = create_im()
|
42
|
-
|
43
|
-
r_min=400/2 #最小半径
|
44
32
|
|
45
33
|
|
46
|
-
|
47
|
-
#円の中心および半径をランダムに決定
|
48
|
-
|
49
|
-
x0=random.randint(x0_min, x0_max)
|
50
|
-
|
51
|
-
y0=random.randint(y0_min, y0_max)
|
52
|
-
|
53
|
-
radius=random.randint(r_min, r_max)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
#円の描写
|
58
|
-
|
59
|
-
cv2.circle(im, (x0, y0), radius, color=(255,0,0), thickness=-1)
|
60
|
-
|
61
|
-
return im, radius
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
X_pre, y=add_circle(create_im())
|
66
34
|
|
67
35
|
print(X_pre.shape)
|
68
36
|
|