[GRASS-user] i.rgb.his/i.his.rgb not working properly

Hi,

I'm having some problems using i.rgb.his/i.his.rgb to convert quickbird data from RGB to IHS and vice versa (original purpose was pan sharpening). The results look totally weird and I don't know why.
Here is a protocol along with some screenshots:

[1] d.rgb r=szene1_mul.4 g=szene1_mul.3 b=szene1_mul.2
--> http://img96.imageshack.us/img96/9487/screen1i.png

[2] i.rgb.his r=szene1_mul.4 g=szene1_mul.3 b=szene1_mul.2 h=szene1_234.h i=szene1_234.i s=szene1_234.s

[3] d.his h=szene1_234.h i=szene1_234.i s=szene1_234.s
--> http://img35.imageshack.us/img35/6746/screen2pm.png

[4] i.his.rgb h=szene1_234.h i=szene1_234.i s=szene1_234.s r=szene1_234.r g=szene1_234.g b=szene1_234.b

[5] d.rgb r=szene1_234.r g=szene1_234.g b=szene1_234.b
--> http://img246.imageshack.us/img246/1856/screen3pa.png

I also repeated the process using landsat data from the nc data set - same problem here.

g.version
GRASS 6.4.0RC5 (2009)

Did anybody experience similar problems?
bests,
Georg

On Tue, Sep 29, 2009 at 3:26 PM, Georg Kaspar <georg@muenster.de> wrote:

Hi,

I'm having some problems using i.rgb.his/i.his.rgb to convert quickbird data
from RGB to IHS and vice versa (original purpose was pan sharpening). The
results look totally weird and I don't know why.
Here is a protocol along with some screenshots:

[1] d.rgb r=szene1_mul.4 g=szene1_mul.3 b=szene1_mul.2
--> http://img96.imageshack.us/img96/9487/screen1i.png

are you sure about the channel order?

[2] i.rgb.his r=szene1_mul.4 g=szene1_mul.3 b=szene1_mul.2 h=szene1_234.h
i=szene1_234.i s=szene1_234.s

[3] d.his h=szene1_234.h i=szene1_234.i s=szene1_234.s
--> http://img35.imageshack.us/img35/6746/screen2pm.png

[4] i.his.rgb h=szene1_234.h i=szene1_234.i s=szene1_234.s r=szene1_234.r
g=szene1_234.g b=szene1_234.b

[5] d.rgb r=szene1_234.r g=szene1_234.g b=szene1_234.b
--> http://img246.imageshack.us/img246/1856/screen3pa.png

I also repeated the process using landsat data from the nc data set - same
problem here.

ok, I have tried that, too:

g.region rast=lsat7_2002_10
d.mon x0
d.rgb b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30
i.rgb.his b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30
h=lsat7_2002_h i=lsat7_2002_i s=lsat7_2002_s
d.his h=lsat7_2002_h i=lsat7_2002_i s=lsat7_2002_s
-> result is some grey scale image.
Perhaps that's correct?

Find attached a RGB/HIS fusion script which I wrote some years ago:
# NC data set:
i.fusion.his b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30
pan=lsat7_2002_80 prefix=fusion
g.region -p rast=fusion.red
d.mon x0
d.rgb r=fusion.red b=fusion.green g=fusion.blue

It may need some cosmetics to follow 6.4 coding standard but seems
yet to work.

cheers
Markus

(attachments)

i.fusion.his (3.78 KB)

...by the way: is there a build in possibility to convert lat-long
degree coordinates in time coordinates? (to change this in a table)

On Wed, Sep 30, 2009 at 11:01 AM, achim <ak7@jupiter.uni-freiburg.de> wrote:

...by the way: is there a build in possibility to convert lat-long
degree coordinates in time coordinates? (to change this in a table)

From decimal to sexagesimal, try this:

cat file.csv | cs2cs -f "%.8f" +proj=latlong +datum=WGS84 \
      +to +proj=latlong +datum=WGS84

cheers
Markus

...I just need the pure conversion from decimal to sexagesimal(;-)) to
convert the output of eg.:
v.to.db -p map=lines@achim option=start
, which is decimal to D:M:S in the table.

Is there something like cs2cs?

A

Markus Neteler schrieb:

On Wed, Sep 30, 2009 at 11:01 AM, achim <ak7@jupiter.uni-freiburg.de> wrote:

...by the way: is there a build in possibility to convert lat-long
degree coordinates in time coordinates? (to change this in a table)

From decimal to sexagesimal, try this:

cat file.csv | cs2cs -f "%.8f" +proj=latlong +datum=WGS84 \
      +to +proj=latlong +datum=WGS84

cheers
Markus

Markus Neteler wrote:

On Tue, Sep 29, 2009 at 3:26 PM, Georg Kaspar <georg@muenster.de> wrote:

