Skip to content
Manos Tsardoulias edited this page Jun 26, 2014 · 21 revisions

Interfaces

  • Input: rgb_node_topics.yaml::/subscribed_topics/rgb_image_topic. Must comply with synchronizer_node_topics::published_topics/rgb_image_topic.
  • Output rgb_node_topics.yaml::/published_topics/candidate_holes_topic. This topic is of type vision_communications::CandidateHolesVectorMsg.msg.

BackProjection functionality

Step one

In pandora_vision/pandora_vision_hole_detector/walls/normal there are images of wooden walls (or generally the surface we want to detect). They all must have the same size (in the current case 500x500). The names must be numbers initiating from 0 and incremented by 1. Also they must be of png type. Normal refers to the natural luminosity.

The folders /plus_XX and /minus_xx refer to the same images but with higher or lower luminosity by XX points in gimp brightness scale.

In order to generate images of lower and higher luminosity, you first need to install a plugin for gimp. In the {hole_detector}/walls directory, there exists a .scm file. Otherwise, visit http://registry.gimp.org/node/23499 and download it. Place it into your ~/.gimp-2.6/scripts directory.

Create all the necessary /plus_XX and /minus_XX directories and place the images within the normal directory in them.

Step two

Fire up gimp and go to File -> Create -> Misc -> Batch Color Balance and Contrast. A window will open, where you will need to make some changes:

1: Folder: Select the /plus_XX or /minus_XX directory, whose images you want to change to +XX or -XX in luminosity.

2: File type: png

3: Untick the Keep original files and save new files with prefix '' box

4: Untick the Preserve luminosity values at each pixel box

5: Tick Make changes to Brightness and Constrast box

6: Adjust the Brightness value to +XX or -XX.

Repeat the above operation for all the desired plus_XX and minus_XX directories. Now, in the walls directory there should be a bunch of {plus, minus}_XX directories, the normal directory, the .scm file, and the make.sh script.

Open the make.sh script and declare the names of the {plus, minus}_XX directories in the other_paths array as shown inside the script.

Run the script by executing bash make.sh.

The final result in the walls directory should be what was before, plus that many images as the number of images in the normal directory, times the number of {plus, minus}_XX directories. Their names should be starting from 0 and increasing by one, all in a .png format.

Example:

Say there are 10 images inside the normal directory, and we want to tweak the brightness to +100 and -50, without losing the original images. Create plus_100 and minus_50 directories and place the 10 images of the normal directory in them. Run the gimp script for each of the two directories. Now, there should be 10 images at each of the plus_100 and minus_50 directories, their names starting from 0 to 9, in .png format.

The make.sh script should have the four lines:

base_path=$PWD
normal_path="/normal"
other_paths[0]="/plus_100"
other_paths[1]="/minus_50"

By running the make.sh script, you should see 30 images inside the walls directory, starting from 0 and going up to 29.

###TODO

Investigate the possibility of automatic gimp execution by:

gimp -i -b '(batch-color-contrast "/home/manos/Desktop/pandora/src/pandora_vision/pandora_vision_hole_detector/walls2/normal/" "png" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 100 0)' -b '(gimp-quit 0)' --verbose