Opened 10 years ago

Closed 10 years ago

#5049 closed enhancement (fixed)

[PATCH] new warp algorithms - mode and average

Reported by: etourigny Owned by: etourigny
Priority: normal Milestone: 1.10.0
Component: Algorithms Version: unspecified
Severity: normal Keywords: warp
Cc: antonio, warmerdam, Even Rouault

Description (last modified by etourigny)

I have implemented mode and average warping algorithms, based on those used in overview creation. This code has been tested on a few datasets (see attachments) with all datatypes (Byte, Int, Float) but not all cases have been looked into (e.g. color tables, various projections). Any feedback and testing would be appreciated.

Attachments (4)

warp_average_mode.txt (20.8 KB ) - added by etourigny 10 years ago.
patch
tmp1-byte.tif (78.8 KB ) - added by etourigny 10 years ago.
test data
tmp-30-byte.tif.gz (145.1 KB ) - added by etourigny 10 years ago.
test data (0s and 1s)
warp_average_mode3.txt (21.7 KB ) - added by etourigny 10 years ago.
optim and cleanup

Download all attachments as: .zip

Change History (17)

by etourigny, 10 years ago

Attachment: warp_average_mode.txt added

patch

by etourigny, 10 years ago

Attachment: tmp1-byte.tif added

test data

by etourigny, 10 years ago

Attachment: tmp-30-byte.tif.gz added

test data (0s and 1s)

comment:1 by etourigny, 10 years ago

Description: modified (diff)
Summary: [PATCH] new warp methods - mode and average[PATCH] new warp algorithms - mode and average

comment:2 by etourigny, 10 years ago

Description: modified (diff)

comment:3 by etourigny, 10 years ago

There are still some comments in there, because some transparency/nodata issues have not been fully tested.

comment:4 by antonio, 10 years ago

Cc: antonio added

comment:5 by etourigny, 10 years ago

Cc: warmerdam Even Rouault added

Adding Frank and Even in CC, perhaps one of you could give some feedback? (esp. Frank which is the original author).

I am hesitant on a few issues - please look into the TODO comments if you have the time and inclination.

by etourigny, 10 years ago

Attachment: warp_average_mode3.txt added

optim and cleanup

comment:6 by warmerdam, 10 years ago

Regarding the TODOs:

  • The outer loop check of the unified mask is not appropriate for these algorithms since there are multiple input points per output point, so just remove the commented out code.
  • The chunk nodata mask is not meaningful in the warp context and that commented out code can be removed.

The code looks good. I'd encourage you to go ahead and commit it.

comment:7 by etourigny, 10 years ago

ok Frank thanks! am I right to assume this would make it into 1.10 ? If so, I will update docs also.

comment:8 by warmerdam, 10 years ago

Please do update the docs too. Yes, it seems it will be in 1.10.

comment:9 by etourigny, 10 years ago

commited in r25884 with updated docs

comment:10 by Even Rouault, 10 years ago

The pabSuccess array isn't used currently to determine if a target pixel can be computed. Furthermore there should likely be a pabSuccess and pabSuccess2.

comment:11 by etourigny, 10 years ago

added autotests in r25891

comment:12 by etourigny, 10 years ago

added optimization for int16 - uses the same code as for byte data (r25895 and 25896)

comment:13 by Even Rouault, 10 years ago

Milestone: 1.10.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.