Opened 3 years ago
Last modified 7 months ago
#3269 new defect
r.roughness.vector: bug in rescale formula
Reported by: | sbl | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | Addons | Version: | |
Keywords: | r.roughness.vector | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
There is a little bug in the formula that produces the "Fischers K" output (line 317). "- 1" should not be in there.
Attachments (1)
Change History (12)
Changed 3 years ago by
Attachment: | rescale_formula.diff added |
---|
comment:1 Changed 3 years ago by
comment:2 follow-up: 3 Changed 3 years ago by
Yes, same issue there. For what I can see, line 265 in https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector.sh should be changed equally like this:
- r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window - 1)" + r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window)"
Result should be scaled from 0 to 1. Thus formula should be:
V' = (max(V[i-j]) - V) / max(V[i-j]
comment:3 Changed 3 years ago by
Replying to sbl:
Yes, same issue there. For what I can see, line 265 in https://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.roughness/r.roughness.window.vector.sh should be changed equally like this:
- r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window - 1)" + r.mapcalc $FISHER = "($window * $window - $STRENGTH) / ($window * $window)"Result should be scaled from 0 to 1. Thus formula should be:
V' = (max(V[i-j]) - V) / max(V[i-j]
Could you ping Carlos, the author of both addons, regarding this issue?
comment:4 Changed 3 years ago by
Hi there, sorry for the late reply.
I went looking in the paper by Hobson (1972), and the original formula for Fischer K is: (N-1)/(N-R), but in the module (and in my paper) I used the *inverse* of it (so smooth areas would end up with a low value). Inverting the formula gives (N-R)/(N-1).
comment:5 Changed 3 years ago by
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:8 Changed 2 years ago by
Milestone: | → 7.2.4 |
---|
comment:10 Changed 15 months ago by
Component: | Default → Addons |
---|---|
Keywords: | AddOn removed |
Milestone: | 7.2.4 |
Version: | unspecified |
comment:11 Changed 7 months ago by
Milestone: | → 7.8.3 |
---|
Replying to sbl:
It's a port of g6 addon: https://grass.osgeo.org/grass64/manuals/addons/r.roughness.window.vector.html
Could you have a look how the calculation is there?