我想问的是mat的ptr函数只能按行访问数据元素吗
/* .ptr with [] /
for ( int i=0; i
{
uchar *data = image.ptr( i );
for ( int j=0; j<cols; j++ )
{
data[j] = 0;
/
if color one:
data[j*3 + 0] = 0;
data[j*3 + 1] = 0;
data[j*3 + 2] = 0;
*/
}
}
/* .ptr with pointer */
for ( int i=0; i
{
uchar *data = image.ptr( i );
for ( int j=0; j<cols*image; j++ )
{
*data++ = 0;
}
}