質問編集履歴
1
不必要部分の削除
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -12,24 +12,8 @@
|
|
|
12
12
|
im = np.zeros((height, width,3), dtype=np.uint8)
|
|
13
13
|
return im
|
|
14
14
|
|
|
15
|
-
def add_circle(im):
|
|
16
|
-
y0_min=480-150 #960/2±150
|
|
17
|
-
y0_max=480+150
|
|
18
|
-
x0_min=640-300 #1280/2±300
|
|
19
|
-
x0_max=640+300
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
X_pre = create_im()
|
|
22
|
-
r_min=400/2 #最小半径
|
|
23
17
|
|
|
24
|
-
#円の中心および半径をランダムに決定
|
|
25
|
-
x0=random.randint(x0_min, x0_max)
|
|
26
|
-
y0=random.randint(y0_min, y0_max)
|
|
27
|
-
radius=random.randint(r_min, r_max)
|
|
28
|
-
|
|
29
|
-
#円の描写
|
|
30
|
-
cv2.circle(im, (x0, y0), radius, color=(255,0,0), thickness=-1)
|
|
31
|
-
return im, radius
|
|
32
|
-
|
|
33
|
-
X_pre, y=add_circle(create_im())
|
|
34
18
|
print(X_pre.shape)
|
|
35
19
|
```
|