[GRASS-user] Landsat color correction fails with "Segmentation fault" in GRASS 6.3

Marius Jigmond mariusjigmond at hotmail.com
Mon Jun 2 19:36:21 EDT 2008



Hamish,



Here are the outputs:

1. GRASS 6.3.0 (Romania):~ > r.univar -ge RGB321.3 at marius perc=98

n=68587026

null_cells=3781910

min=58

max=255

range=197

mean=181.261

mean_of_abs=181.261

stddev=36.808

variance=1354.83

coeff_var=20.3067

sum=12432135110

Segmentation fault



2. GRASS 6.3.0 (Romania):~ > g.region -p

projection: 99 (sterea)

zone:       0

datum:      ** unknown (default: WGS84) **

ellipsoid:  a=6378245 es=0.006693421622965943

north:      773383.051

south:      194663.051

west:       103791.364

east:       904111.364

nsres:      80

ewres:      80

rows:       7234

cols:       10004

cells:      72368936



3. After setting DEBUG=1

GRASS 6.3.0 (Romania):~ > i.landsat.rgb red=RGB321.3 at marius
green=RGB321.2 at marius blue=RGB321.1 at marius

Processing <RGB321.3 at marius> ...

Segmentation fault

D1/1: <RGB321.3 at marius>:  min=108   max=

ERROR: bad rule (syntax error): white

Processing <RGB321.2 at marius> ...

Segmentation fault

D1/1: <RGB321.2 at marius>:  min=129   max=

ERROR: bad rule (syntax error): white

Processing <RGB321.1 at marius> ...

Segmentation fault

D1/1: <RGB321.1 at marius>:  min=137   max=

ERROR: bad rule (syntax error): white



I am not sure why it says "datum: unknown," it's the "Dealul Piscului
1970" datum (using the EPSG 31700). I don't think it's related to the
error though.

Thanks for looking into it.



Marius



Hamish wrote:

  Marius Jigmond wrote:
  
  
    Have you run into this kind of errors:
    
  
  
Nope.
 
  
  
    GRASS 6.3.0 (Romania):~> i.landsat.rgb
   red=RGB321.3 at marius green=RGB321.2 at marius blue=RGB321.1 at marius
Processing  ...
Segmentation fault
ERROR: bad rule (syntax error): white
Processing  ...
Segmentation fault
ERROR: bad rule (syntax error): white
Processing  ...
Segmentation fault
ERROR: bad rule (syntax error): white

It's a three band Landsat mosaic. I am running Ubuntu
8.04 with GRASS 6.3 from Jachym Cepicky's repo
(http://les-ejk.cz/ubuntu/). I am not 
really sure where to start poking.
    
  
  
It would seem that r.univar is failing in this part of the i.landsat.rgb script:

   for i in $RED $GREEN $BLUE ; do
      g.message "Processing <$i> ..."
      MIN=`r.univar -ge $i perc=2 | grep "^percentile_" | cut -d'=' -f2`
      MAX=`r.univar -ge $i perc=$BRIGHTNESS | grep "^percentile_" | cut -d'=' -f2`
      g.message -d message="<$i>:  min=$MIN   max=$MAX"
      r.colors $i col=rules << EOF
        0% black
        $MIN black
        $MAX white
        100% white
EOF
      done


so $MAX would be unset, and r.colors gets a color without a value, which is a bad rule.
???

can you try "r.univar -ge RGB321.3 at marius perc=98" on the command line and see what happens?

also, what does "g.region -p" look like?

and finally can you rerun i.landsat.rgb with debug messages turned on?
  g.gisenv set="DEBUG=1"   # to turn them back off set to 0 
then the g.message info will be displayed.

but why does r.colors not complain about "$MIN black" too?


Hamish



      



  




_________________________________________________________________
Make every e-mail and IM count. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ MakeCount
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20080602/783dc8e6/attachment.html


More information about the grass-user mailing list