1 | initial version |
Yes it is possible. I've used it on a CV_32F to iterate through pixel values along a line.
You don't access pixels with lineIterator. LineIterator will let you know the current position within the line. Then you use that position to access the Mat in order to retrieve the data. If it is not a intensive process, you can use the Mat::at<float>(lineIterator.pos())
to make it simple. If you are accessing tens of thousands of pixels in a cycle I suggest you find other way to access the Mat pixels, since the Mat::at method is not the fastest way, but those are separate issues.
Cheers.
2 | No.2 Revision |
Yes it is possible. I've used it on a CV_32F to iterate through pixel values along a line.
You don't access pixels with lineIterator. LineIterator will let you know the current position within the line. Then you use that position to access the Mat in order to retrieve the data. If it is not a intensive process, you can use the
to make it simple. If you are accessing tens of thousands of pixels in a cycle I suggest you find other way to access the Mat pixels, since the Mat::at method is not the fastest way, but those are separate issues.Mat::at<float>(lineIterator.pos())Mat::at<cv::Vec2f>(lineIterator.pos())
Cheers.