I have a Mat Dist
(CV_8U
) done by distanceTransform
.
Now I have to check each coordinate of Dist
is > 0
and modify the value of another Mat M = Mat :: zeros
the code is
int main(){
....
for(i=0;i<Dist.rows;++i)
{
for(j=0;j<Dist.cols;++j)
{
if(Dist.at<uchar>(i,j) > 0){
M.at<uchar>(i,j)=2;
}
}
}
....
}
but I error cv :: exception.
I looked in the documentation and elsewhere , I tried to change from uchar to vec3b . I modified the exception in visual studio 2015 but nothing . Where am I wrong?