I’m new to the c++ interface and running out of ideas about this code:
//buffer : VideoCapture >> cvtColor >> Canny
for(int i=0;i<buffer.rows;i++) //search for edges
{
for (int j=0 ;j<buffer.cols;j++)
{
Vec3b pixel=buffer.at<Vec3b>(i,j);
}
}
runs fine in debug mode but crashing at some point (i=479, j=448) in release.(oh and can’t catch any exception… of course…)
but
Vec3b pixel=buffer.at<Vec3b>(1,1000);
works in elease even if my image(buffer) is 640*480.
I think i am missing something. I’d be thankfull to you guys if you can get some sense out of this.
You are using a
Vec3biterator which is supposed to be used on 3 channel images. You are using a single channel image, to iterate such an image you have to replaceVec3bwithuchar.