Generated from libvision.summary with ROBODoc v3.2.2 on Sat Aug 12 17:47:46 2000

TABLE OF CONTENTS

  1. libvision/VIS_Autobrightness_delay
  2. libvision/VIS_Check_init
  3. libvision/VIS_Compute_bw
  4. libvision/VIS_Draw_border
  5. libvision/VIS_Draw_limits
  6. libvision/VIS_Error_display
  7. libvision/VIS_Find_classes
  8. libvision/VIS_Get_distance
  9. libvision/VIS_Init_bwimg
  10. libvision/VIS_Init_calibration
  11. libvision/VIS_Init_cam
  12. libvision/VIS_Init_color_classes
  13. libvision/VIS_Init_distance
  14. libvision/VIS_Init_show_progress
  15. libvision/VIS_Init_var
  16. libvision/VIS_Modify_algo
  17. libvision/VIS_Release_var
  18. libvision/VIS_Show_progress
  19. libvision/VIS_Soccer_test
  20. libvision/VIS_Team_robot
  21. libvision/VIS_cameraCapture
  22. libvision/libvision

libvision/VIS_Autobrightness_delay

SYNOPSIS
   void VIS_Autobrightness_delay(VIS_cameraCapture_t camera, void *cameradata, int number)
DESCRIPTION
   Let time to camera for autobrightness.
   Input  : camera info (VIS_cameraCapture_t and cameradata), number of waits.
   Output : N/A
SEE ALSO
   N/A

libvision/VIS_Check_init

SYNOPSIS
   int VIS_Check_init(VIS_structs *structs)
DESCRIPTION
   Checks if the initialisation of the VIS_structs has been done properly.
   Input  : a libvision struct (VIS_structs).
   Output : an error code >0 if an error occured.
SEE ALSO
   VIS_Init_var(), VIS_Release_var()

libvision/VIS_Compute_bw

SYNOPSIS
   void VIS_Compute_bw(BYTE *bwimg, BYTE *temp, Picture *pic_info)
DESCRIPTION
   Get a 2D binary array and make a linear BW array for LCD display.
   Input  : a BW linear array for LCD display, a 2D binary array, a Picture struct.
   Output : N/A
SEE ALSO
   VIS_Init_bwimg(), VIS_Draw_limits(), VIS_Draw_border()

libvision/VIS_Draw_border

SYNOPSIS
   void VIS_Draw_border(BYTE *bwimg, int rows, int cols)
DESCRIPTION
   Draw borders in a 1D array for LCD display
   Input  : a 1D BW array, line and column of the border.
   Output : N/A
SEE ALSO
   VIS_Init_bwimg(), VIS_compute_bw(), VIS_Draw_limits()

libvision/VIS_Draw_limits

SYNOPSIS
   void VIS_Draw_limits(BYTE *bwimg, VIS_color_region *region, int value)
DESCRIPTION
   Draw object limits and center on bw picture.
   value==0 -> erase, value>0 -> draw.
   Input  : a BW linear array, the region to draw and a draw (i.e. >0) / erase (i.e. ==0) value.
   Output : N/A
SEE ALSO
   VIS_Init_bwimg(), VIS_compute_bw(), VIS_Draw_border()

libvision/VIS_Error_display

SYNOPSIS
   void VIS_Error_display(char title[16], int error, char msg[16])
DESCRIPTION
   Display error messages.
   Input  : a box title (16 char max.), an error code an error message (16 char max.).
   Output : N/A
SEE ALSO
   VIS_Init_show_progress(), VIS_Show_progress()

libvision/VIS_Find_classes

SYNOPSIS
   void VIS_Find_classes(VIS_structs *structs, Picture *pic_info)
DESCRIPTION
   Looks for the ball and the two goals, get their coordinates.
   Input  : a libvision structure (VIS_structs) and a 'Picture' structure.
   Output : returns a pointer to the VIS_color_region part of the VIS_structs structure.
SEE ALSO
   N/A

libvision/VIS_Get_distance

