loading

Blob Colorize

The Blob Colorize module provides a way to recolorize blobs (segmented objects) based on another image (normally the source pixel data). This is required when you have processed an image into separated blobs but need to recombine the blobs with their original color information that was lost during processing.

The Blob Colorize will use a source pixel image and replace each non-black object with the various colors drawn from the source image. This is functionally similar to using the blobs as masks into the source pixel image and summing the resulting pixels to form the new color.

Interface

Instructions

1. Source - Select which image represents the source pre-processed RGB pixel image of the current image.

2. Color - Select which color statistic to gather based on the source image that will be the new color of the respective blob. When 'nearest' is selected the bottom part of the GUI interface will be enabled.

mean - Determines the mean color of the Source image masked with the current image and replaces the current blob with that color. This colors the current blob with its average color in the Source image.
min/max intensity - Determines the minimum or maximum pixel intensity of the Source image masked with the current image and replaces the current blob with that color. This colors the current blob with its min/max intensity as seen in the Source image.
min/max color - Determines the minimum or maximum pixel color of the Source image masked with the current image and replaces the current blob with that color. This colors the current blob with its min/max color as seen in the Source image.
nearest - Determines the mean color of the Source image masked with the current image and replaces the current blob with the color closest to that mean. This colors the current blob with one of the colors as specified in the Nearest Colors list.
summation - Replaces the current blob with the added intensity values based on the Source image. This enables the Weight field that is used to determine how the final intensity value is adjusted. When the weight is set to 0.25 the pixels that belong to a blob are added as specified in the Source image multiplied by the weight. This means a blob with 4 pixels of 255 intensity will result in a 255 white blob. This allows smaller dimmer blobs to be eliminated (via a threshold) but smaller bright blobs to remain.

3. Label - specify the name of the color (as will be used in the variable array) such that you can easily identify a color based on a name as apposed to an RGB triplet.

4. Add X - add in colors as needed in order to create a list of colors that will be matched against. For each detected blob in the image the color those most closely matches that blobs color will become that blobs color. This allows an almost white or almost red blob to become pure white or pure red assuming that you have both white and red as "Nearest Colors".

5. Match Threshold - specify how closely a color should match one of the "Nearest Colors" to be replaced with that color.

6. Summary Weight - enabled when Summation is selected. A weighting factor that is multiplied on each pixel prior to the final intensity being capped.

Example

SourceBlob Colorize

The above demonstrates the blob colorizing routine after thresholding the image for high intensity, dilating by 2 and then using the blob colorizing module to recolor the resulting white blobs.

This technique is very handy for laser light detection. The issue with laser lights is that while we see them as red (or green) but the camera sees them as white light surrounded by a red halo due to the color range limitation of CCDs. In order to detect "red" spots we need to first detect likely laser spots, expand the blob and then test for color. The following shows two laser lights from the SRV-1 robot and the final step of the detected two laser lights with the X coordinate of the blobs (this can be used for distance sensing). Download the robofile that accomplishes this.

SourceLaser Detected

Variables


BLOB_COLORIZE_LABELS - contains an array of matched color information for each blob.

The array contains blocks of 6 values per colorized blob. The elements
are as follows:

Offset   Contents
0       x coordinate of the center of gravity of the blob
1       y coordinate of the center of gravity of the blob
2       hex formatted color information or label (when nearest color used)
3       Red color value
4       Blue color value
5       Green color value

For example, to look for red colored blobs you could now use

labels = GetArrayVariable("BLOB_COLORIZE_LABELS")
for i = 0 to ubound(labels)-1 step 6
  if labels(i+3) = "255" and labels(i+4) = "0" and labels(i+5) = "0" then
    write "Found a red blob" & vbCRLF
  end if
next

See Also


Colorize


 New Post 

Blob_Colorize Related Forum PostsLast postPostsViews
Track 5 Bots
I’d like to start a thread here to get some assistance on using RoboRealm for a specific project. Here is what I’m trying to...
7 months 2 192
Bug Blob_Colorize
Hello, I have a problem with the Blob_Colorize module. Every time when I start RoboRe...
1 year 7 512
Bug
Hello, I have a problem with the Blob_Colorize module. Every time when I start RoboRe...
1 year 1 277
document processing
I have a document and need to read out the corssed rectangles. How can i do that?...
3 years 4 814
blob detection
hi, i want to play game on samsung tab using roborealm. for that i need to detect the given game-blocks from camera. attached ar...
3 years 2 965
Blob reduction
Hi STeven In the image I attached, each blob is represented by at least 3 shades of grey (meaning t...
4 years 3 871
help!!!!!
work with 3 different colors with variables...
4 years 5 1066
action_shot_scantron
Its a bit complicated, it involves analysing an image and finding out where there are some marks. I need to automatically open t...
4 years 2 1093
Measuring Depth
Hi, I'm currently working with roborealm to measure some objects in a picture. I want to measure t...
6 years 7 2833