brycefrank / pyfor

Tools for analyzing aerial point clouds of forest data.
MIT License
93 stars 19 forks source link

scipy median filter 2d for better performance #33

Closed bw4sz closed 5 years ago

bw4sz commented 5 years ago

see #31

bw4sz commented 5 years ago

it would be nice to merge this into master as well, so I can use it without having to deal with pending downstream changes?

brycefrank commented 5 years ago

Ben, a quick update. I will plan on pushing to master if we can fix this test. It looks like 2D median filter is a bit pickier in terms of data types. It might be an artifact of the tests or a real bug, so I will need to look into it. I have some time tonight, but no guarantees.

======================================================================
ERROR: test_detect (pyfortest.test_pyfor.LayerStackingTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/brycefrank/pyfor/pyfortest/test_pyfor.py", line 409, in test_detect
    self.test_filter.detect()
  File "/home/travis/build/brycefrank/pyfor/pyfor/detection.py", line 276, in detect
    raster = self.get_overlap_map(smoothed=True)
  File "/home/travis/build/brycefrank/pyfor/pyfor/detection.py", line 263, in get_overlap_map
    raster.pit_filter(kernel_size=kernel_size)
  File "/home/travis/build/brycefrank/pyfor/pyfor/rasterizer.py", line 296, in pit_filter
    self.array = medfilt2d(self.array, kernel_size=kernel_size)
  File "/home/travis/miniconda/envs/pyfor_env/lib/python3.6/site-packages/scipy/signal/signaltools.py", line 1167, in medfilt2d
    return sigtools._medfilt2d(image, kernel_size)
ValueError: 2D median filter only supports uint8, float32, and float64.
brycefrank commented 5 years ago

See https://github.com/brycefrank/pyfor/pull/35

I will work on getting 35 into master now.