for (int row = 0; row < result.rows; row++) {
uchar* pointer_row = result.ptr<uchar>(row);
for (col = 0; col < result.cols; col++) {
uchar b = pointer_row[col * 3 + 0];
uchar g = pointer_row[col * 3 + 1];
uchar r = pointer_row[col * 3 + 2];
}
The above code reads the cols of the image from 0 (left),
for (col =2588; col > result.cols; col--) {
uchar b = pointer_row[col * 3 + 0];
uchar g = pointer_row[col * 3 + 1];
uchar r = pointer_row[col * 3 + 2];
}
I want to code like above. I know the code above is wrong. I'm sure you know how it feels. I can only explain it like this because I'm a total beginner Help!
c++ opencv
So you want to reverse the for tour? If so…
for (col = result.cols; col >= 0; col--) {
// Omitted
}
© 2024 OneMinuteCode. All rights reserved.