Research Article
Foggy Scene Rendering Based on Transmission Map Estimation
Pseudocode 1
The pseudocode of the label assignment using gco-v3.0 library.
Input: Input image . Output: Each pixel label in initial transmission map | 1. // Create new object | Set NumSites = and NumLabels = 32; = GCO_Create(NumSites, NumLabels); | 2. // Compute data term | (2.1) Convert color image into a gray image and express it in one-dimensional array Data; | (2.2) for = NumLabels | for = NumSites | ; | end | end | (2.3) GCO_SetDataCost(, DataTerm); | 3. // Compute smooth term | (3.1) for = NumLabels | for = NumLabels | if | ; | else | ; | end | end | end | (3.2) GCO_SetSmoothCost(, SmoothTerm); | 4. // Compute the cost of the labeling | (4.1) for = NumSites − 1 | if | ; | end | end | (4.2) GCO_SetNeighborCost(, NeighborCost); | 5. // Compute optimal labeling via -expansion | (5.1) GCO_Expansion(); | (5.2) Label = GCO_GetLabeling(); | (5.2) Covert Label which is a one-dimensional array into a array, that is the output pixel label . |
|