Auball

From Rsewiki
Revision as of 14:52, 11 February 2020 by Jca (Talk | contribs)

Jump to: navigation, search

Back to AU Robot Servers


Contents

Ball finder plugin

A plugin intended for finding coloured balls in a camera image. This example is an image from a Kinect camera, looking at my desk.

Ball 5271 18.png

Figure 18. There is 2 or 3 coloured objects, 2 red in the front and a darker blue in the back.

convert to HSV

The same image in HSV format

Ball 5271 45 HSV.png

Figure 45. A high hue value shown as blue, a high saturation in green (e.g. the dark red in the front and the blue lit in the back), the intensity (value) is shown in red (ex. the cup in the front). White objects have a hue of 0, the hue of dark objects is unreliable.

Crop

The image is cropped to the interesting Range Of Interest, here the top 100 rows are removed.

Split into planes

The individual planes shown as grayscale images.

Ball 5271 46 hue.png

Figure 46. Hue, 0 is yellow (dark like the table, green is about 50 (rather dark), blue is about 115 (brighter), red is about 170 (bright). Maximum is 179, then it is back to 0.

Ball 5271 47 sat.png

Figure 47. Saturation, the brighter the more saturated the colour.

Ball 5271 48 val.png

Figure 48. Intensity, this is a grayscale version of the original image.

Parameters

In the demo code there is a - rather high - number of parameters, these are

  poolImg=28                 (r/w) image pool number to use as source
  poolDebugImg=45            (r/w) first image pool number to use for interim images
  redHue=175                 (r/w) hue value (in HSV formet) for red ball range [0-180]
                             (~120=red)
  redCnt=2                   (r) Number of red balls found in last image
  blueHue=112                (r/w) hue value (in HSV formet) for blue ball range
                             [0-180] (~0=blue) 
  blueCnt=1                  (r) Number of blue balls found in last image
  BallSize=0.12              (r/w) Size of the ball (diameter [m])
  topLine=100                (r/w) is the topmost line that could be a ball on the
                             floor.
  size=14 80                 (r/w) size limits of ball in pixels [min max]
  hough=700 70 5             (r/w) params for Hough (canny high [0-1000], hough vote
                             [0..255], Hough resolution 1(fine)..8(rough))
  colLim=13 13               (rw) Color limit (+/-) for circle center hue match [red
                             blue] [0..180]
  mrc=1                      (rw) Should result be send to MRC (smrcl)
  debug=1                    (rw) make more debug images and printout
  filter=1 5                 (rw) smooth image before detect [filter 0-1, size NxN]
  opening=2                  (rw) Opening before Hough circles
  limitSat=70                (rw) do not use pixels with saturation lower than this
                             (0..255)
  limitVal=70                (rw) do not use pixels with a lower V-value (intensity)
                             lower than this (0..255)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox