Generated from LibVision.c with ROBODoc v3.2.2 on Tue Dec 05 11:08:26 2000

### TABLE OF CONTENTS

1. LibVision/VIS_RGB2Hue
2. LibVision/VIS_RGB2Sat
3. LibVision/VIS_RGB2Int
4. LibVision/VIS_FillHueTable
5. LibVision/VIS_FillRGBSpace
6. LibVision/VIS_FillWhiteClass
7. LibVision/VIS_ReduceNoise
8. LibVision/VIS_ReduceNoisef
9. LibVision/VIS_ReduceNoise2
10. LibVision/VIS_ReduceNoise2f
11. LibVision/VIS_FindLimits
12. LibVision/VIS_FindClass
13. LibVision/VIS_FindClasses
14. LibVision/VIS_MedianHue
15. LibVision/VIS_Init
16. LibVision/VIS_ColClear
17. LibVision/VIS_ColInit
18. LibVision/VIS_ColFindOne
19. LibVision/VIS_ColFind
20. LibVision/VIS_CamCal
21. LibVision/VIS_ModifyCam
22. LibVision/VIS_ModifyAlgo
23. LibVision/VIS_InitDistance
24. LibVision/VIS_GetPosition
25. LibVision/VIS_InitBwimg
26. LibVision/VIS_ComputeBW
27. LibVision/VIS_DrawLimits
28. LibVision/VIS_DrawBorder
29. LibVision/VIS_MarkObject
30. LibVision/VIS_ErrorDisplay
31. LibVision/VIS_InitShowProgress
32. LibVision/VIS_ShowProgress
33. LibVision/VIS_ShowOffset
34. LibVision/VIS_InitCam
35. LibVision/VIS_AutobrightnessDelay
36. LibVision/VIS_TeamRobot

## LibVision/VIS_RGB2Hue

SYNOPSIS

       BYTE VIS_RGB2Hue(BYTE R, BYTE G, BYTE B)

DESCRIPTION

       Converts (R,G,B) triplet into Hue value between 0 and 252.

SEE ALSO

       VIS_RGB2Sat VIS_RGB2Int

     Thomas Braunl, UWA 1998.

## LibVision/VIS_RGB2Sat

SYNOPSIS

       BYTE VIS_RGB2Sat(int R, int G, int B)

DESCRIPTION

       Converts (R,G,B) triplet into Saturation value between 0 and 255.

SEE ALSO

       VIS_RGB2Hue VIS_RGB2Int

## LibVision/VIS_RGB2Int

SYNOPSIS

       BYTE VIS_RGB2Int(int R, int G, int B)

DESCRIPTION

       Converts (R,G,B) triplet into Intensity value between 0 and 255.

SEE ALSO

       VIS_RGB2Hue VIS_RGB2Sat

## LibVision/VIS_FillHueTable

SYNOPSIS

       void VIS_FillHueTable(void)

DESCRIPTION

       Fills the RGB to Hue conversion table for faster conversion. Sets the HueTableOK flag to 1.
       The RGB->Hue conversion table is a global variable.

SEE ALSO

       VIS_FillRGBSpace VIS_FillWhiteClass

## LibVision/VIS_FillRGBSpace

SYNOPSIS

       void VIS_FillRGBSpace(BYTE HueMin, BYTE HueMax, BYTE Saturation,
                             BYTE ColourClass, VIS_RGBSpace *RGBSpace)

DESCRIPTION

       Fills the RGB space cube with a colour class, using a saturation threshold.
       The saturation threshold can be the default defined one (VIS_SAT_THRES).
       'ColourClass' is defined by the user and is the reference to the colour-class.

SEE ALSO

       VIS_ColInit VIS_ColClear VIS_ColFind VIS_FillHueTable VIS_FillWhiteClass

## LibVision/VIS_FillWhiteClass

SYNOPSIS

       void VIS_FillWhiteClass(int SatMin, int SatMax, BYTE IntMin, BYTE IntMax,
                               BYTE ColourClass, VIS_RGBSpace *RGBSpace)

DESCRIPTION

       Fills a white class in the RGB space.
       'SatMin' and 'SatMax' define the saturation range, 'SatMax' may be VIS_SAT_THRES for instance.
       The shade between black and white is defined by the intensity range (IntMin, IntMax).
       'ColourClass' is defined by the user and is the reference to the colour-class.

SEE ALSO

       VIS_ColInit VIS_ColClear VIS_ColFind VIS_FillHueTable

## LibVision/VIS_ReduceNoise

SYNOPSIS

       int VIS_ReduceNoise(VIS_Process *Process, int len)

DESCRIPTION

       Denoise every pixels with a depth of 'len'.

