J
John Malek
Hi,
I ran a profiler against this complex app that I'm trying to opimize.
This is an application I'm doing to test image processing. Even
though it does a lot of computation, two simple lines take 30% of the
running times! Both these lines are from Intel's OpenCV library.
Note that mhi, mask8u, and mask are arrays with one entry per pixel in
a 640x480 image.
If anyone has any hints on how to optimize this, it would be greatly
appreciated.
Thanks,
John
const int cts = (int&)ts;
for( y = 0; y < mhi->rows; y++ )
{
int* mhi_row = (int*)(mhi->data.ptr + y*mhi->step);
uchar* mask8u_row = mask8u->data.ptr + (y+1)*mask8u->step + 1;
uchar* mask_row = mask->data.ptr + mask->step;
I ran a profiler against this complex app that I'm trying to opimize.
This is an application I'm doing to test image processing. Even
though it does a lot of computation, two simple lines take 30% of the
running times! Both these lines are from Intel's OpenCV library.
Note that mhi, mask8u, and mask are arrays with one entry per pixel in
a 640x480 image.
If anyone has any hints on how to optimize this, it would be greatly
appreciated.
Thanks,
John
const int cts = (int&)ts;
for( y = 0; y < mhi->rows; y++ )
{
int* mhi_row = (int*)(mhi->data.ptr + y*mhi->step);
uchar* mask8u_row = mask8u->data.ptr + (y+1)*mask8u->step + 1;
THE LINE ABOVE TAKES 20% of the timefor( x = 0; x said:if( mhi_row[x] == cts && mask8u_row[x] == 0 )
uchar* mask_row = mask->data.ptr + mask->step;
THE LINE ABOVE TAKES 10% of the timefor( i = 1; i said:mask_row[0] = mask_row[size.width+1] = (uchar)1;