README.md 4.21 KB
Newer Older
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
1
# High Performance and Disruptive Computing in Remote Sensing
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
2

Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
3
Summer school 30 May - 2 June 2022. 
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
4

Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
5
Use Case: Stencil computation applied to remote sensing hyperspectral preprocessing on shared memory systems using OpenMP
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
6

Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
7
8
9
## Abstract

In parallel programming we frequently find computing patterns that are common in parallel algorithms. An example is the stencil computation where each output element is computed with data from its neighborhood defined by a mask. For this computation the number of operations per pixel is very large. We will see in this use case how to speed up two common pre-processing steps in hyperspectral analysis using OpenMP, from spectral feature reduction using wavelets to morphological profiles by means of the same parallel pattern.”   
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
10
## Getting started
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
11

12
13
14
A good point to start the HDCRS Summer School - Day 2 - May 31, 2022 recorded session available online at https://www.youtube.com/watch?v=55E9DyoMs1k. Move forward until time 1:01:23.

The bibliography has some papers related directly to the use case. It is a good reading to enjoy an evening taking a coffee.
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

## Prerequisites

* A shared memory multiprocessors: your personal computer, a single node of a cluster (Finisterrae III for example)
* A compiler with OpenMP support: GNU, Intel, ...
## Compile 
```
g++ WT-EMP-Scheme.c -O2 -fopenmp -lm -o WT-EMP-Scheme
```

## Execute
```
./WT-EMP-Scheme data/PaviaUniversityPV.raw 5
```

30
You need a hyperspectral image in raw format and stored as pixel vectors. You can find the well-know image of Pavia University in that format in the `data/` folder.
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
31

32
You must specify the number of times you want to reduce the spectral dimensionality to a half as the second parameter.
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
33

34
This version create a fixed Morphological Profile with 8 opening and 8 closing for each spectral band.
Pablo Quesada Barriuso's avatar
Pablo Quesada Barriuso committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

## Output

You will see some information in the terminal when execution this use case. This version saves the first hyperspectral band after the feature reduction and the first opening and last closing of the first featured reduced band for a visual inspection.

The following is just an example:

```
[info] Using 2 of 8 thread(s) available in this machine [nebuchadnezzar]
[info] Wall-clock time measured in seconds
(TIME) Load data from file	0.156726 sg
(CONFIG) OMP_NUM_THREADS : 2
(CONFIG) OMP_CHUNK_SIZE  : 103700
(TIME) 1D-DWT (COMPUTATION)	0.297752 sg
(INFO) HSI (NROWS x NCOLS x BANDS) 207400 x 4 to 610 x 340 x 4
(TIME) ROWS TO HSI	0.009829 sg
(TIME) NORMALIZE 1D-DWT	0.004103 sg
[info] Saved 'h_dwt_u8.pgm', 340 x 610 (207400 pixels) (202 Kb)
(CONFIG) OMP_NUM_THREADS : 2
(CONFIG) OMP_CHUNK_SIZE  : 2
(TIME) 2D-EMP_CPU (COMPUTATION)	3.563680 sg
(TIME) NORMALIZE EMP	0.095508 sg
[info] Saved 'h_emp_opening_u8.pgm', 340 x 610 (207400 pixels) (202 Kb)
[info] Saved 'h_emp_closing_u8.pgm', 340 x 610 (207400 pixels) (202 Kb)
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
```

## Bibliography

[1] Quesada-Barriuso, P. Argüello, F., Heras D. B., Benediktsson, J. A., "Wavelet-Based Classification of Hyperspectral Images Using Extended Morphological Profiles on Graphics Processing Units," in IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 8, no. 6, pp. 2962-2970, June 2015, doi: 10.1109/JSTARS.2015.2394778.

[2] T.G. Mattson, B.A. Sanders and B.L. Massingill, Patterns for Parallel Programming, Addison-Wesley, 2005.

[3] Kirk, D. B., & Wen-mei, W. H. (2013). Programming massively parallel processors: a hands-on approach. Morgan Kaufmann Publishers.

[4] Benediktsson, J. A., Palmason, J. A., & Sveinsson, J. R. (2005). Classification of hyperspectral data from urban areas based on extended morphological profiles. IEEE
Transactions on Geoscience and Remote Sensing, 43(3), 480-491.

[5] Vincent, Luc., "Morphological grayscale reconstruction in image analysis: Applications and efficient algorithms." Image Processing, IEEE Transactions on 2.2 (1993): 176-201.

## Pavia University Hyperspectral Image
The Pavia University hyperspectral image was provided by Prof. Paolo Gamba from the Telecommunications and Remote Sensing Laboratory, Pavia university (Italy). 

This is image is hosted in the Hyperspectral Remote Sensing Scenes collected by: M Graña, MA Veganzons, B Ayerdi.

The version included in this repository is in stored as pixel vector using 4 bytes per value in a raw format.