SYNOPSIS
   int VIS_Get_distance(VIS_structs *structs, VIS_distance *distance)
DESCRIPTION
   Returns the distance of the ball by looking into the lookup tables.
   A VIS_distance struct is made of 3 integers : d_row, d_col and dist.
   Where dist is the direct distance between the robot and the ball,
         (d_row,d_col) are the relative coordinates of the ball compared to the robot position,
   So that dist^2=d_row^2+d_col^2.
   d_row is the depth of the ball compared to the robot position,
   d_col is the side distance of the ball compared to the robot.
   Input  : a libvision structure (VIS_structs) and a VIS_distance result structure.
   Output : 0 on success, 1 if distance table is not initialised.
SEE ALSO
   VIS_Init_distance()

libvision/VIS_Init_bwimg

SYNOPSIS
   void VIS_Init_bwimg(Picture *LCD_info)
DESCRIPTION
   BW LCD picture initialisation.
   Input  : 'Picture' structure.
   Output : 0 no errors, -1 LCD_info not set up or declared size <0.
SEE ALSO
   VIS_Compute_bw(), VIS_Draw_limits(), VIS_Draw_border()

libvision/VIS_Init_calibration

SYNOPSIS
   void VIS_Init_calibration(VIS_structs *structs, VIS_cameraCapture_t camera, void *cameradata)
DESCRIPTION
   Calibration menu : color levels calibration or angle offsets calibration.
   Also checks the VIS_structs.
   Input  : a libvision struct (VIS_structs) and camera info (VIS_cameraCapture_t and cameradata).
   Output : returns 0 if VIS_structs is set up properly, >0 if not or if the color lookup table went wrong.
SEE ALSO
   N/A

libvision/VIS_Init_cam

SYNOPSIS
   int VIS_Init_cam(int mode)
DESCRIPTION
   Initialisation of the camera. 10 retries.
   Input  : mode of the camera.
   Output : camversion or INITERROR.
SEE ALSO
   N/A

libvision/VIS_Init_color_classes

SYNOPSIS
   void VIS_Init_color_classes(VIS_structs *structs)
DESCRIPTION
   Checks the VIS_structs and initialise the color look-up table.
   Input  : a libvision structure (VIS_structs).
   Output : returns 0 if VIS_struct is set up properly, >0 if not or if color levels not set up.
SEE ALSO
   VIS_Init_distance()

libvision/VIS_Init_distance

SYNOPSIS
   void VIS_Init_distance(VIS_structs *structs, Picture *pic_info)
DESCRIPTION
   Check the VIS_structs and initialise distances lookup tables.
   Input  : a libvision structure (VIS_structs) and a 'Picture' structure.
   Output : returns 0 if VIS_struct is set up properly, >0 if not or if beta angle not set up.
SEE ALSO
   VIS_Init_color_classes(), VIS_Get_distance()

libvision/VIS_Init_show_progress

SYNOPSIS
   void VIS_Init_show_progress(char title[16])
DESCRIPTION
   Initialise the progress show of a loop (clear screen, display title,...).
   Input  : a loop title (16 char max.).
   Output : N/A
SEE ALSO
   VIS_Error_display(), VIS_Show_progress()

libvision/VIS_Init_var

SYNOPSIS
   VIS_structs *VIS_Init_var(Picture *LCD_info, Picture *pic_info)
DESCRIPTION
   Allocate memory for the different structures used by libvision.
   Allocate dynamic or static memory depending if USE_MALLOC as been defined.
   Input  : a Picture for LCD and a Picture for camera structures.
   Output : NULL or pointer to the initialised structure.
SEE ALSO
   VIS_Release_var(), VIS_Check_init()

libvision/VIS_Modify_algo

SYNOPSIS
   void VIS_Modify_algo(VIS_structs *structs,  VIS_algo *new_algo, Picture *new_pic)
