回答編集履歴
1
追記
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
std::vector<cv::KeyPoint> keypoints;
|
5
5
|
cv::Mat descriptors;
|
6
6
|
|
7
|
-
auto img = cv::imread(
|
7
|
+
const auto img = cv::imread(
|
8
8
|
R"""(C:...\Lenna.png)"""
|
9
9
|
);
|
10
10
|
|
@@ -23,4 +23,15 @@
|
|
23
23
|
|
24
24
|
return 0;
|
25
25
|
}
|
26
|
+
```
|
27
|
+
|
28
|
+
添え字も同時に獲得したいなら、こんな感じ。
|
29
|
+
```C++
|
30
|
+
const auto& size = descriptors.size();
|
31
|
+
for(int y = 0, end_y = size.height; y < end_y; ++y) {
|
32
|
+
for(int x = 0, end_x = size.width; x < end_x; ++x) {
|
33
|
+
std::cout <<
|
34
|
+
static_cast<int>(descriptors.at<unsigned char>(y, x)) << " ";
|
35
|
+
}
|
36
|
+
}
|
26
37
|
```
|