1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
- Name and brief description of the program:

paraws is an algorithm to compute the watershed lines in a disorderly fashion.
This new approach allows for easy parallelisation and as it does not require
sorting the pixels elevations. The watershed transform can be performed on more
complex types such as floats.




- Version number and release date:

This program has no versioning numbers but its current version has been
released in 26 May 2020.




- Reference to the article:

Not yet published




- Authors and licence:

This program is written by Theodore Chabardes
<theodore.chabardes@mines-paristech.fr> with contributions from Pierre Guillou
<pierre.guillou@mines-paristech.fr> and distributed under the terms of the
GPLv3 license.




- Location of future releases and updates :

Not known yet.




- Copyright, patent and licence information :

See GPLv3.txt




- Tools and libraries needed to compile and use the program

This program has been successfully built with gcc 8.3.0 and clang 4.0.1.
It depends on libpng (http://www.libpng.org/pub/png/libpng.html) and has been
successfully built with libpng 1.6.30.




- Compilation instructions:

Use make or meson/ninja.




- Usage intructions and example:

One executable is produced: paraws. The directory 'examples' contains several
images used to test the executions of the algorithm.

./paraws [options]
Options:
-A | --paraws_bench           Benchs paraws
-B | --hqws_bench             Benchs hqws
-h | --help                   Print this help
-i | --input_uint8            Path to uint8 input image
-I | --input_uint16           Path to uint16 input image
-m | --marker_uint8           Path to uint8 marker image
-M | --marker_uint16          Path to uint16 marker image
-N | --marker_uint32          Path to uint32 marker image
-o | --output_uint8           Path to uint8 output image
-O | --output_uint16          Path to uint16 output image
-P | --output_uint32          Path to uint32 output image
-C | --cross                  4-connex structuring element
-S | --square                 8-connex structuring element
-R | --cross3d                6-connex structuring element (3d)
-U | --cube                   26-connex structuring element (3d)
-x | --size_x                 Width dimension (only for raw images)
-y | --size_y                 Height dimension (only for raw images)
-z | --size_z                 Depth dimension (only for raw images)
-w | --without_labels_limit   Ignore errors due to label number overflow
-g | --export_RGB             Export the output image in RGB format.

This program needs at least one input image, one output image and a structuring element. Only png and raw format are supported, and it should be identical for the input and the ouput. If raw format is used, dimensions must be specified. An additional markers image can be used for constrained watershed, whose type should match the output image..

Examples of execution:

paraws -i examples/dots.png -o examples/dots_out.png -C

paraws -i examples/grains.png -o examples/grains_out.png -S

paraws -i examples/lenna.png -O examples/lenna_out.png -C --export_RGB




- Changes in the software since it was first published:

This version is the sixth publication of this code.

Changes include in second publication:
    - Fix label function that causes segmentation fault.
    - The executable now use a portable, reentrant, embeddable, getopt-like option parser and features a detailed usage message.
    - The linker problem with libpng has been fixed.
    - The flag -fopenmp has been added by default.
    - A concurrence race has been fixed in the distance function.
    - A concurrence race has been fixed in the paraws function.
    - Hexagonal structuring element has been desactived, as it seems to cause some troubles. It will be enable in the next release.
    - Example images have been added. Corresponding calls to the executable can be found in the file 'README.txt'.
          generate more warnings.

Changes include in third publication:
    - Support markers-based watershed.
    - Fix hexagonal structuring element.
    - Add a benchmark option. 

Changes include in fourth publication:

Changes include in fifth publication:
    - Add RGB output.

Changes include in sixth publication:
    - Bug fix that could cause a memory leak due to the popping of an empty hierarchical queue in flood.hpp

- List of the files:

examples: contains various test images.

tests: contains unit tests that verifies the shape of the watershed lines.

src: contains source files.

README.txt: this file.

paraws.cpp: executable that read the input image and write the output image at
the specified location.

meson_options.txt: contains meson options.

meson.build: contains meson build definitions

Makefile: build file.

Dockerfile: docker commands

GPLv3.txt: holds copyrights.

common.mk: holds common flags for compilation with makefile.




- List of known defects:

The connected component labeling algorithm is not optimised.

Missing doxygen documentation.

This implementation does not support hexagonal structuring element yet.

- Credits and acknowledgments:

Petr Dokladal, thesis supervisor.
Matthieu Faessel, thesis supervisor.
Michel Bilodeau, thesis supervisor.
Pierre Guillou, for the meson build system and docker file and for the git.
Nicolas Limare, for the function, which output labeled images in RGB format.