Maris Nartiss 97fb695bff Fix some instances of printing of off_t and size_t %!s(int64=6) %!d(string=hai) anos
..
testsuite 1dfeb1bf91 i.segment: testsuite added %!s(int64=6) %!d(string=hai) anos
Makefile b065ffef8e i.segment: use faster pavl tree %!s(int64=7) %!d(string=hai) anos
README bc8a87f167 i.segment: update README %!s(int64=9) %!d(string=hai) anos
cluster.c 606b5ed29b fix spelling errors (https://trac.osgeo.org/grass/ticket/3447, Debian lintian QA tool), thanks to Bas Couwenberg %!s(int64=7) %!d(string=hai) anos
create_isegs.c 95a22d81ae i.segment: fix writing out goodness of fit %!s(int64=6) %!d(string=hai) anos
flag.c 47bc7b03bc move i.segment.xl to trunk %!s(int64=12) %!d(string=hai) anos
flag.h 158a6f2a5a bulk fixing of typos in comments (using tools/fix_typos.sh) %!s(int64=6) %!d(string=hai) anos
i.segment.html 606b5ed29b fix spelling errors (https://trac.osgeo.org/grass/ticket/3447, Debian lintian QA tool), thanks to Bas Couwenberg %!s(int64=7) %!d(string=hai) anos
i_segment_lsat7_pan.png 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
i_segment_lsat7_seg_min100.png 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
i_segment_lsat7_seg_min5.png 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
i_segment_ortho_segs_final.jpg 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
i_segment_ortho_segs_l1.jpg 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
i_segment_ortho_segs_l2_l5.jpg 228f6e68eb i.segment manual: Landsat7 example added %!s(int64=9) %!d(string=hai) anos
iseg.h 97fb695bff Fix some instances of printing of off_t and size_t %!s(int64=6) %!d(string=hai) anos
main.c 6d56fcaa5c i.segment: +mean shift %!s(int64=8) %!d(string=hai) anos
mean_shift.c 97fb695bff Fix some instances of printing of off_t and size_t %!s(int64=6) %!d(string=hai) anos
ngbrtree.c 32a94a98ef i.segment: improvement for https://trac.osgeo.org/grass/ticket/3084 %!s(int64=9) %!d(string=hai) anos
ngbrtree.h 32a94a98ef i.segment: improvement for https://trac.osgeo.org/grass/ticket/3084 %!s(int64=9) %!d(string=hai) anos
open_files.c 97fb695bff Fix some instances of printing of off_t and size_t %!s(int64=6) %!d(string=hai) anos
outline 158a6f2a5a bulk fixing of typos in comments (using tools/fix_typos.sh) %!s(int64=6) %!d(string=hai) anos
parse_args.c a97ada0ad1 i.segment: input can be a group or a list of raster maps %!s(int64=7) %!d(string=hai) anos
pavl.c b065ffef8e i.segment: use faster pavl tree %!s(int64=7) %!d(string=hai) anos
pavl.h b065ffef8e i.segment: use faster pavl tree %!s(int64=7) %!d(string=hai) anos
rclist.c 0c5cffd1e9 i.segment update %!s(int64=12) %!d(string=hai) anos
region_growing.c 97fb695bff Fix some instances of printing of off_t and size_t %!s(int64=6) %!d(string=hai) anos
regtree.c 32a94a98ef i.segment: improvement for https://trac.osgeo.org/grass/ticket/3084 %!s(int64=9) %!d(string=hai) anos
regtree.h 47bc7b03bc move i.segment.xl to trunk %!s(int64=12) %!d(string=hai) anos
watershed.c 13193822a6 i.segment: prepare for different algorithms %!s(int64=9) %!d(string=hai) anos
write_output.c 0c55dd730c i.segment: fix https://trac.osgeo.org/grass/changeset/73512 writing out segment ids %!s(int64=6) %!d(string=hai) anos

README

i.segment basically works in three steps:

[Note: the word "segment" has two meanings here - data segments which are like data tiles (SEGMENT library) and image objects that are the result of the segmentation algorithm. In following, an attemps is made to systematically use 'segment' for the former and 'object' for the latter.]

1) open input files and put the data in data segments: open_files(), implemented in open_files.c
Pre-defined boundaries can be supplied with the "bounds" option. The meaning of these boundaries is that objects will not cross these boundaries.
Seed objects can be supplied with the "seeds" option. All pixels belonging to the same seed are combined to one initial object.

2) run algorithm that identifies for each pixel the id of the object this pixel is part of: create_isegs(), implemented in create_isegs.c, which currently contains only one algorithm, region-growing, implemented in region_growing() and related functions

3) write output raster files: write_output() implemented in write_output.c

Variables and structures used in all functions are passed around using a structure called globals, defined in iseg.h.

All module parameters and flags are defined in parse_args.c

There are two generic balanced binary search tree (Red Black Tree) implementations used in the region-growing algorithm, one for keeping track of the object pixels belong to (regtree.c/h) and the other for keeping track of the neighbors (ngbrtree.c/h). There is a also a small library of routines allowing to "flag" pixels in raster maps (flag.c/h), used to flag null cells in the input maps.

A new algorithm can be added by adding new methods to the method option and creating the required functions to be called by create_isegs(). Additionally, the read_seed() function in open_files.c will also need to be updated to calculate the metrics per object required by the selected method.