Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top