Dialog

<< Click to Display Table of Contents >>

Navigation:  Function block library > Image processing > Color range finder >

Dialog

Previous pageReturn to chapter overviewNext page

colorrangefinder_dialog

If "Show result" is not set the input image is shown (1). Within the input image you can mark an area by clicking and dragging with the mouse. After selecting an area the maximum and minimum value of all pixels within the area is calculated per channel. The calculation is done within the HSV color space. The minimal and maximal values are shown at (2). (3) displays the current color range. An image is shown for the minimal, middle and maxiamlen value. Each image shows all colors in the hue an saturation range.

By changing the values at (2) the color range and its visualization in (3) changes.

copy16 Copy the current values to the clipboard. From the clipboard the values can be copied to a global variable of type "floatvector".

paste16 Overwrite the current values with values from the clipboard.

If "Show result" is set the generated greyscale image is shown (1) .

colorrangefinder_dialog2

The more compact the white areas the better is the fitting of the color range and the live image. To make the color detection robust against varied illumination the value range can be extended. If there are shiny objects you may extend the saturation range. A change of hue is rare so that in most cases this range is not manually modified.


Within the HSV color space hue is given as angle from 0° to 360°. A hue value of 361 is the same as a hue value of 1. There is a problem if a color range is chosen that exceeds the 0° boundary.

colorrangefinder_dialog_wrap

The above image shows a color range with hue ranging from violet to yellow. Violet is hue 300 and yellow hue 60. If we would simply look for the minimal and maximal hue value we would get a range of hue values ranging from [60;300]. In this range we have colors green and blue.

The solution to this problem is to look at the distance between the hue range limits. In this example the distance is 300-60=240. If the distance is greater 180 we assume that the hue range exceeds the 0° boundary. This is shown by swapping the hue Min and Max value so that Max<Min. If this case the hue range goes from Min-359 and from 0-Max.