Auball
(→Parameters) |
(→Ball finder plugin) |
||
Line 5: | Line 5: | ||
A plugin intended for finding coloured balls in a camera image. | A plugin intended for finding coloured balls in a camera image. | ||
+ | This example is an image from a Kinect camera, looking at my desk. | ||
[[File:ball_5271_18.png]] | [[File:ball_5271_18.png]] | ||
− | Figure. There is 2 or 3 coloured objects, 2 red in the front and a darker blue in the back. | + | Figure 18. There is 2 or 3 coloured objects, 2 red in the front and a darker blue in the back. |
=== convert to HSV === | === convert to HSV === | ||
Line 16: | Line 17: | ||
[[File:ball_5271_45_HSV.png]] | [[File:ball_5271_45_HSV.png]] | ||
− | Figure. 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. | + | 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 === | === Crop === | ||
Line 28: | Line 29: | ||
[[File:ball_5271_46_hue.png]] | [[File:ball_5271_46_hue.png]] | ||
− | Figure. 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. | + | 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. |
[[File:ball_5271_47_sat.png]] | [[File:ball_5271_47_sat.png]] | ||
− | Figure. Saturation, the brighter the more saturated the colour. | + | Figure 47. Saturation, the brighter the more saturated the colour. |
− | [[File: | + | [[File:ball_5271_48_val.png]] |
− | Figure. Intensity, this is a grayscale version of the original image. | + | Figure 48. Intensity, this is a grayscale version of the original image. |
== Parameters == | == Parameters == |
Revision as of 14:52, 11 February 2020
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.
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
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.
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.
Figure 47. Saturation, the brighter the more saturated the colour.
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)