SEE ALSO

       VIS_ReduceNoisef VIS_ReduceNoise2 VIS_ReduceNoise2f

## LibVision/VIS_ReduceNoisef

SYNOPSIS

       int VIS_ReduceNoisef(VIS_Process *Process)

DESCRIPTION

       Denoise 'f' every pixels using the fast loop (i.e. one pixel around).

SEE ALSO

       VIS_ReduceNoise VIS_ReduceNoise2 VIS_ReduceNoise2f

## LibVision/VIS_ReduceNoise2

SYNOPSIS

       int VIS_ReduceNoise2(VIS_Process *Process, int len)

DESCRIPTION

       Denoise '2' i.e. every two pixels.

SEE ALSO

       VIS_ReduceNoise VIS_ReduceNoisef VIS_ReduceNoise2f

## LibVision/VIS_ReduceNoise2f

SYNOPSIS

       int VIS_ReduceNoise2f(VIS_Process *Process)

DESCRIPTION

       Denoise '2f' i.e. every two pixels and fast (i.e. one pixel around).

SEE ALSO

       VIS_ReduceNoise VIS_ReduceNoisef VIS_ReduceNoise2

## LibVision/VIS_FindLimits

SYNOPSIS

       void VIS_FindLimits(int* pTop, int* pBot, int* pRight, int* pLeft, VIS_Object *Object)

DESCRIPTION

       Find the limits of the segmented objects.

SEE ALSO

       VIS_FindLimits VIS_FindClass VIS_FindClasses VIS_ColFindOne VIS_ColFind

## LibVision/VIS_FindClass

SYNOPSIS

       void VIS_FindClass(colimage *Pic, VIS_RGBSpace *RGBSpace, VIS_Object *Object, int ColourClass)

DESCRIPTION

       Build a binary map for a specific colour class.
       Input  : a colimage, the RGBSpace to use, and the ColourClass to look for.
       Output : a VIS_Object structure containing the object informations.

SEE ALSO

       VIS_FindLimits VIS_ColFindOne VIS_ColFind VIS_FindClass VIS_FindClasses

## LibVision/VIS_FindClasses

SYNOPSIS

       void VIS_FindClasses(BYTE number, colimage *Pic, VIS_RGBSpace *RGBSpace, VIS_Process *Process,
                              BYTE *ColourList)

DESCRIPTION

       Build a binary map for several colour classes.
       'Process' and 'ColourClass' are arrays having 'number' elements.

SEE ALSO

       VIS_FindLimits VIS_ColFindOne VIS_ColFind VIS_FindClass

## LibVision/VIS_MedianHue

SYNOPSIS

       VIS_DefineHue VIS_MedianHue(colimage *Pic, int size)

DESCRIPTION

       Finds median hue and the hue range out of the middle part of the picture.
       'size' can not be more than 10.
       Returns a VIS_DefineHue structure containing the median Hue (VIS_DefineHue.Hue) and
     the Hue range (VIS_DefineHue.Range).
       Both structure elements are set to -1 if an error occured.

SEE ALSO

## LibVision/VIS_Init

SYNOPSIS

       void VIS_Init(void)

DESCRIPTION

       Fills the hue conversion table and initialise the algorithm and camera offset defaults.

SEE ALSO

## LibVision/VIS_ColClear

SYNOPSIS

       void VIS_ColClear(VIS_RGBSpace *RGBSpace)

DESCRIPTION

       Clears the RGB space: fills it with the VIS_NONE value.

SEE ALSO

       VIS_ColInit VIS_ColFind

## LibVision/VIS_ColInit

SYNOPSIS

       void VIS_ColInit(VIS_HueTable *HueTable, VIS_RGBSpace *RGBSpace, int ColourClass)

DESCRIPTION

       Initialise a new colour class.

SEE ALSO

       VIS_ColClear VIS_ColFind

## LibVision/VIS_ColFindOne

SYNOPSIS

       void VIS_ColFindOne(colimage *Pic, VIS_RGBSpace *RGBSpace, VIS_Object *Object, BYTE ColourClass)

DESCRIPTION

       Finds the specified colour class.
       Returns the ColourClass found : either ColourClass, either VIS_NONE.

SEE ALSO

       VIS_ColInit VIS_ColClear VIS_ColFind

## LibVision/VIS_ColFind

SYNOPSIS

       int VIS_ColFind(int number, colimage *Pic, VIS_RGBSpace *RGBSpace,
                       VIS_Object *Object, BYTE *ColourList)

DESCRIPTION

       Finds several colour classes pur in a list.
       Returns -1 if 'number' is bigger than the maximum number of classes, 0 for no errors.

SEE ALSO

       VIS_ColInit VIS_ColClear VIS_ColFindOne

