回答編集履歴
1
追記
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
auto img = cv::imread(
|
13
|
+
const auto img = cv::imread(
|
14
14
|
|
15
15
|
R"""(C:...\Lenna.png)"""
|
16
16
|
|
@@ -49,3 +49,25 @@
|
|
49
49
|
}
|
50
50
|
|
51
51
|
```
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
添え字も同時に獲得したいなら、こんな感じ。
|
56
|
+
|
57
|
+
```C++
|
58
|
+
|
59
|
+
const auto& size = descriptors.size();
|
60
|
+
|
61
|
+
for(int y = 0, end_y = size.height; y < end_y; ++y) {
|
62
|
+
|
63
|
+
for(int x = 0, end_x = size.width; x < end_x; ++x) {
|
64
|
+
|
65
|
+
std::cout <<
|
66
|
+
|
67
|
+
static_cast<int>(descriptors.at<unsigned char>(y, x)) << " ";
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
```
|