回答編集履歴
1
d
test
CHANGED
@@ -106,6 +106,64 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
+
## 補足
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
チャンネルの分割は `cv2.split` を使ったほうがわかりやすいコードになると思います。
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
[画像上の基本的な処理 — OpenCV-Python Tutorials 1 documentation](http://labs.eecs.tottori-u.ac.jp/sd/Member/oyamada/OpenCV/html/py_tutorials/py_core/py_basic_ops/py_basic_ops.html#id5)
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
```python
|
122
|
+
|
123
|
+
import cv2
|
124
|
+
|
125
|
+
import numpy as np
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
a = np.array(
|
130
|
+
|
131
|
+
[
|
132
|
+
|
133
|
+
[[0, 1, 2],
|
134
|
+
|
135
|
+
[0, 1, 2],
|
136
|
+
|
137
|
+
[0, 1, 2]],
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
[[0, 1, 2],
|
142
|
+
|
143
|
+
[0, 1, 2],
|
144
|
+
|
145
|
+
[0, 1, 2]],
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
[[0, 1, 2],
|
150
|
+
|
151
|
+
[0, 1, 2],
|
152
|
+
|
153
|
+
[0, 1, 2]],
|
154
|
+
|
155
|
+
]
|
156
|
+
|
157
|
+
)
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
h, s, v = cv2.split(a)
|
162
|
+
|
163
|
+
```
|
164
|
+
|
165
|
+
|
166
|
+
|
109
167
|
----
|
110
168
|
|
111
169
|
|