| Objective: To set a category for each pixel in an image |
| Input: Pre-processed Image (P) |
| Output: Segmented image (P’) |
| 1: Initialize αt , σ // Parameters |
| 2: for each pixel xt in P do |
| 3: Calculate q(xt |P) using Eq. (9) |
| 4: Train segmentation model with the loss function L defined in Eq. (10) |
| 5: Update xt-1 using Eq. (11) to refine patches iteratively |
| 6: if the end of the iteration, then |
| 7: Apply function f to xt with parameter σ // Final segmentation |
| 8: Set the corresponding pixel in P’ to the segmented result |
| 9: end if |
| 10: Output the final segmented image P’ using Eq. (12) |
| 11: end for |
| 12: Return P’ // Return segmented image |