1 | initial version |
again, there should not be any cv::Point
's here at all, and your Operator should look like:
struct Operator {
void operator ()(uchar &pixel, const int * position) const
{
cout << format("[%d,%d]= %d \n",position[0],position[1], pixel);
}
};
(also, those typedefs are more misleading than helpful, you're safe to skip them and use explicit types there)
2 | No.2 Revision |
again, there should not be any cv::Point
's here at all, and your Operator should look like:
struct Operator {
void operator ()(uchar &pixel, const int * position) const
{
cout << format("[%d,%d]= %d \n",position[0],position[1], pixel);
}
};
or, for a 3 channel bgr image:
struct Operator {
void operator ()(Vec3b &pixel, const int * position) const
{
cout << format("[%d,%d]= (%d %d %d)\n",position[0],position[1], pixel[0], pixel[1], pixel[2]);
}
};
(also, those typedefs are more misleading than helpful, you're safe to skip them and use explicit types there)