Research Article
Detection of Image Seam Carving Using a Novel Pattern
Algorithm 1
The LNMOP descriptor construction.
(1) | Input: Grayscale image (I) | (2) | Output: Descriptor (LNMOP) | (3) | Initial: t ⟵ 0, tol ⟵ [], r ⟵ 1 | (4) | Begin | (5) | [m, n] ⟵ size(I) | (6) | k ⟵ ⌈ log2(2r + 1)2⌉ | (7) | For i ⟵ −r: r | (8) | For j ⟵ −r: r | (9) | t = t + 1 | (10) | temp (1: m, 1: n) = P (r + i + 1: m − r + i, r + j + 1: n − r + j) | (11) | if (i ! = 0) || (j ! = 0) then | (12) | mag(1: (2r + 1)2 − 1) = intensity (P (r + i + 1, r + j + 1))- intensity (P(r + 1, r + 1)) | (13) | end if | (14) | end | (15) | end | (16) | λ ⟵ 2r + 1 | (17) | l(1: (2r + 1)2− 1) = level (max (mag), min (mag), λ, mag) //Determination of the magnitude level l | (18) | For l ⟵ 1: λ | (19) | if temp = = l then | (20) | temp1 ⟵ l | (21) | end if | (22) | temp2 ⟵ sum (temp1) //The number of occurrences for the magnitude level l | (23) | temp3 ⟵ dec_to_bin (temp2, k) //Decimal to binary with k bits | (24) | tol ⟵ [tol, temp3] //Concatenation | (25) | end | (26) | LNMOP ⟵ tol/sum(tol) //Normalization | (27) | return LNMOP | (28) | end |
|