Skip to content

MaskHsv

markmaker edited this page Mar 6, 2022 · 1 revision

Soft MaskHsv

MaskHsv is prominently used for removing the background "green" nozzle tip in bottom vision, see the Nozzle Tip Background Calibration.


TODO: describe the basic operation and properties. The following just documents the new properties.


Because of the probabilistic nature of some stages, like the DetectRectlinearSymmetry stage, we need to generate a "natural" image. However, background removal using MaskHsv is usually "hard", i.e. it sets all the pixels to deep black, which then makes these different from the rest of the not-so-black background. Furthermore, the Mask is also hard on the edges, i.e. it either masks a pixel, or not. Amplified by some properties of typical MJPEG color encoding, and compression, this may result in a jagged image and block artifacts:

Hard Mask

To address this, the MaskHsv stage has therefore been extended with two new properties:

softEdge adds a soft edge around the boundaries of the HSV model mask. Pixels can now be somewhere in between being masked and not. This naturally maps to focal blur and other effects where the key color to be masked is mixed with others.

hsv-soft-edge

softFactor determines, how strongly the mask should be applied. At 1.0 fully masked pixels will become all black (default). At 0.5, only half the brightness is taken out.

Soft Mask

Clone this wiki locally