17
CLOUD DETECTION AND REMOVAL TECHNIQUES FOR LANDSAT 8 IMAGERY WITH GPU ACCELERATION 2016衛星影像處 / B10209047 / 倪鈵斯

Landset 8 的雲層去除技巧實作

  • Upload
    -

  • View
    44

  • Download
    1

Embed Size (px)

Citation preview

  • CLOUD DETECTION AND REMOVAL TECHNIQUES FOR LANDSAT 8 IMAGERYWITH GPU ACCELERATION 2016 / B10209047 /

  • INTRODUCTION

  • Abstract

    Cloud Detection and Removal Techniques for Landsat 8 ImageryPrevious WorkNvidia CUDA

    CPUGPU

    VS

  • Previous Workhttp://wiki.theoutpost.io/files/remote-sensing/hallahan-prepperneau-geo544-final-abstract.pdf

    http://wiki.theoutpost.io/files/remote-sensing/hallahan-prepperneau-geo544-final-abstract.pdfhttp://wiki.theoutpost.io/files/remote-sensing/hallahan-prepperneau-geo544-final-abstract.pdf

  • Previous WorkACCALandset-8Quality Assessment BandsLandset-8

    RGB

  • Previous WorkRGBCoastal Aerosol Band

    Band Number Name m Resolution

    1 Coastal / Aerosol 0.4330.453 30 m

    2 Visible Blue 0.4500.515 30 m

    3 Visible Green 0.5250.600 30 m

    4 Visible Red 0.6300.680 30 m

    5 Near Infrared 0.8450.885 30 m

  • Previous Work

    Coastal Aerosol Band

  • CUDAhttps://documen.tician.de/pycuda/array.html

    https://documen.tician.de/pycuda/array.html

  • CUDA

    CPU

    GPU

  • IMPLEMENT

  • Get the Target Imageband_a = rasterio.open(image_file_path.format(scene_id, 1))band_g = rasterio.open(image_file_path.format(scene_id, 3))

    x_min, x_max, y_min, y_max = ( 354479.71320833557, 395642.8506635118, 2764434.5394466477, 2702420.0095054144)

    gt = band_a.get_transform()x_min, x_max = floor((x_min - gt[0]) / gt[1]), ceil((x_max - gt[0]) / gt[1])y_min, y_max = floor((y_min - gt[3]) / gt[5]), ceil((y_max - gt[3]) / gt[5])

    band_a, band_g = ( gpuarray.to_gpu( band_a.read(1, window=((y_min, y_max), (x_min, x_max))).astype(float) ), gpuarray.to_gpu( band_g.read(1, window=((y_min, y_max), (x_min, x_max))).astype(float) )) GPU

  • Correction

    correct = ElementwiseKernel( "double *band_a, double *band_g, double *result", "result[i] = band_a[i] + ((1 / 4.0) * (band_a[i] - band_g[i]) / band_g[i])", "correct")correct(band_a, band_g, result)

    GPU

    result = band1 + (1 / 4.0) * (band1 - band3) / band1

    CPU

  • Bubble Sortcmp_swap = ElementwiseKernel( "double *x, double *y, char *xx, char *yy", ''' if(x[i] > y[i]) { double tmp_d; char tmp_u; tmp_d = x[i]; x[i] = y[i]; y[i] = tmp_d; tmp_u = xx[i]; xx[i] = yy[i]; yy[i] = tmp_u; } ''', cmp_swap")

    for j in range(len(images)-1, 0, -1): for i in range(0, j): cmp_swap(images[i], images[j], images_index[i], images_index[j])

    GPUCPU times: user 1.42 s, sys: 460 ms, total: 1.88 s Wall time: 1.99 s

  • Bubble Sort

    def cmp_swap(x, y, xx, yy): shape_y, shape_x = x.shape for i in range(shape_y): for j in range(shape_x): if x[i, j] > y[i, j]: x[i, j] , y[i, j] = y[i, j], x[i, j]

    for j in range(len(images)-1, 0, -1): for i in range(0, j): cmp_swap(images[i], images[j], images_index[i], images_index[j])

    CPUSpend too much time. Details are as Evaluation

  • EVALUATION

  • Evaluation

    mnkGPU1.99CPU5000

    0

    1250

    2500

    3750

    5000

    5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85

    CPU GPU

  • ENDTHANK YOU FOR YOUR ATTENTION