bibhukalyan
Newbie level 6
Hi everyone,
I am trying to use convolution function on embedded system.
In my pc i tried like :
Here my input image is 240x272 (width X Height) and my filter size is 3 x 3.
I tried the same code in embedded system (arm 9).Here it is taking around 350 ms.
I want to reduce the execution time.
Can any one tell me how i will reduce the time ?
with regards
bibhu.
I am trying to use convolution function on embedded system.
In my pc i tried like :
Code:
int i,j,m,n,m1,n1;
int halfH = filter_height >> 1;
int halfW = filter_width >> 1;
for(i = 0; i < height; i++)
{
for(j = 0; j < width; j++)
{
Output[i][j] = 0;
for(m = -halfH,m1 = filter_height-1; m1 >= 0; m++,m1--)
{
if(i + m < 0 || i + m >= height)
continue;
for(n = -halfW,n1 = filter_width-1; n1 >= 0; n++,n1--)
{
if(j + n < 0 || j + n >= height)
continue;
Output[i][j] += input[i+m][j+n] * filter[m1][n1];
}
}
}
}
Here my input image is 240x272 (width X Height) and my filter size is 3 x 3.
I tried the same code in embedded system (arm 9).Here it is taking around 350 ms.
I want to reduce the execution time.
Can any one tell me how i will reduce the time ?
with regards
bibhu.