[1] d.rgb r=szene1_mul.4 g=szene1_mul.3 b=szene1_mul.2
--> http://img96.imageshack.us/img96/9487/screen1i.png

are you sure about the channel order?

yes, it's a false color composite. i set the colortable to grey, so the
image looks a bit dull.

I also repeated the process using landsat data from the nc data set - same
problem here.

ok, I have tried that, too:

g.region rast=lsat7_2002_10
d.mon x0
d.rgb b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30
i.rgb.his b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30
h=lsat7_2002_h i=lsat7_2002_i s=lsat7_2002_s
d.his h=lsat7_2002_h i=lsat7_2002_i s=lsat7_2002_s
-> result is some grey scale image.
Perhaps that's correct?

i converted the results back to rgb and it works. pansharpening was also
possible using channel 8.
unfortunately - it still doesn't work using quickbird data

Find attached a RGB/HIS fusion script which I wrote some years ago:

thanks for the script. unfortunately the output looks still the same
since the script makes use of the same modules. does the script work on
your installation?

Georg Kaspar wrote:
  > i converted the results back to rgb and it works. pansharpening was also

possible using channel 8.
unfortunately - it still doesn't work using quickbird data

It work's, though i had to rescale all channels to 8bit using r.mapcalc. Is it possible that 16bit are not supported by i.rgb.his/i.his.rgb in general?

Dear grass-users,

because I could not find something else, I write a little script to
convert lat/long decimal degrees to lat/long sexagesimal degrees
(deg:min:sec).

It works with a sqlite-database and sqlite3, t2sql.sh (to convert
text-file to a table) and awk (on all linux-systems).

Maybe someone will need this some day:
$1 table name (need a unique column "cat")
$2 column with decial-degrees
$3 column, where sexagesimal degrees will be written (can be same as $2)
$4 sqlite database-file

eg:
sh decimal_to_sexagesimal.sh table col_decimal col_sexag
/home/userneme/grass/databasefile

warning: its very modest and dont deal with execptions. (eg. overwrites
the files temp_decimal_input.txt and temp_sexagesimal_output.txt)

Achim

achim schrieb:

...I just need the pure conversion from decimal to sexagesimal(;-)) to
convert the output of eg.:
v.to.db -p map=lines@achim option=start
, which is decimal to D:M:S in the table.

Is there something like cs2cs?

A

Markus Neteler schrieb:

On Wed, Sep 30, 2009 at 11:01 AM, achim <ak7@jupiter.uni-freiburg.de> wrote:

...by the way: is there a build in possibility to convert lat-long
degree coordinates in time coordinates? (to change this in a table)

From decimal to sexagesimal, try this:

cat file.csv | cs2cs -f "%.8f" +proj=latlong +datum=WGS84 \
      +to +proj=latlong +datum=WGS84

cheers
Markus

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

(attachments)

decimal_to_sexagesimal.sh (720 Bytes)

achim wrote:

...I just need the pure conversion
from decimal to sexagesimal(;-)) to
convert the output of eg.:
v.to.db -p map=lines@achim option=start
, which is decimal to D:M:S in the table.

Is there something like cs2cs?

for the other direction there is m.proj -o (-d)

we should really add support in that to allow d:m:s input too,
Martin made some improvements in grass7, so maybe already works?

Hamish

achim wrote:
> ...I just need the pure conversion
> from decimal to sexagesimal(;-)) to
> convert the output of eg.:
> v.to.db -p map=lines@achim option=start
> , which is decimal to D:M:S in the table.

ps- there was an old wish (in trac??) to have a variable set to
determine module DMS output format.

from gui/tcltk/gis.m/mapcanvas.tcl:

# FIXME: make this settable from the UI or use GRASS_DMS_FORMAT enviro var
# DMS format: 0 is ddd.dddddd, 1 is ddd:mm.mmmm', 2 is ddd:mm'ss.sss"

set dms_format 2

Hamish

ps- there was an old wish (in trac??) to have a variable set to
determine module DMS output format.

from gui/tcltk/gis.m/mapcanvas.tcl:

# FIXME: make this settable from the UI or use GRASS_DMS_FORMAT enviro var
# DMS format: 0 is ddd.dddddd, 1 is ddd:mm.mmmm', 2 is ddd:mm'ss.sss"

set dms_format 2

yea, that would be the easiest way. Shouldnt be that complicated, to put
that option in v.to.db tool.

Wish I was capable to do that...

A.

Georg Kaspar wrote:

Georg Kaspar wrote:
  > i converted the results back to rgb and it works. pansharpening was also
> possible using channel 8.
> unfortunately - it still doesn't work using quickbird data

It work's, though i had to rescale all channels to 8bit using r.mapcalc.
Is it possible that 16bit are not supported by i.rgb.his/i.his.rgb in
general?

AFAICT, i.rgb.his requires that the data is 0-255.

--
Glynn Clements <glynn@gclements.plus.com>