[GRASS5] r.wavelet

Hi all,
       I am planing to do some image processing based on wavelet.
I checked the r.wavelet module in the grass addon section, but it is made
for grass 4(?). I wish to upgrade it to the present grass version.

I am not a grass developer now, and I dont know the changes in grass libraries
between version 4 and 6.
Can some one guide me on how to proceed?

--
Change the rules, or the rules will change you
     ---------Kumaranasan

Hi Sajith,

       I am planing to do some image processing based on wavelet.
I checked the r.wavelet module in the grass addon section, but it is made
for grass 4(?). I wish to upgrade it to the present grass version.

the modules were made for the grass5 version. I got in touch only once again
with the wavelets modules in grass6, where they gave some strange output, but
at that time I had no second free to understand what it was. Since the raster
api didn't change (someone correct me if it's not true), those modules should
work out of the box.

I am not a grass developer now, and I dont know the changes in grass
libraries between version 4 and 6.
Can some one guide me on how to proceed?

What do you mean? Compilation into the release or usage?
The man pages in the package should fullfill the second.
However for a first quick use:
r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and sl05.ir)
are with / at the end> NumRec=3

This will perform a 3 step wavelets decomposition.
The maps will be created and the names are selfexplanatory.

If I remeber correct, the starting map has to be floating point, else there
will be strange results.

Cheers,
Andrea

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

Thanks Andrea for prompt replay.
In r.wavelet code I saw "Gmake" file.
So I thought that changes are necessary
to use it with grass6. Can Gmakefilework
with grass6?
Also why r.wavelet is not part of grass6 distribution?
Does it lacks something, like documentation?

On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:

Hi Sajith,

> I am planing to do some image processing based on wavelet.
> I checked the r.wavelet module in the grass addon section, but it is made
> for grass 4(?). I wish to upgrade it to the present grass version.

the modules were made for the grass5 version. I got in touch only once again
with the wavelets modules in grass6, where they gave some strange output, but
at that time I had no second free to understand what it was. Since the raster
api didn't change (someone correct me if it's not true), those modules should
work out of the box.

> I am not a grass developer now, and I dont know the changes in grass
> libraries between version 4 and 6.
> Can some one guide me on how to proceed?

What do you mean? Compilation into the release or usage?
The man pages in the package should fullfill the second.
However for a first quick use:
r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and sl05.ir)
are with / at the end> NumRec=3

This will perform a 3 step wavelets decomposition.
The maps will be created and the names are selfexplanatory.

If I remeber correct, the starting map has to be floating point, else there
will be strange results.

Cheers,
Andrea

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

--
Change the rules, or the rules will change you
     ---------Kumaranasan

Thanks Andrea for prompt replay.
In r.wavelet code I saw "Gmake" file.
So I thought that changes are necessary
to use it with grass6. Can Gmakefilework
with grass6?

Yes, I simply included the r.wavelet folder in my raster folder and everything
works.

I have a quite different problem, which I first thought is a code problem of
wavelets, but I'm not that sure any more.

Some lines of background (very fast, give me the chance :o)): the wavelet
filtering process creates from one map four maps of half of the resolution.
So every processing level takes map

1

and creates four maps:

2_11, 2_12, 2_21, 2_22

that have obviously same boundaries but different (half) resolution.
Next level takes the map of the lower resolution map

2_22 (the others contain the difference values in x, y and xy)

and create:

3_11, 3_12, 3_21, 3_22

and so on for all the decomposition levels.

Things should work properly as they did, since the cellhead files look right:

map 1:

proj: 99
zone: 0
north: 730000.0
south: 590000.0
east: 850000.0
west: 580000.0
cols: 2700
rows: 1400
n-s resol: 100.0
e-w resol: 100.0
format: -1
compressed: 1

map 3_22:

proj: 99
zone: 0
north: 730000
south: 590000
east: 850000
west: 580000
cols: 337
rows: 175
e-w resol: 801.18694362
n-s resol: 800
format: -1
compressed: 1

So the boundary are the same, but when I visualize, the result is the
following:

http://www.hydrologis.com/testfiles/wavelet_pbl.png

The bigger map is the third level of wavelet decomposition of the smaller map.
The boundaries are the same, so I can't understand why the lower resolution
map gets stretched.

In the last years did something change in the raster apis, which I missed?

Sajith, can you try and tell me if you get the same results?

Has anyone some hint? I'm not really happy to go through some code I didn't
open for years if it is not really necessary.

Also why r.wavelet is not part of grass6 distribution?

