zkai2000
Member level 5
RE :Threshold function
Code:
void Threshold (int **in_image, int x_max, int y_max, int threshold)
{
for(int x=0; x<x_max; x++)
{
for(int y=0; y<y_max; y++)
{
if (in_image[x][y] >= threshold)
in_image[x][y] = 255;
else
in_image[x][y] = 0;
}
}
}
I need a header or something to define the threshold function right?coz C++ itself doesnt understand wat's a threshold i suppose.. :roll:
Do i need pointers to do the static 2D-arrays(**in_image) instead?
Thanks!!
Code:
void Threshold (int **in_image, int x_max, int y_max, int threshold)
{
for(int x=0; x<x_max; x++)
{
for(int y=0; y<y_max; y++)
{
if (in_image[x][y] >= threshold)
in_image[x][y] = 255;
else
in_image[x][y] = 0;
}
}
}
I need a header or something to define the threshold function right?coz C++ itself doesnt understand wat's a threshold i suppose.. :roll:
Do i need pointers to do the static 2D-arrays(**in_image) instead?
Thanks!!