[GRASS-dev] i.segment error: Ri is 0

Moritz Lennert mlennert at club.worldonline.be
Tue Jul 2 00:58:35 PDT 2013


On 01/07/13 21:04, Markus Metz wrote:
> On Mon, Jul 1, 2013 at 3:56 PM, Moritz Lennert
> <mlennert at club.worldonline.be>  wrote:
>> Hi Eric and Markus,
>>
>> Trying to use i.segment in grass7 checked out and compiled a few days ago
>> (rev 56918), I came upon the following error and the resulting segments file
>> was not created. I can file this as a bug report, but wanted your feedback
>> first to see if I'm misusing i.segment somehow. I haven't been able to find
>> the error in the source code.
>>
>> command line:
>> time i.segment group=xs out=seg_xs minsize=2 memory=3072 threshold=0.2 --o
>>
>> error:
>> Segmentation converged after 16 iterations.
>> Merging segments smaller than 2 cells
>> ERREUR :Ri is 0
>
> This should not happen. The ID of a segment is always positive or
> negative or NULL (Rast_is_c_null_value())
>>
>> This is on a mosaic of Worldview 2 images with region specs as follows:
>>
>>> g.region -p
>> projection: 1 (UTM)
>> zone:       33
>> datum:      wgs84
>> ellipsoid:  wgs84
>> north:      4876400
>> south:      4849792
>> west:       610056
>> east:       634648
>> nsres:      2
>> ewres:      2
>> rows:       13304
>> cols:       12296
>> cells:      163585984
>>
>> The mosaic is only a narrow band within that region, so that actually there
>> are only 34,755,878 non-null cells.
>>
>> Any hints ?
>
> Not really. I created a sample dataset with a MASK leaving only a
> narrow diagonal strip and everything went fine.

I did not use a mask, the non-relevant cells were just nulls. Would it 
be better to create a mask ?

> Did you get any other
> warnings while running i.segment?

No.

>I assume you are using 64 bit Linux

$ uname -srvm
Linux 3.2.0-4.drm-amd64 #1 SMP Debian 3.2.35-3~jcristau.1 x86_64
(Intel i3)

> with more than 3072 GB RAM

Yes. I have 8GB. There were two segmentation processes running at the 
same time, both with memory=3072. The other process ran without error 
(but on a smaller region and image).

> and lots of free disk space on the
> partition with your GRASS data.

61G on the data partition.

>
> Can you provide data to replicate or commands using one of the sample
> datasets to replicate this error?

I'll run the segmentation again without having something else running. 
If I can reproduce the error, I'll make the data available to you so you 
can test.

Thanks !

Moritz


More information about the grass-dev mailing list