I guess because they seem not to work at the time :slight_smile:
Honestly you are the second person that ask for multiresolution analysis in 3
years, so I think that is why they are in the add-ons section.

Does it lacks something, like documentation?

No, the manual pages were made properly and exaustive.

Hope this can be solved,
Cheers,
Andrea

On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:
> Hi Sajith,
>
> > I am planing to do some image processing based on wavelet.
> > I checked the r.wavelet module in the grass addon section, but it is
> > made for grass 4(?). I wish to upgrade it to the present grass version.
>
> the modules were made for the grass5 version. I got in touch only once
> again with the wavelets modules in grass6, where they gave some strange
> output, but at that time I had no second free to understand what it was.
> Since the raster api didn't change (someone correct me if it's not true),
> those modules should work out of the box.
>
> > I am not a grass developer now, and I dont know the changes in grass
> > libraries between version 4 and 6.
> > Can some one guide me on how to proceed?
>
> What do you mean? Compilation into the release or usage?
> The man pages in the package should fullfill the second.
> However for a first quick use:
> r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
> filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and
> sl05.ir) are with / at the end> NumRec=3
>
> This will perform a 3 step wavelets decomposition.
> The maps will be created and the names are selfexplanatory.
>
> If I remeber correct, the starting map has to be floating point, else
> there will be strange results.
>
> Cheers,
> Andrea
>
>
>
> --
> _________________________________________________________________________
>___ HydroloGIS - Environmental Open Source Solutions
> www.hydrologis.com
>
> Andrea Antonello
> Environmental Engineer
> mobile: +393288497722
>
> "Let it be as much a great honour to take as to give learning,
> if you want to be called wise."
> Skuggsja' - The King's mirror - 1240 Reykjavik
> _________________________________________________________________________
>___

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

Alright, I did some check and will answer and correct myself.

Yes, I simply included the r.wavelet folder in my raster folder and
everything works.

Not true, you will need a file makefile with the following in it:

include head.mk

PGM1=r.biowave.dec
PGM2=r.owave.dec
PGM3=r.biowave.rec
PGM4=r.owave.rec
OBJ1=$(OBJARCH)/biowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ2=$(OBJARCH)/owave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ3=$(OBJARCH)/ibiowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ4=$(OBJARCH)/iowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
all: $(BIN)/$(PGM1) $(BIN)/$(PGM2) $(BIN)/$(PGM3) $(BIN)/$(PGM4)

$(BIN)/$(PGM1):$(OBJ1) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ1) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM2):$(OBJ2) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ2) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM3):$(OBJ3) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ3) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM4):$(OBJ4) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ4) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(OBJ1):biowave2.h
$(OBJ2):biowave2.h
$(OBJ3):biowave2.h
$(OBJ4):biowave2.h
$(GISLIB):

include tail.mk

Some lines of background (very fast, give me the chance :o)): the wavelet
filtering process creates from one map four maps of half of the resolution.
So every processing level takes map

1

and creates four maps:

2_11, 2_12, 2_21, 2_22

that have obviously same boundaries but different (half) resolution.
Next level takes the map of the lower resolution map

2_22 (the others contain the difference values in x, y and xy)

This was wrong, the lower resolution one is in the *_11, i.e. 2_11. *_22 is
the xy diagonal direction.

Alright, now the solution comes, even if it's a workaround version. Please
take into account that when these modules were written, I was at my very
first programming and grassprogramming experiences.

Btw, the fact is that the modules work only for floating point FCELLs, i.e.
not for integers and not for doubles. This is for sure due to some casting
problem I could not deal with at the time (I feel ashamed...).

The working result can be seen on 6 levels of decomposition the concave-convex
zones of an island (twice you can guess which one :)):

http://www.hydrologis.com/testfiles/waveletsscreens/images.html

Next question will be: when will you fix this?
I'm very busy at the moment and will not be able to fix that soon (did you
ever go through the code of a beginning programmer?). So the only way now is
to deal with floating point maps. Sorry for that.

Cheers,
Andrea

So the boundary are the same, but when I visualize, the result is the
following:

http://www.hydrologis.com/testfiles/wavelet_pbl.png

The bigger map is the third level of wavelet decomposition of the smaller
map. The boundaries are the same, so I can't understand why the lower
resolution map gets stretched.

In the last years did something change in the raster apis, which I missed?

Sajith, can you try and tell me if you get the same results?

Has anyone some hint? I'm not really happy to go through some code I didn't
open for years if it is not really necessary.

> Also why r.wavelet is not part of grass6 distribution?

I guess because they seem not to work at the time :slight_smile:
Honestly you are the second person that ask for multiresolution analysis in
3 years, so I think that is why they are in the add-ons section.

