Opened 9 years ago

Closed 9 years ago

#2856 closed defect (fixed)

i.segment: warning "Region consists of only one cell, nothing to update" slows down module

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.0.4
Component: Imagery Version: svn-trunk
Keywords: i.segment region Cc:
CPU: Unspecified Platform: Unspecified

Description

In the NC dataset:

g.region n=221318 s=220073 w=637746 e=639646 res=1
i.group ortho in=ortho_2001_t792_1m
i.segment group=ortho@user1 output=ortho_seg_001 threshold=0.01 memory=2500

Then, when I try to use the output of this as seeds for the next level:

i.segment group=ortho@user1 output=ortho_seg_002_seeded threshold=0.02 seed=ortho_seg_001 memory=2500 

I get tons of

WARNING: Region consists of only one cell, nothing to update

The module run takes +/- 1m25.

When I comment line 1086 in imagery/i.segment/create_isegs.c so that the warning is not issued, module run only takes about 20s.

Is this warning really necessary ? Or is it a bug that it appears in this context ?

Change History (4)

in reply to:  description comment:1 by neteler, 9 years ago

Replying to mlennert:

Is this warning really necessary ?

What about changing it to G_verbose_message()?

Or is it a bug that it appears in this context ?

Unfortunately I don't know, maybe the main authors?

in reply to:  description ; comment:2 by mmetz, 9 years ago

Replying to mlennert:

In the NC dataset:

g.region n=221318 s=220073 w=637746 e=639646 res=1
i.group ortho in=ortho_2001_t792_1m
i.segment group=ortho@user1 output=ortho_seg_001 threshold=0.01 memory=2500

Then, when I try to use the output of this as seeds for the next level:

i.segment group=ortho@user1 output=ortho_seg_002_seeded threshold=0.02 seed=ortho_seg_001 memory=2500 

I get tons of

WARNING: Region consists of only one cell, nothing to update

The module run takes +/- 1m25.

When I comment line 1086 in imagery/i.segment/create_isegs.c so that the warning is not issued, module run only takes about 20s.

Is this warning really necessary ? Or is it a bug that it appears in this context ?

It is a bug that appears in this context. The warning is justified because it appears only when regions are merged. A merged region must always consist of more than one cell (merge of two original regions each consisting of at least one cell). The bug seems to be an inappropriate call to merge_regions().

in reply to:  2 ; comment:3 by mmetz, 9 years ago

Replying to mmetz:

Replying to mlennert:

In the NC dataset:

g.region n=221318 s=220073 w=637746 e=639646 res=1
i.group ortho in=ortho_2001_t792_1m
i.segment group=ortho@user1 output=ortho_seg_001 threshold=0.01 memory=2500

Then, when I try to use the output of this as seeds for the next level:

i.segment group=ortho@user1 output=ortho_seg_002_seeded threshold=0.02 seed=ortho_seg_001 memory=2500 

I get tons of

WARNING: Region consists of only one cell, nothing to update

The module run takes +/- 1m25.

When I comment line 1086 in imagery/i.segment/create_isegs.c so that the warning is not issued, module run only takes about 20s.

Is this warning really necessary ? Or is it a bug that it appears in this context ?

It is a bug that appears in this context. The warning is justified because it appears only when regions are merged. A merged region must always consist of more than one cell (merge of two original regions each consisting of at least one cell). The bug seems to be an inappropriate call to merge_regions().

No, an inappropriate call to update_band_vals(). Fixed in r67915,6 (trunk, relbr70).

in reply to:  3 comment:4 by mlennert, 9 years ago

Resolution: fixed
Status: newclosed

Replying to mmetz:

Replying to mmetz:

Replying to mlennert:

In the NC dataset:

g.region n=221318 s=220073 w=637746 e=639646 res=1
i.group ortho in=ortho_2001_t792_1m
i.segment group=ortho@user1 output=ortho_seg_001 threshold=0.01 memory=2500

Then, when I try to use the output of this as seeds for the next level:

i.segment group=ortho@user1 output=ortho_seg_002_seeded threshold=0.02 seed=ortho_seg_001 memory=2500 

I get tons of

WARNING: Region consists of only one cell, nothing to update

The module run takes +/- 1m25.

When I comment line 1086 in imagery/i.segment/create_isegs.c so that the warning is not issued, module run only takes about 20s.

Is this warning really necessary ? Or is it a bug that it appears in this context ?

It is a bug that appears in this context. The warning is justified because it appears only when regions are merged. A merged region must always consist of more than one cell (merge of two original regions each consisting of at least one cell). The bug seems to be an inappropriate call to merge_regions().

No, an inappropriate call to update_band_vals(). Fixed in r67915,6 (trunk, relbr70).

Great. It works great for me. Thanks for the fix.

Closing.

Note: See TracTickets for help on using tickets.