Sample Color

The Sample Color module provides a way to compare a specific image area with known colors to determine which color is most representative of the area. The module performs an averaging over the specified image area and compares this resulting value with color values entered into the Nearest Color list. Successive modules can then access the results of this module via variables to trigger actions based on the results of this module.



1. Current Image - Move the red square to the place you want to sample the colors. You can move the entire square by dragging the smaller red square in the center or by adjusting the individual corner squares. To fine tune the positioning you can change the coordinates of the overall square using the textboxes below in the Coordinates area.

Use CTRL-click to move the entire probe to a different location. Use SHIFT-drag to create the square sample area of a certain size in the clicked position. When zoomed in, drag the image around to view different parts of the image or expand the dialog window to view more of the image.

2. Add Red/Blue/etc - Add the colors to compare to the sample square by clicking on one of the appropriate buttons.

3. Add Custom - Add a custom color to the list

4. Add Current - Add the current intensity to the list

5. Add Variable - Add a variable that contains a color to compare to

6. Del/Del All - Delete a or all the selected colors in the list.

7. Display - Select the color and thickness of the line that will be drawn on the actual image to reflect the sample area.

8. Sample Grid - Specify how the grid sample area is broken into rows and columns. Creating more sample squares will convert the results into an array of values.

9. Coordinates - As apposed to moving the editing squares in the Current Image area you can fine tune the positions by updating the coordinates of each of the editing squares. Note that you can also use the [ variable ] expressions in each of the coordinate boxes to automatically move the sample area to different locations. You can also specify an array to be used as the input to sample locations. This array should contain at least 8 points per area (4x X,Y locations).

10. Use Origin - You can specify that the current coordinates are relative to the Origin Variables created by the Origin Probe Module (or by setting these variables yourself). This allows the specified coordinates to move relative to the detected origin in case what you are sampling is not always in the same absolute image location. When you select this checkbox the current origin values are subtracted from the currently specified coordinates to create a relative position. If you have not yet set the origin, you can come back later and adjust the coordinates as appropriate.




COLOR_SAMPLE - holds the current average intensity in hex format
COLOR_SAMPLE_RGB - holds the current average intensity in rgb integer format
COLOR_SAMPLE_NEAREST - holds the nearest color hex value to the sampled area
COLOR_SAMPLE_NEAREST_RGB - holds the nearest color rgb value to the sampled area
COLOR_SAMPLE_CONFIDENCE - specifies the confidence amount (0-100%) that
the nearest color is the current color.

See Also

Origin Probe

 New Post 

Sample_Color Related Forum PostsLast postPostsViews
Best shape to detect upper-left corner of a table
Need to find X,Y coordinates of upper-left corner of each table in [Temporary 2.jpg]. I use Object_Recognition module -> Shap...
3 years 6 905
Origin and edges
Hi STeven I've been working with the origin module quite a bit, and using those co-o...
4 years 2 923
Bug in sample color module
Hi STeven, There is a bug in the sample color module. Pls see the attached file. The confidence sho...
4 years 3 1050
Openni_Kinect Module
Hello All,              We recently purchased robo re...
6 years 7 2024
comparing the color of two blobs
Hi STeven, I would like to compare the color of two blobs and determine if they are both of a simil...
6 years 8 1390
color value
New to RR (very impressive), so I'm not sure about where or how to post. I have a series of trans...
9 years 13 3047