> Does it lacks something, like documentation?

No, the manual pages were made properly and exaustive.

Hope this can be solved,
Cheers,
Andrea

> On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:
> > Hi Sajith,
> >
> > > I am planing to do some image processing based on wavelet.
> > > I checked the r.wavelet module in the grass addon section, but it is
> > > made for grass 4(?). I wish to upgrade it to the present grass
> > > version.
> >
> > the modules were made for the grass5 version. I got in touch only once
> > again with the wavelets modules in grass6, where they gave some strange
> > output, but at that time I had no second free to understand what it
> > was. Since the raster api didn't change (someone correct me if it's not
> > true), those modules should work out of the box.
> >
> > > I am not a grass developer now, and I dont know the changes in grass
> > > libraries between version 4 and 6.
> > > Can some one guide me on how to proceed?
> >
> > What do you mean? Compilation into the release or usage?
> > The man pages in the package should fullfill the second.
> > However for a first quick use:
> > r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
> > filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and
> > sl05.ir) are with / at the end> NumRec=3
> >
> > This will perform a 3 step wavelets decomposition.
> > The maps will be created and the names are selfexplanatory.
> >
> > If I remeber correct, the starting map has to be floating point, else
> > there will be strange results.
> >
> > Cheers,
> > Andrea
> >
> >
> >
> > --
> > _______________________________________________________________________
> >__ ___ HydroloGIS - Environmental Open Source Solutions
> > www.hydrologis.com
> >
> > Andrea Antonello
> > Environmental Engineer
> > mobile: +393288497722
> >
> > "Let it be as much a great honour to take as to give learning,
> > if you want to be called wise."
> > Skuggsja' - The King's mirror - 1240 Reykjavik
> > _______________________________________________________________________
> >__ ___

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

Andrea Antonello wrote:

> Yes, I simply included the r.wavelet folder in my raster folder and
> everything works.

Not true, you will need a file makefile with the following in it:

include head.mk

[snip]

For 5.x, you should write a Gmakefile, and let the "make makefiles"
stage generate the makefile, rather than trying to write the makefile
by hand.

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

Thanks Andrea,
For the prompt and detailed reply.
I will test the module after two-three days.
I will let you know the details.
(And I may trouble you with more querries!!)

I think we need to develop some applications using
this wavelet module.(Like image fusion). People
way not require this module directly. But wavelet
transformation is a good tool for may remote sensing
analysis.

--
Sajith VK
"Freedom is not free"
On 7/4/05, Andrea Antonello <moovida@katamail.com> wrote:

Alright, I did some check and will answer and correct myself.

> Yes, I simply included the r.wavelet folder in my raster folder and
> everything works.

Not true, you will need a file makefile with the following in it:

include head.mk

PGM1=r.biowave.dec
PGM2=r.owave.dec
PGM3=r.biowave.rec
PGM4=r.owave.rec
OBJ1=$(OBJARCH)/biowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ2=$(OBJARCH)/owave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ3=$(OBJARCH)/ibiowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
OBJ4=$(OBJARCH)/iowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
all: $(BIN)/$(PGM1) $(BIN)/$(PGM2) $(BIN)/$(PGM3) $(BIN)/$(PGM4)

$(BIN)/$(PGM1):$(OBJ1) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ1) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM2):$(OBJ2) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ2) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM3):$(OBJ3) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ3) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM4):$(OBJ4) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ4) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(OBJ1):biowave2.h
$(OBJ2):biowave2.h
$(OBJ3):biowave2.h
$(OBJ4):biowave2.h
$(GISLIB):

include tail.mk

> Some lines of background (very fast, give me the chance :o)): the wavelet
> filtering process creates from one map four maps of half of the resolution.
> So every processing level takes map
>
> 1
>
> and creates four maps:
>
> 2_11, 2_12, 2_21, 2_22
>
> that have obviously same boundaries but different (half) resolution.
> Next level takes the map of the lower resolution map
>
> 2_22 (the others contain the difference values in x, y and xy)

This was wrong, the lower resolution one is in the *_11, i.e. 2_11. *_22 is
the xy diagonal direction.

Alright, now the solution comes, even if it's a workaround version. Please
take into account that when these modules were written, I was at my very
first programming and grassprogramming experiences.

Btw, the fact is that the modules work only for floating point FCELLs, i.e.
not for integers and not for doubles. This is for sure due to some casting
problem I could not deal with at the time (I feel ashamed...).

The working result can be seen on 6 levels of decomposition the concave-convex
zones of an island (twice you can guess which one :)):

