回答編集履歴
2
test
CHANGED
@@ -4,3 +4,9 @@
|
|
4
4
|
img_array_mod = img_array.repeat(2,axis=0)
|
5
5
|
```
|
6
6
|
|
7
|
+
画像ならOpenCVで[リサイズ](http://labs.eecs.tottori-u.ac.jp/sd/Member/oyamada/OpenCV/html/py_tutorials/py_imgproc/py_geometric_transformations/py_geometric_transformations.html#id4)もありです。
|
8
|
+
```Python3
|
9
|
+
# 拡大後のピクセル数を指定するのであればNoneの代わりに(256,128)のように指定、
|
10
|
+
# 倍率で指定するにはfxとfyで指定
|
11
|
+
img_array_mod = cv2.resize(img_array,None,fx=1,fy=2)
|
12
|
+
```
|
1
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
matplotlibっぽいですが、たぶん中身のデータはNumpyと思いますので、[ここに紹介](https://blog.shikoan.com/numpy-upsampling-image/)されているように、Numpy側で引き延ばすのもありですね。
|
2
2
|
```Python3
|
3
|
-
# 2は倍数、axis=0は縦
|
3
|
+
# 2は倍数、axis=0は縦、axis=1なら横を指定可能
|
4
4
|
img_array_mod = img_array.repeat(2,axis=0)
|
5
5
|
```
|
6
6
|
|