Page 243 - Introduction to AI Robotics
P. 243

226
                                                                  6 Common Sensing Techniques for Reactive Robots
                                     to transform RGB data to a color space that more closely duplicates the re-
                                     sponse of the human eye. It is used in biomedical imaging, but has not been
                                     widely considered for robotics. The shape of the color space is triangular,
                                     as shown in Fig. 6.14. Initial results indicate it is much more insensitive to
                                     changes in lighting. 74  Fig. 6.15 shows an image and the results of segmenting
                                     a color in RGB, HSI, and SCT spaces.

                              6.6.3  Region segmentation

                                     The most ubiquitous use of computer vision in reactive robotics is to identify
                             REGION  a region in the image with a particular color, a process called region segmen-
                       SEGMENTATION  tation. Region segmentation and color affordances are a staple perceptual
                                     algorithm for successful entries to many different international robot com-
                                     petitions, including the AAAI Mobile Robot Competition, RoboCup, and
                                     MIROSOT. There are many color region segmentation algorithms available
                                     and Newton Labs sells a Cognachrome board dedicated to the rapid extrac-
                                     tion of colored regions. The basic concept is to identify all the pixels in an
                                     image which are part of the region and then navigate to the region’s center
                                     (centroid). The first step is to threshold all pixels which share the same color
                                     (thresholding), then group those together and throw out any pixels which
                                     don’t seem to be in the same area as the majority of the pixels (region grow-
                                     ing).
                                       Ch. 5 described a robot which used red to signify a red Coca-Cola can for
                                     recycling. Ideally, the robot during the searching for the can behavior would
                        BINARY IMAGE  see the world as a binary image (having only 2 values) consisting of red,
                       THRESHOLDING  not-red. This partitioning of the world can be achieved by thresholding the
                                     image and creating a binary image. A C/C++ code example is shown below:


                                     for (i= = 0; i < numberRows; i++)
                                       for (j= = 0; j < numberColumns; j++) {
                                         if ((ImageIn[i][j][RED] == redValue)
                                             && (ImageIn[i][j][GREEN] == greenValue)
                                             && (ImageIn[i][I][BLUE] == blueValue)) {
                                                   ImageOut[i][j] = 255;
                                         }
                                         else {
                                            ImageOut[i][j] = 0;
                                         }
                                     }
   238   239   240   241   242   243   244   245   246   247   248