http://www.hydrologis.com/testfiles/waveletsscreens/images.html

Next question will be: when will you fix this?
I'm very busy at the moment and will not be able to fix that soon (did you
ever go through the code of a beginning programmer?). So the only way now is
to deal with floating point maps. Sorry for that.

Cheers,
Andrea

>
> So the boundary are the same, but when I visualize, the result is the
> following:
>
> http://www.hydrologis.com/testfiles/wavelet_pbl.png
>
>
> The bigger map is the third level of wavelet decomposition of the smaller
> map. The boundaries are the same, so I can't understand why the lower
> resolution map gets stretched.
>
> In the last years did something change in the raster apis, which I missed?
>
> Sajith, can you try and tell me if you get the same results?
>
> Has anyone some hint? I'm not really happy to go through some code I didn't
> open for years if it is not really necessary.
>
> > Also why r.wavelet is not part of grass6 distribution?
>
> I guess because they seem not to work at the time :slight_smile:
> Honestly you are the second person that ask for multiresolution analysis in
> 3 years, so I think that is why they are in the add-ons section.
>
> > Does it lacks something, like documentation?
>
> No, the manual pages were made properly and exaustive.
>
>
> Hope this can be solved,
> Cheers,
> Andrea
>
> > On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:
> > > Hi Sajith,
> > >
> > > > I am planing to do some image processing based on wavelet.
> > > > I checked the r.wavelet module in the grass addon section, but it is
> > > > made for grass 4(?). I wish to upgrade it to the present grass
> > > > version.
> > >
> > > the modules were made for the grass5 version. I got in touch only once
> > > again with the wavelets modules in grass6, where they gave some strange
> > > output, but at that time I had no second free to understand what it
> > > was. Since the raster api didn't change (someone correct me if it's not
> > > true), those modules should work out of the box.
> > >
> > > > I am not a grass developer now, and I dont know the changes in grass
> > > > libraries between version 4 and 6.
> > > > Can some one guide me on how to proceed?
> > >
> > > What do you mean? Compilation into the release or usage?
> > > The man pages in the package should fullfill the second.
> > > However for a first quick use:
> > > r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
> > > filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and
> > > sl05.ir) are with / at the end> NumRec=3
> > >
> > > This will perform a 3 step wavelets decomposition.
> > > The maps will be created and the names are selfexplanatory.
> > >
> > > If I remeber correct, the starting map has to be floating point, else
> > > there will be strange results.
> > >
> > > Cheers,
> > > Andrea
> > >
> > >
> > >
> > > --
> > > _______________________________________________________________________
> > >__ ___ HydroloGIS - Environmental Open Source Solutions
> > > www.hydrologis.com
> > >
> > > Andrea Antonello
> > > Environmental Engineer
> > > mobile: +393288497722
> > >
> > > "Let it be as much a great honour to take as to give learning,
> > > if you want to be called wise."
> > > Skuggsja' - The King's mirror - 1240 Reykjavik
> > > _______________________________________________________________________
> > >__ ___

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Change the rules, or the rules will change you
     ---------Kumaranasan

Andrea,
   I tried to compile r.wavelet, with the make file you provided.
What does the include head.mk and tail.mk means?

Anyway I endup with some error. Error is
           "Makefile:13: *** missing separator. Stop."
(I dont have idea about makefiles)
Can you send me the complete make file.
It will be helpful if you update the r.wavelet file in grass adons,
so that it can be straightly complied in grass6.

A binary distribution is also desired, if possible.........

Thanks.......
Bye
On 7/5/05, Sajith VK <sajithvk@gmail.com> wrote:

Thanks Andrea,
For the prompt and detailed reply.
I will test the module after two-three days.
I will let you know the details.
(And I may trouble you with more querries!!)

I think we need to develop some applications using
this wavelet module.(Like image fusion). People
way not require this module directly. But wavelet
transformation is a good tool for may remote sensing
analysis.

