[GRASS-user] Image segmentation

Hi all,

I would like to “segment” an image using a sort of Voronoi algorithm on a cost surface instead of distance between point.

Below you can see an image where the black pixels identity areas with high cost value. I would like to identify the “valley” between theses black areas.

In the second image I draft by hand an ideal solution for few high cost areas.

Which grass command can do this kind of delineation?

Thanks,

Giuseppe

Inline images 1

Inline images 2

Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511

Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/

Hi Giuseppe,

Maybe you can use r.watershed [0] to get the “basins”.

Best regards,

Pedro Venâncio

[0] https://grass.osgeo.org/grass72/manuals/r.watershed.html

(attachments)

image.png
image.png

···

2017-01-18 19:16 GMT+00:00 Giuseppe Amatulli <giuseppe.amatulli@gmail.com>:

Hi all,

I would like to “segment” an image using a sort of Voronoi algorithm on a cost surface instead of distance between point.

Below you can see an image where the black pixels identity areas with high cost value. I would like to identify the “valley” between theses black areas.

In the second image I draft by hand an ideal solution for few high cost areas.

Which grass command can do this kind of delineation?

Thanks,

Giuseppe

Inline images 1

Inline images 2

Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511

Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Thanks Pedro,
yes I had already tried, but i do not get really what I want. Moreover, the delineation of watersheds is based on a predefined threshold that can be quite arbitrary give really different results.

Best Giuseppe

(attachments)

image.png
image.png

···

On 18 January 2017 at 14:27, Pedro Venâncio <pedrongvenancio@gmail.com> wrote:

Hi Giuseppe,

Maybe you can use r.watershed [0] to get the “basins”.

Best regards,

Pedro Venâncio

[0] https://grass.osgeo.org/grass72/manuals/r.watershed.html

2017-01-18 19:16 GMT+00:00 Giuseppe Amatulli <giuseppe.amatulli@gmail.com>:

Hi all,

I would like to “segment” an image using a sort of Voronoi algorithm on a cost surface instead of distance between point.

Below you can see an image where the black pixels identity areas with high cost value. I would like to identify the “valley” between theses black areas.

In the second image I draft by hand an ideal solution for few high cost areas.

Which grass command can do this kind of delineation?

Thanks,

Giuseppe

Inline images 1

Inline images 2

Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511

Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511

Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/

On Wed, Jan 18, 2017 at 8:16 PM, Giuseppe Amatulli <giuseppe.amatulli@gmail.com> wrote:

Hi all,

I would like to “segment” an image using a sort of Voronoi algorithm on a cost surface instead of distance between point.

Below you can see an image where the black pixels identity areas with high cost value. I would like to identify the “valley” between theses black areas.

In the second image I draft by hand an ideal solution for few high cost areas.

Which grass command can do this kind of delineation?

You can use v.voronoi: first extract the pixels with high cost values with e.g.
r.mapcalc “high_cost = if(surface_map > threshold_value, 1, null())”

Then convert to vector areas with

r.to.vect input=high_cost output=high_cost type=area

Now create Voronoi triangles for areas with

v.voronoi input=high_cost output=high_cost_voronoi -a

HTH,

Markus M

Thanks,

Giuseppe


Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511
Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Thanks Markus,
the problem with the v.voronoi is that the polygon borders will be calculate based on point distance and not on the cost surface.

Any other input?
Best
Giuseppe

···

On 19 January 2017 at 02:38, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Wed, Jan 18, 2017 at 8:16 PM, Giuseppe Amatulli <giuseppe.amatulli@gmail.com> wrote:

Hi all,

I would like to “segment” an image using a sort of Voronoi algorithm on a cost surface instead of distance between point.

Below you can see an image where the black pixels identity areas with high cost value. I would like to identify the “valley” between theses black areas.

In the second image I draft by hand an ideal solution for few high cost areas.

Which grass command can do this kind of delineation?

You can use v.voronoi: first extract the pixels with high cost values with e.g.
r.mapcalc “high_cost = if(surface_map > threshold_value, 1, null())”

Then convert to vector areas with

r.to.vect input=high_cost output=high_cost type=area

Now create Voronoi triangles for areas with

v.voronoi input=high_cost output=high_cost_voronoi -a

HTH,

Markus M

Thanks,

Giuseppe


Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511
Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511

Teaching: http://spatial-ecology.org
Work: https://environment.yale.edu/profile/giuseppe-amatulli/

Le Thu, 19 Jan 2017 11:08:13 -0500,
Giuseppe Amatulli <giuseppe.amatulli@gmail.com> a écrit :

Thanks Markus,
the problem with the v.voronoi is that the polygon borders will be
calculate based on point distance and not on the cost surface.
Any other input?

Seems to me that "voronoi" is not what you are looking for.

Maybe you could have a look at some of the topographic modules like
r.param.scale or the addon r.geomorphon to extract the valleys.

Or you could you r.watershed but output the streams and/or the
accumulation map to identify the valleys. Then some magic to reduce
these to lines (r.reclass + r.thin maybe).

Moritz

Best
Giuseppe

On 19 January 2017 at 02:38, Markus Metz
<markus.metz.giswork@gmail.com> wrote:

[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]
[...]