|
Algorithm 1: The training part of the soft compression algorithm for gray image. |
Input:W images with size
Output: The codebook for the shape layer and detail layer
Preprocess: predictive coding, negative-to-positive mapping and layer separation
forZ← 1 to
W do do
for matrx size ←to, image coordinate ←to do
if satisfies (48) and (49) then
Get the shape
if
S in the codebook then
Update the frequency of S in the codebook
else
Add S to the codebook
end if
end if
end for
Remove low-weight shapes based on frequency and size
Count the distribution of pixel values in the detail layer
end for
Generate the codebooks
|