--
Sajith VK
"Freedom is not free"
On 7/4/05, Andrea Antonello <moovida@katamail.com> wrote:
> Alright, I did some check and will answer and correct myself.
>
> > Yes, I simply included the r.wavelet folder in my raster folder and
> > everything works.
>
> Not true, you will need a file makefile with the following in it:
>
> include head.mk
>
> PGM1=r.biowave.dec
> PGM2=r.owave.dec
> PGM3=r.biowave.rec
> PGM4=r.owave.rec
> OBJ1=$(OBJARCH)/biowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
> OBJ2=$(OBJARCH)/owave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
> OBJ3=$(OBJARCH)/ibiowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
> OBJ4=$(OBJARCH)/iowave2.o $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
> all: $(BIN)/$(PGM1) $(BIN)/$(PGM2) $(BIN)/$(PGM3) $(BIN)/$(PGM4)
>
> $(BIN)/$(PGM1):$(OBJ1) $(GISLIB)
> $(CC) $(LDFLAGS) -o $@ $(OBJ1) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
> $(BIN)/$(PGM2):$(OBJ2) $(GISLIB)
> $(CC) $(LDFLAGS) -o $@ $(OBJ2) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
> $(BIN)/$(PGM3):$(OBJ3) $(GISLIB)
> $(CC) $(LDFLAGS) -o $@ $(OBJ3) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
> $(BIN)/$(PGM4):$(OBJ4) $(GISLIB)
> $(CC) $(LDFLAGS) -o $@ $(OBJ4) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
> $(OBJ1):biowave2.h
> $(OBJ2):biowave2.h
> $(OBJ3):biowave2.h
> $(OBJ4):biowave2.h
> $(GISLIB):
>
> include tail.mk
>
>
> > Some lines of background (very fast, give me the chance :o)): the wavelet
> > filtering process creates from one map four maps of half of the resolution.
> > So every processing level takes map
> >
> > 1
> >
> > and creates four maps:
> >
> > 2_11, 2_12, 2_21, 2_22
> >
> > that have obviously same boundaries but different (half) resolution.
> > Next level takes the map of the lower resolution map
> >
> > 2_22 (the others contain the difference values in x, y and xy)
>
> This was wrong, the lower resolution one is in the *_11, i.e. 2_11. *_22 is
> the xy diagonal direction.
>
>
> Alright, now the solution comes, even if it's a workaround version. Please
> take into account that when these modules were written, I was at my very
> first programming and grassprogramming experiences.
>
> Btw, the fact is that the modules work only for floating point FCELLs, i.e.
> not for integers and not for doubles. This is for sure due to some casting
> problem I could not deal with at the time (I feel ashamed...).
>
> The working result can be seen on 6 levels of decomposition the concave-convex
> zones of an island (twice you can guess which one :)):
>
> http://www.hydrologis.com/testfiles/waveletsscreens/images.html
>
> Next question will be: when will you fix this?
> I'm very busy at the moment and will not be able to fix that soon (did you
> ever go through the code of a beginning programmer?). So the only way now is
> to deal with floating point maps. Sorry for that.
>
> Cheers,
> Andrea
>
>
>
>
>
>
>
>
>
>
>
>
> >
> > So the boundary are the same, but when I visualize, the result is the
> > following:
> >
> > http://www.hydrologis.com/testfiles/wavelet_pbl.png
> >
> >
> > The bigger map is the third level of wavelet decomposition of the smaller
> > map. The boundaries are the same, so I can't understand why the lower
> > resolution map gets stretched.
> >
> > In the last years did something change in the raster apis, which I missed?
> >
> > Sajith, can you try and tell me if you get the same results?
> >
> > Has anyone some hint? I'm not really happy to go through some code I didn't
> > open for years if it is not really necessary.
> >
> > > Also why r.wavelet is not part of grass6 distribution?
> >
> > I guess because they seem not to work at the time :slight_smile:
> > Honestly you are the second person that ask for multiresolution analysis in
> > 3 years, so I think that is why they are in the add-ons section.
> >
> > > Does it lacks something, like documentation?
> >
> > No, the manual pages were made properly and exaustive.
> >
> >
> > Hope this can be solved,
> > Cheers,
> > Andrea
> >
> > > On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:
> > > > Hi Sajith,
> > > >
> > > > > I am planing to do some image processing based on wavelet.
> > > > > I checked the r.wavelet module in the grass addon section, but it is
> > > > > made for grass 4(?). I wish to upgrade it to the present grass
> > > > > version.
> > > >
> > > > the modules were made for the grass5 version. I got in touch only once
> > > > again with the wavelets modules in grass6, where they gave some strange
> > > > output, but at that time I had no second free to understand what it
> > > > was. Since the raster api didn't change (someone correct me if it's not
> > > > true), those modules should work out of the box.
> > > >
> > > > > I am not a grass developer now, and I dont know the changes in grass
> > > > > libraries between version 4 and 6.
> > > > > Can some one guide me on how to proceed?
> > > >
> > > > What do you mean? Compilation into the release or usage?
> > > > The man pages in the package should fullfill the second.
> > > > However for a first quick use:
> > > > r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
> > > > filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and
> > > > sl05.ir) are with / at the end> NumRec=3
> > > >
> > > > This will perform a 3 step wavelets decomposition.
> > > > The maps will be created and the names are selfexplanatory.
> > > >
> > > > If I remeber correct, the starting map has to be floating point, else
> > > > there will be strange results.
> > > >
> > > > Cheers,
> > > > Andrea
> > > >
> > > >
> > > >
> > > > --
> > > > _______________________________________________________________________
> > > >__ ___ HydroloGIS - Environmental Open Source Solutions
> > > > www.hydrologis.com
> > > >
> > > > Andrea Antonello
> > > > Environmental Engineer
> > > > mobile: +393288497722
> > > >
> > > > "Let it be as much a great honour to take as to give learning,
> > > > if you want to be called wise."
> > > > Skuggsja' - The King's mirror - 1240 Reykjavik
> > > > _______________________________________________________________________
> > > >__ ___
>
> --
> ____________________________________________________________________________
> HydroloGIS - Environmental Open Source Solutions
> www.hydrologis.com
>
> Andrea Antonello
> Environmental Engineer
> mobile: +393288497722
>
> "Let it be as much a great honour to take as to give learning,
> if you want to be called wise."
> Skuggsja' - The King's mirror - 1240 Reykjavik
> ____________________________________________________________________________
>
>
> _______________________________________________
> grass5 mailing list
> grass5@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
>

