| | Input: grayscale cover image I, secret si, as one bit of the secret message S, and threshold TH | | | Output: stego image I1 | | | for each pixel I (i, j) (except for the pixels in the last column and the last row) | | | Scan in the raster scan order; | | | Calculate the prediction error of I (i, j) as Pe (i, j) with equations (1) and (2); | | | Generate PEH of I, PK = 2 × TH, PKl = 2 × PK; | | | Find out zero bins and denote them as Zrn and Zlm; | | | /right expanding and shifting/ | | | if | | | Δbin (i, j) = + TH + si; | | | elseif | | | Δbin (i, j) = PK − n, where ; | | | else | | | Δbin (i, j) = 0; | | | endif; | | | I1r (i, j) = I (i, j) + Δbin (i, j); | | | end; | | | /finish right and begin left expanding and shifting/ | | | for each pixel I1r (i, j) | | | Per (i, j) = I1r (i, j) − P (i, j) = I (i, j) + Δbin (i, j) − P (i, j) = + Δbin (i, j); | | | if | | | Δbinl (i, j) = Per (i, j) − TH − PK − ; | | | elseif Per (i, j) < −TH | | | Δbinl (i, j) = −PKl + m, where , ; | | | else | | | Δbinl (i, j) = 0; | | | endif; | | | I1 (i, j) = I1r (i, j) + Δbinl (i, j); | | | Pel (i, j) = + Δbin (i, j) + Δbinl (i, j); | | | end; | | | /finish embedding process 1/ |
|