DESCRIPTION
   Modify algorithm values and reallocate processing memory.
   Use realloc() dynamic memory reallocation if USE_MALLOC is defined.
   Also checks VIS_structs.
   Input  : 'VIS_structs' to modify, a new 'VIS_algo' structure and the current 'Picture' parameters.
            'VIS_algo' is 4 integers : depth, fast, step and loop (modified automatically).
            Program is checking error in 'VIS_algo' values, display them and return an error code.
            If an error occurs, no changes are made.
            Program displaying error message and returning error code if a realloc() error occurs.
   Output : an error code : ==0 -> no errors; >0 -> an error occured.
SEE ALSO
   VIS_Init_var(), VIS_Release_var()

libvision/VIS_Release_var

SYNOPSIS
   void VIS_Release_var(VIS_structs *structs)
DESCRIPTION
   Free memory used by malloc or reset some internal values if malloc not used
   (i.e. USE_MALLOC defined or not). 
   Input  : a libvision struct (VIS_structs).
   Output : N/A
SEE ALSO
   VIS_Init_var(), VIS_Check_init()

libvision/VIS_Show_progress

SYNOPSIS
   void VIS_Show_progress(int actual, int max)
DESCRIPTION
   Displays the progress of a loop.
   Input  : the number of the actual loop and the total number of loops.
   Output : N/A
SEE ALSO
   VIS_Error_display(), VIS_Init_show_progress()

libvision/VIS_Soccer_test

SYNOPSIS
   int VIS_Soccer_test(void)
DESCRIPTION
   Exemple program for using the libvision.
   Calibrates, looks at the ball and goals, displays them and displays ball distance.
   Input  : N/A
   Output : 0 if no erros occured, !=0 if not.
SEE ALSO
   N/A

libvision/VIS_Team_robot

SYNOPSIS
   int VIS_Team_robot(void)
DESCRIPTION
   Returns a robot team and ID.
   Input  : N/A
   Output : an integer xy where x is the team and y is the ID.
SEE ALSO
   N/A

libvision/VIS_cameraCapture

SYNOPSIS
   Picture *VIS_cameraCapture(void *capturedata)
DESCRIPTION
   Initialise the Picture structure for the camera at the first call.
   Fetch one image from the camera the following calls.
SEE ALSO
   N/A

libvision/libvision

DESCRIPTION
 The format for error messages is :
 ----------------------------------
     -1 for wrong external structures to the libvision,
      0 for no errors,
     >0 for internal libvision errors.


 To change the algorithm parameters, a "VIS_Algo temp_algo;" is needed :
 -----------------------------------------------------------------------
     typedef struct {
        int depth; depth to denoise
        int fast;  use fast algorithm, only for depth=1
        int step;  process every dots or every two dots only
        int loop;  shift for loops, i.e. loop=step-1, used internally.
     } VIS_algo;


 The classes are defined for the robot soccer program as :
 ---------------------------------------------------------
     #define VIS_NOTHING 0 Object non seen on the picture
     #define VIS_BALL    1 Ball
     #define VIS_YGOAL   2 Yellow goal
     #define VIS_BGOAL   4 Blue goal


 The objects limits and class is returned throuh a pointer to a "VIS_color_region *result;" structure.
 -----------------------------------------------------------------------------------------------------
     typedef struct {
        int       color; Class (i.e. color) of the object
        VIS_coord coord; Rectangular coordinate of the object
     } VIS_color_region;

   Where the coordinate structure is defined as :
     typedef struct {
        int top, bot, right, left; Rectangular coordinate of the object
     } VIS_coord;


 The distance to the ball is returned through a "VIS_distance distance;" structure.
 ----------------------------------------------------------------------------------
     typedef struct {
        int d_row; depth distance
        int d_col; side distance (<0 left and >0 right)
        int dist;  direct distance : dist^2=d_row^2+d_col^2
     } VIS_distance;

 The USE_MALLOC.
 ---------------
     If USE_MALLOC is defined, then the program uses dynamic memory allocation, i.e. malloc(), realloc()
   and free() functions.
     If USE_MALLOC is not defined, then the program uses global variables with maximum memory needs as
   realloc() can not be used.
     Avoids the use of dynamic memory allocation on EyeBot.