--
Change the rules, or the rules will change you
     ---------Kumaranasan

--
Change the rules, or the rules will change you
     ---------Kumaranasan

Hy Sajith,

Andrea,
   I tried to compile r.wavelet, with the make file you provided.
What does the include head.mk and tail.mk means?

Anyway I endup with some error. Error is
           "Makefile:13: *** missing separator. Stop."
(I dont have idea about makefiles)
Can you send me the complete make file.

Glynn had warned us :slight_smile:

[snip]

For 5.x, you should write a Gmakefile, and let the "make makefiles"
stage generate the makefile, rather than trying to write the makefile
by hand.

My Gmakefile is the following:

PGM1=r.biowave.dec
PGM2=r.owave.dec
PGM3=r.biowave.rec
PGM4=r.owave.rec
OBJ1=biowave2.o biofunctions.o sconvolve.o
OBJ2=owave2.o biofunctions.o sconvolve.o
OBJ3=ibiowave2.o biofunctions.o sconvolve.o
OBJ4=iowave2.o biofunctions.o sconvolve.o
all: $(BIN)/$(PGM1) $(BIN)/$(PGM2) $(BIN)/$(PGM3) $(BIN)/$(PGM4)

$(BIN)/$(PGM1):$(OBJ1) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ1) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM2):$(OBJ2) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ2) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM3):$(OBJ3) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ3) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(BIN)/$(PGM4):$(OBJ4) $(GISLIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ4) $(GISLIB) $(MATHLIB) $(XDRLIB) $(RASTERLIB)
$(OBJ1):biowave2.h
$(OBJ2):biowave2.h
$(OBJ3):biowave2.h
$(OBJ4):biowave2.h
$(GISLIB):

I never used the "make makefiles" part. How to define the "makefiles" target?
Can someone help me?

It will be helpful if you update the r.wavelet file in grass adons,

yes, I will do that as soon as the makefile stuff is done.

so that it can be straightly complied in grass6.

A binary distribution is also desired, if possible.........

I have binaries for suse 9.3 and kubuntu.
But I guess they should not stay on the addons site.
I will think where to put them.

Cheers,
Andrea

Thanks.......
Bye

