Aug 24, 2004 #1 Z 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 :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!!
Aug 31, 2004 #2 B brmadhukar Advanced Member level 3 Joined Jun 21, 2002 Messages 839 Helped 42 Reputation 84 Reaction score 11 Trophy points 1,298 Location India Activity points 6,783 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
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