https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a7ce1d8cc9a83ae7cab79766d0eb6c0a8
Mat mat = (Mat_<int>{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}).reshape(2, 3);
const Vec<int,2> vi2{1,1};
mat.ptr(vi2);
error: mat.ptr<2>(Vec2i) undefined ,the source code just exactly decalre,but undefined .
Any help is appreciated.
berak
2
opencv version and exact error msg, please
(apart from that, yes, i can repeat it on master(4.5.2-pre))
opencv 4.5.1 ,how to use Mat::ptr’s 9th and 10th overload OpenCV: cv::Mat Class Reference
any samples may help me .
berak
4
there are no samples, you found a bug. (it’s not implemented)
(same problem for 19 20)
we’ll fix this later, for now you can put the missing implementation into your own code, like:
template<int n> uchar* Mat::ptr(const Vec<int, n>& idx) {
return Mat::ptr(idx.val);
}
template<int n> const uchar* Mat::ptr(const Vec<int, n>& idx) const {
return Mat::ptr(idx.val);
}
template<typename _Tp, int n> _Tp* Mat::ptr(const Vec<int, n>& idx) {
return Mat::ptr<_Tp>(idx.val);
}
template<typename _Tp, int n> const _Tp* Mat::ptr(const Vec<int, n>& idx) const {
return Mat::ptr<_Tp>(idx.val);
}