Hi All,
When I try to compile the code below, I get error message " error: ‘MAX_IMG_HEIGHT’ undeclared here (not in a function)". I tried to declare them in different ways but it does not work. Does anyone have idea ?
I appreciate for helps,

The code is:

/* ImagExper.h 

   - miscellaneous structure header file for ImagExpert software package   */



/* image processing range deifnition */



#define top_left_x 20

#define top_left_y 280

#define bottom_right_x 460

#define bottom_right_y 500



/* edge element gradient magnititue and direction */


//extern const int MAX_IMG_HEIGHT;
//extern const int MAX_IMG_WIDTH;

unsigned char img_edg_mag[MAX_IMG_HEIGHT][MAX_IMG_WIDTH];

unsigned char img_edg_dir[MAX_IMG_HEIGHT][MAX_IMG_WIDTH];



/* External variables for hough transfer function */



/*#define PI 3.1415926*/



struct edge {                            /* edge struct pointer */

          int xcord;  int ycord;

          unsigned char edgv;            /* grey level or gradient */

          int edsi;                      /* 360 degree */

          };



struct peak_point{                       /* hough space peak point */

          int sita;

          int rota;

          int ctva;

          };





/* Functions for Hough transfer */



void edsobl(int k, unsigned char* pie0,int ixsa,int iysa,int ixea,int iyea,

            int ity,int thres_gr);

void thingr(int k,unsigned char *pie0,int ixsa,int iysa,int ixea,int iyea,

            long int *nu_edge);

void edggen(int k,unsigned char *pie0,int ixsa,int iysa,int ixea,int iyea,

       struct edge *pedge0);

void edhou1(int k,struct edge *pedge0,long int nu_edge,

       int ixsa,int iysa,int ixea,int iyea,int *ixs_next,int *iys_next);



void hlndsp(int k, float deta_ro,float deta_si,float roc,int ix,int iy,

            float x0,float y0,int ixsa,int iysa,int ixea,int iyea,

            struct peak_point *peakpt0,long int nu_peakpt,

            int *ixs_next,int *iys_next);



void pkptds(int *ht0,int ia,int ir,struct peak_point *peakpt0,

            long int *nu_peakpt);

void pkptdp(int *ht0,int ia,int ir,struct peak_point *peakpt0,

            long int *nu_peakpt);





/* Function definition */



void GSRoadSection(int ixs,int iys,float alfa,int lsgn,int length,int width,

                   unsigned char *imask, int k);

Recommended Answers

All 2 Replies

Hi All,
When I try to compile the code below, I get error message " error: ‘MAX_IMG_HEIGHT’ undeclared here (not in a function)".

Where is MAX_IMG_HEIGHT defined? What's its value?

If those variables are truly defined externally, you should really uncomment line 24 & 25. Declaring an extern variable isn't helpful if the declaration is in a comment.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.