On 7/5/05, Sajith VK <sajithvk@gmail.com> wrote:
> Thanks Andrea,
> For the prompt and detailed reply.
> I will test the module after two-three days.
> I will let you know the details.
> (And I may trouble you with more querries!!)
>
> I think we need to develop some applications using
> this wavelet module.(Like image fusion). People
> way not require this module directly. But wavelet
> transformation is a good tool for may remote sensing
> analysis.
>
> --
> Sajith VK
> "Freedom is not free"
>
> On 7/4/05, Andrea Antonello <moovida@katamail.com> wrote:
> > Alright, I did some check and will answer and correct myself.
> >
> > > Yes, I simply included the r.wavelet folder in my raster folder and
> > > everything works.
> >
> > Not true, you will need a file makefile with the following in it:
> >
> > include head.mk
> >
> > PGM1=r.biowave.dec
> > PGM2=r.owave.dec
> > PGM3=r.biowave.rec
> > PGM4=r.owave.rec
> > OBJ1=$(OBJARCH)/biowave2.o $(OBJARCH)/biofunctions.o
> > $(OBJARCH)/sconvolve.o OBJ2=$(OBJARCH)/owave2.o
> > $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o
> > OBJ3=$(OBJARCH)/ibiowave2.o $(OBJARCH)/biofunctions.o
> > $(OBJARCH)/sconvolve.o OBJ4=$(OBJARCH)/iowave2.o
> > $(OBJARCH)/biofunctions.o $(OBJARCH)/sconvolve.o all: $(BIN)/$(PGM1)
> > $(BIN)/$(PGM2) $(BIN)/$(PGM3) $(BIN)/$(PGM4)
> >
> > $(BIN)/$(PGM1):$(OBJ1) $(GISLIB)
> > $(CC) $(LDFLAGS) -o $@ $(OBJ1) $(GISLIB) $(MATHLIB) $(XDRLIB)
> > $(RASTERLIB) $(BIN)/$(PGM2):$(OBJ2) $(GISLIB)
> > $(CC) $(LDFLAGS) -o $@ $(OBJ2) $(GISLIB) $(MATHLIB) $(XDRLIB)
> > $(RASTERLIB) $(BIN)/$(PGM3):$(OBJ3) $(GISLIB)
> > $(CC) $(LDFLAGS) -o $@ $(OBJ3) $(GISLIB) $(MATHLIB) $(XDRLIB)
> > $(RASTERLIB) $(BIN)/$(PGM4):$(OBJ4) $(GISLIB)
> > $(CC) $(LDFLAGS) -o $@ $(OBJ4) $(GISLIB) $(MATHLIB) $(XDRLIB)
> > $(RASTERLIB) $(OBJ1):biowave2.h
> > $(OBJ2):biowave2.h
> > $(OBJ3):biowave2.h
> > $(OBJ4):biowave2.h
> > $(GISLIB):
> >
> > include tail.mk
> >
> > > Some lines of background (very fast, give me the chance :o)): the
> > > wavelet filtering process creates from one map four maps of half of
> > > the resolution. So every processing level takes map
> > >
> > > 1
> > >
> > > and creates four maps:
> > >
> > > 2_11, 2_12, 2_21, 2_22
> > >
> > > that have obviously same boundaries but different (half) resolution.
> > > Next level takes the map of the lower resolution map
> > >
> > > 2_22 (the others contain the difference values in x, y and xy)
> >
> > This was wrong, the lower resolution one is in the *_11, i.e. 2_11.
> > *_22 is the xy diagonal direction.
> >
> >
> > Alright, now the solution comes, even if it's a workaround version.
> > Please take into account that when these modules were written, I was at
> > my very first programming and grassprogramming experiences.
> >
> > Btw, the fact is that the modules work only for floating point FCELLs,
> > i.e. not for integers and not for doubles. This is for sure due to some
> > casting problem I could not deal with at the time (I feel ashamed...).
> >
> > The working result can be seen on 6 levels of decomposition the
> > concave-convex zones of an island (twice you can guess which one :)):
> >
> > http://www.hydrologis.com/testfiles/waveletsscreens/images.html
> >
> > Next question will be: when will you fix this?
> > I'm very busy at the moment and will not be able to fix that soon (did
> > you ever go through the code of a beginning programmer?). So the only
> > way now is to deal with floating point maps. Sorry for that.
> >
> > Cheers,
> > Andrea
> >
> > > So the boundary are the same, but when I visualize, the result is the
> > > following:
> > >
> > > http://www.hydrologis.com/testfiles/wavelet_pbl.png
> > >
> > >
> > > The bigger map is the third level of wavelet decomposition of the
> > > smaller map. The boundaries are the same, so I can't understand why
> > > the lower resolution map gets stretched.
> > >
> > > In the last years did something change in the raster apis, which I
> > > missed?
> > >
> > > Sajith, can you try and tell me if you get the same results?
> > >
> > > Has anyone some hint? I'm not really happy to go through some code I
> > > didn't open for years if it is not really necessary.
> > >
> > > > Also why r.wavelet is not part of grass6 distribution?
> > >
> > > I guess because they seem not to work at the time :slight_smile:
> > > Honestly you are the second person that ask for multiresolution
> > > analysis in 3 years, so I think that is why they are in the add-ons
> > > section.
> > >
> > > > Does it lacks something, like documentation?
> > >
> > > No, the manual pages were made properly and exaustive.
> > >
> > >
> > > Hope this can be solved,
> > > Cheers,
> > > Andrea
> > >
> > > > On 7/3/05, Andrea Antonello <moovida@katamail.com> wrote:
> > > > > Hi Sajith,
> > > > >
> > > > > > I am planing to do some image processing based on
> > > > > > wavelet. I checked the r.wavelet module in the grass addon
> > > > > > section, but it is made for grass 4(?). I wish to upgrade it to
> > > > > > the present grass version.
> > > > >
> > > > > the modules were made for the grass5 version. I got in touch only
> > > > > once again with the wavelets modules in grass6, where they gave
> > > > > some strange output, but at that time I had no second free to
> > > > > understand what it was. Since the raster api didn't change
> > > > > (someone correct me if it's not true), those modules should work
> > > > > out of the box.
> > > > >
> > > > > > I am not a grass developer now, and I dont know the changes in
> > > > > > grass libraries between version 4 and 6.
> > > > > > Can some one guide me on how to proceed?
> > > > >
> > > > > What do you mean? Compilation into the release or usage?
> > > > > The man pages in the package should fullfill the second.
> > > > > However for a first quick use:
> > > > > r.biowave.dec input=<mapname> output=<outputname> filter1=sp02.ir
> > > > > filter2=sl05.ir filterpath=<folder where the filters (sp02.ir and
> > > > > sl05.ir) are with / at the end> NumRec=3
> > > > >
> > > > > This will perform a 3 step wavelets decomposition.
> > > > > The maps will be created and the names are selfexplanatory.
> > > > >
> > > > > If I remeber correct, the starting map has to be floating point,
> > > > > else there will be strange results.
> > > > >
> > > > > Cheers,
> > > > > Andrea
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > _________________________________________________________________
> > > > >______ __ ___ HydroloGIS - Environmental Open Source Solutions
> > > > > www.hydrologis.com
> > > > >
> > > > > Andrea Antonello
> > > > > Environmental Engineer
> > > > > mobile: +393288497722
> > > > >
> > > > > "Let it be as much a great honour to take as to give learning,
> > > > > if you want to be called wise."
> > > > > Skuggsja' - The King's mirror - 1240 Reykjavik
> > > > > _________________________________________________________________
> > > > >______ __ ___
> >
> > --
> > _______________________________________________________________________
> >_____ HydroloGIS - Environmental Open Source Solutions
> > www.hydrologis.com
> >
> > Andrea Antonello
> > Environmental Engineer
> > mobile: +393288497722
> >
> > "Let it be as much a great honour to take as to give learning,
> > if you want to be called wise."
> > Skuggsja' - The King's mirror - 1240 Reykjavik
> > _______________________________________________________________________
> >_____
> >
> >
> > _______________________________________________
> > grass5 mailing list
> > grass5@grass.itc.it
> > http://grass.itc.it/mailman/listinfo/grass5
>
> --
> Change the rules, or the rules will change you
> ---------Kumaranasan

--
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile: +393288497722

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

Andrea Antonello wrote:

> I tried to compile r.wavelet, with the make file you provided.
> What does the include head.mk and tail.mk means?
>
> Anyway I endup with some error. Error is
> "Makefile:13: *** missing separator. Stop."
> (I dont have idea about makefiles)
> Can you send me the complete make file.

Glynn had warned us :slight_smile:

> [snip]
>
> For 5.x, you should write a Gmakefile, and let the "make makefiles"
> stage generate the makefile, rather than trying to write the makefile
> by hand.

I never used the "make makefiles" part. How to define the "makefiles" target?
Can someone help me?

It's defined in the top-level Makefile (generated from mk/Makefile.in
when you run configure):

makefiles:
  @echo "making makefiles ..."
  -find ${SRCDIR} -name Gmakefile -print | \
    sed -e 's#^\(.*\)/Gmakefile#\1#' | \
    while read dir ; do \
      ${MAKE} $$dir/makefile >/dev/null ; \
    done

To build an individual makefile, it uses the rule:

%/makefile: %/Gmakefile
  sed -f ${SRCDIR}/mk/genmake.sed < $< > $@

Alternatively, you can use the mk/mkmakefiles script (in case you need
to do it when configure hasn't been run).

Note that the generated makefiles need to be able to include the
makefile fragments (head.mk etc) from the source and build
directories. The top-level Makefile uses the following command for
building each directory (it expects the current directory to be the
top-level build directory, not the source directory):

  mkdir -p $$dir ; \
  ${MAKE} -I${DSTDIR}/mk -I${SRCDIR}/mk -C ${SRCDIR}/$$dir -f makefile || \
    echo "Compilation error in module: $$dir" >> ${ERROR_LOG} ; \

All in all, it's a lot easier to put your code into the GRASS source
tree then use the gmake53 script to build additional directories.

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