1 | initial version |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.cols; i++)
{
*uchar data=counter.ptr(i);
for (int j = 0; j < W.rows; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) counter.data; for(int i=0; i< counter.cols* counter.rows;i++) {
//do something with data[i];
}
2 | No.2 Revision |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.cols; i++)
W.rows; i++) //row first!
{
*uchar data=counter.ptr(i);
for (int j = 0; j < W.rows; W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) counter.data; for(int i=0; i< counter.cols* counter.rows;i++) {
//do something with data[i];
}
3 | No.3 Revision |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.rows; i++) //row first!
{
*uchar data=counter.ptr(i);
data=W.ptr(i);
for (int j = 0; j < W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) counter.data; W.data; for(int i=0; i< counter.cols* counter.rows;i++) W.cols*W.rows;i++) {
//do something with data[i];
}
4 | No.4 Revision |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.rows; i++) //row first!
{
*uchar data=W.ptr(i);
for (int j = 0; j < W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) W.data; W.data;
for(int i=0; i< W.cols*W.rows;i++) {
//do something with data[i];
data[i]; }
5 | No.5 Revision |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.rows; i++) //row first!
{
*uchar data=W.ptr(i);
for (int j = 0; j < W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) W.data;
W.data; 6 | No.6 Revision |
use counter.at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.rows; i++) //row first!
{
*uchar data=W.ptr(i);
for (int j = 0; j < W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) W.data;
for(int i=0; i< W.cols*W.rows;i++)
{
//do something with data[i];
}
7 | No.7 Revision |
use counter.at<uchar>(j,i) .at<uchar>(j,i) would be slowly, try use
(faster) do something scanline-like scan
for (int i = 0; i < W.rows; i++) //row first!
{
*uchar data=W.ptr(i);
for (int j = 0; j < W.cols; j++)
{
//do something with data[j];
}
}
or
(fastest) if your mat is continuous you can treat it as 1-d array
uchar* data = (uchar*) W.data;
for(int i=0; i< W.cols*W.rows;i++)
{
//do something with data[i];
}