## LibVision/VIS_CamCal

SYNOPSIS

       void VIS_CamCal(VIS_RGBSpace *RGBSpace, BYTE ColourClass)

DESCRIPTION

       Camera angle offset

SEE ALSO

## LibVision/VIS_ModifyCam

SYNOPSIS

       void VIS_ModifyCam(VIS_CamOffset *NewCam)

DESCRIPTION

       Modify camera offset values.
       Input  : a new 'VIS_CamOffset' structure.
                'VIS_CamOffset' is 5 values : angle and beta as floats
                                              alpha as BYTE
                                              height and lenght as int
       Output : 0 for no errors, 1 is the NewCam is not valid.

SEE ALSO

       VIS_ModifyAlgo

## LibVision/VIS_ModifyAlgo

SYNOPSIS

       void VIS_ModifyAlgo(VIS_Algo *NewAlgo)

DESCRIPTION

       Modify algorithm values.
       Input  : a new 'VIS_algo' structure.
                '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.
       Output : an error code : ==0 -> no errors; >0 -> an error occured.

SEE ALSO

       VIS_ModifyCam

## LibVision/VIS_InitDistance

SYNOPSIS

       BYTE VIS_InitDistance(void)

DESCRIPTION

       Check the CamInfo and initialise distances lookup tables.
       Output : returns 0 if VIS_struct is set up properly, >0 if not or if beta angle not set up.

SEE ALSO

       VIS_GetPosition()

## LibVision/VIS_GetPosition

SYNOPSIS

       int VIS_GetPosition(VIS_Object *Object, VIS_Distance *ObjDist)

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  : an object structure (VIS_Object) and a VIS_Distance result structure.
       Output : 0 on success, -1 if distance table is not initialised.

SEE ALSO

       VIS_Init_distance()

## LibVision/VIS_InitBwimg

SYNOPSIS

       void VIS_InitBwimg(BYTE *bwimg)

DESCRIPTION

       BW LCD picture initialisation.
       Input  : 'Picture' structure.
       Output : 0 no errors, -1 NULL bwimg pointer.

SEE ALSO

       VIS_ComputeBW VIS_DrawLimits

## LibVision/VIS_ComputeBW

SYNOPSIS

       void VIS_ComputeBW(BYTE *bwimg, BYTE *temp)

DESCRIPTION

       Get a 2D binary array and make a linear BW array for LCD display.
       Input  : a BW linear array for LCD display (bwimg), a 2D binary array (temp).

SEE ALSO

       VIS_InitBwimg VIS_DrawLimits

## LibVision/VIS_DrawLimits

SYNOPSIS

       void VIS_DrawLimits(BYTE *bwimg, VIS_Object *Object, 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_InitBwimg VIS_ComputeBW

## LibVision/VIS_DrawBorder

SYNOPSIS

       void VIS_DrawBorder(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

## LibVision/VIS_MarkObject

SYNOPSIS

       void VIS_MarkObject(image greyimg, int x_middle, int y_middle, int object_size)

DESCRIPTION

       Mark object position by drawing a vertical and horizontal white
       line through it. Ball size is displayed by black lines.
       Birgit Graf, UWA 1998.

## LibVision/VIS_ErrorDisplay

SYNOPSIS

       void VIS_ErrorDisplay(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

## LibVision/VIS_InitShowProgress

SYNOPSIS

       void VIS_InitShowProgress(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

## LibVision/VIS_ShowProgress

SYNOPSIS

       void VIS_ShowProgress(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

## LibVision/VIS_ShowOffset

SYNOPSIS

       void VIS_ShowOffset()

DESCRIPTION

       Displays the actual offset of the camera.
       'alpha' as a BYTE between 0 and 255, 'beta' as a float in degres.

SEE ALSO

## LibVision/VIS_InitCam

SYNOPSIS

       int VIS_InitCam(int mode)

DESCRIPTION

       Initialisation of the camera. 10 retries.
       Input  : mode of the camera.
       Output : camversion or INITERROR.

SEE ALSO

       N/A

## LibVision/VIS_AutobrightnessDelay

SYNOPSIS

       void VIS_AutobrightnessDelay(int number)

DESCRIPTION

       Let time to camera for autobrightness.
       Input  : number of waits.
       Output : N/A

SEE ALSO

       N/A

## LibVision/VIS_TeamRobot

SYNOPSIS

       int VIS_TeamRobot(void)

DESCRIPTION

       Returns a robot team and ID.
       Team is 0 for Eyecam and 1 for Quickam, ID is between 1 and 5.
       Asks for robot ID if not between 1 and 5.
       Input  : N/A
       Output : a two digits integer xy where x is the team and y is the ID.

SEE ALSO

       N/A