Algorithm 1. CP-ACGAN |
Step 1: Reading the image f and the area mask M; Step 2: According to the ACGAN model, the structure image of u is obtained by image f; Step 3: Determine the set of image pixels on the to be classified on the boundary of S; Step 4: For the structural image u and p to be patched, each is centered from an image slice. According to Equation (13), the confidence item C(p) is calculated. According to Equation (14), data item D(p) is calculated, while priority P(p) is calculated according to Equation (15). Step 5: Determine the highest priority point P, as well as the corresponding image block W in the corresponding , and record the location of . Step 6: According to the optimization model from Equation (16), we determine the optimal matching block and location information in , then replace with to complete the repair of p point’s image slices. Meanwhile, in the u of structural components, we have used images to replace the corresponding images of p points corresponding to u. Step 7: Update M and ; Step 8: Determine whether the mask M is empty. If it is empty, the algorithm ends; otherwise, return to step 3. |