Do I need a header to define the threshold function?

Status
Not open for further replies.

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
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!!
 

Re: RE :Threshold function

Hi,
You may define the image array to be one dimensional and then access using offset. All arrays are one dimensional. The interpretation just changes for 2D arrays.
I hope this helps.
B R M
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…