In this article, we observe the influence of two rotation operations on the NMF image hashing algorithm [20], that is, an image rotation operation will modify the content of an image block in two aspects: (1) pixel magnitude distortion due to the interpolation in the rotation [23] and (2) phase change. The NMF hashing algorithm [20] can overcome the magnitude distortion since the distortion in amplitude can be taken as an additive noise, but it is very sensitive to the phase change due to the rotation because the image block in content has been modified. The bigger rotation angle is performed, the more distortion in the block will be introduced. Towards the effect, in this section we will analyze the impact of a rotation processing operation on an image and its blocks in both theoretical and experimental ways. Furthermore, we propose a restricted random blocking strategy for the algorithm [20] so as to improve the rotational robustness while remaining its resistance to other attacks.

### 3.1. An image after rotation

There are two different modes of image rotation processing operations: '*loose*' based and '*crop*' based [24]. For the *loose*-based rotation mode, output images have a bigger size but the original image content in size remains unchanged; In *crop*-based rotation mode, output images have the same size as input image, but include only the central portion of the rotated image. The influence factors of the two rotation modes on an image are described as follows.

#### 3.1.1. Rotation with the loose mode

We can see that under this mode of rotation, output images have a bigger size than the rotated image. As shown in Figure 2, two resulted images with different angles plotted in Figure 2b,c have a bigger size than the original one as shown in Figure 2a. The basic reason is that, after the rotation some redundant pixels (black regions with zero-value pixels) are padded in four homogeneous areas of the rotated image. These homogeneous regions can be processed by using line detection techniques [25]. It is worth noting that Figure 2e,f in content is more rich than the original image after a size normalization. The size normalization operation in reference [20] was applied to deal with all images from the same source to the same size so that the images can be blocked for hashing. In referring to Figure 2, we can figure out that the loose rotation operation will make a serious affection on the hashing algorithm [20] since all image blocks in content will be modified due to the phase distortion.

In order to eliminate the effect of the padded pixels (caused by the loose rotation) on image blocks, our strategy is to apply only the central content of an candidate image for block-based hashing, such as the circled region marked in Figure 2d. In such a way, we can avoid the effect of the resulted redundant pixels. For the rotated images as plotted in Figure 2e,f, only the central part in the blue circle is chosen for hashing.

For a clear description, in this article we denote the circle radius in Figure 2d as the radius of Effective Block Region (EBR), in length *R*. According to the principle of geometry mathematics, the *R* value can be derived from the following Equations (8) and (9).

Denote the original image as □*ABCD*, which is rotated by using the "loose" mode with the angle *θ*, and then be normalized to the same size as the original one. As shown in Figure 3, the square □*EFGH* is the rotated version of □*ABCD* with the loose mode. In this case, the difference between □*ABCD* and □*EFGH* indicates the resulted redundant pixels. In referring to Figure 3, we have the following the geometric relationships:

\left\{\begin{array}{c}\hfill \overline{EF}\cdot \text{cos}\theta +\overline{FG}\phantom{\rule{0.3em}{0ex}}\cdot \phantom{\rule{0.3em}{0ex}}\text{sin}\theta =\overline{AB}\hfill \\ \hfill \overline{EF}\cdot \text{sin}\theta +\overline{FG}\phantom{\rule{0.3em}{0ex}}\cdot \phantom{\rule{0.3em}{0ex}}\text{cos}\theta =\overline{BC},\hfill \end{array}\right.

(8)

\left\{\begin{array}{c}\hfill \overline{EF}=\frac{\overline{AB}\cdot \text{cos}\theta -\overline{BC}\cdot \text{sin}\theta}{cos\left(2\theta \right)}\hfill \\ \hfill \overline{EF}=\frac{\overline{BC}\cdot \text{cos}\theta -\overline{AB}\cdot \text{sin}\theta}{cos\left(2\theta \right)},\hfill \end{array}\right.

(9)

So R=\frac{1}{2}\overline{FG} since the line \overline{FG} in length is shorter than \overline{EF}.

We can see from Figure 3 and the *R* expression that for overcoming the impact of the redundant pixels caused by the rotation, we should select the central content of an image for block-based hashing. For the different rotation angle, the central content is different. Supposed the rotation angle *θ* is between zero and 45° (for other rotation angles, the analysis is similar). The bigger rotation angle is, the EBR radius (*R*) should be smaller so as to guarantee the block-based hash value resistant to the loose rotation operation.

#### 3.1.2. Rotation with the crop mode

In order to better depict the effect of the crop rotation, here we adopt the well-known image '*Lena*' as another example image. From Figure 4, we can observe the effect of the crop rotation on the image, that is, output images have the same size as input image and include only the central portion of the rotated image. Under the rotation, part of the content is cropped (replaced by zero-value pixels). For different rotation angles, the cropped pixels (replaced by zero-value pixels) in number are different, corresponding to the content in the white circle of the subplots in Figure 4b,c.

Considering the effect of the rotation mode, our strategy is to extract the region as shown in the circle in Figure 5 for blocking. Suppose that the square □*ABCD* denotes the original image, then the square □*EFGH* is the one rotated. According to our analysis, the circle is the region computed for blocking in such a way that a block-based hashing can avoid the effect of those pixels (to be cut and then filled by zero-value pixels).

### 3.2. An block after rotation

In the Section 1, we have analyzed the effect of rotation with two different modes on an image. Furthermore, in this section we are going to investigate the effect of the two rotation processing operations on an image block.

From the above analysis regarding the crop rotation mode, we have known that the rotation operation modifies the phase of pixels in the EBR (The amplitude distortion due to the interpolation is minor [23]). Therefore, there are existing public pixels before and after the rotation. A public pixel means that a pixel is still fallen into the same block under the rotation. It is worth noting that the ratio of these public pixels to the pixels in a block has an important role for the robustness of the NMF-based hashing algorithm [20]. This has been fully proven in Section 4 with extensive testing.

In order to find a better way to block an image for hashing, in theoretical way we are going to measure the ratio of public pixels in an image block after a rotation operation. The image blocks can be divided into two categories: (1) the image center in the block and 2) the center not in the block. The effect of the rotation on a block is respectively discussed as follows.

#### 3.2.1. Case 1: image center in the block

In Figure 6, the point *O* denotes the center of the EBR of an image. Suppose □*ABCD* is an image block, after image rotation of *θ*° the pixels in the □*ABCD* will be shifted to the □*EFGH*. For the block □*ABCD*, the ratio of public pixels against the block pixels after the rotation is equal to the ratio of the polygon *P*'*KN*'*GLD* to the block in area (\overline{AD} crosses \overline{EF} at {P}^{\prime},\overline{OQ} crosses \overline{EF} at P,\overline{FG} crosses \overline{AB} at {N}^{\prime},\overline{OT} crosses \overline{AB} at *N*). From the expressions: \overline{KN}=\overline{AN}-\overline{AK}, \overline{KP}=\overline{FP}-\overline{FK}, \overline{AK}=\overline{FK} and \overline{AN}=\overline{FP}, we have \overline{KN}=\overline{KP}. As a result, we conclude that the line \overline{OK} is the bisector of the angle ∠*PON*. Similarly, we can prove *OL* is ∠*PON*'s bisector. According to the geometric relations \overline{AK}=\overline{AN}-\overline{KN} and \overline{KN}=\overline{ON}\phantom{\rule{0.3em}{0ex}}\cdot \phantom{\rule{0.3em}{0ex}}\text{tan}\frac{\theta}{2}, the area of the triangle Δ *AKP'* is

{S}_{AK{P}^{\prime}}=\frac{1}{2}\cdot |\overline{AK}{|}^{2}\cdot \text{tan}\theta ,

(10)

Similarly, we have:

{S}_{LGM}=\frac{1}{2}\cdot |\overline{LG}{|}^{2}\cdot \text{tan}\theta ,

(11)

where \overline{LG}=\overline{UG}-\overline{UL} and \overline{UL}=\overline{UO}\phantom{\rule{0.3em}{0ex}}\cdot \text{tan}\frac{\theta}{2}. The area of trapezoidal A{N}^{\prime}MD is:

\begin{array}{c}{S}_{A{N}^{\prime}MD}=\frac{1}{2}\left(\overline{AK}+\overline{\frac{KF}{\mathrm{cos}\theta}}+\frac{\overline{LG}}{\mathrm{cos}\theta}\right)\xb7\overline{AD}\\ =\frac{1}{2}\left(\overline{AK}+\overline{LG}\right)\left(1+\frac{1}{\mathrm{cos}\theta}\right)\xb7\overline{AD}\end{array}

(12)

Therefore, the area of hexagon {P}^{\prime}K{N}^{\prime}GLD is:

{S}_{{P}^{\prime}K{N}^{\prime}GLD}={S}_{A{N}^{\prime}MD}-{S}_{AK{P}^{\prime}}-{S}_{LGM},

(13)

Suppose that the distance of the block center to the image center *O* is *R*_{1}, the block is a square in size *a × a*, then the overlapped area (public pixels) between □*ABCD* and □*EFGH* can be computed as:

{S}_{PKNGLD}=\frac{1}{2}\left(\overline{AK}+\overline{LG}\right)\left(1+\frac{1}{\text{cos}\theta}\right)\phantom{\rule{0.3em}{0ex}}\cdot a-\frac{1}{2}\cdot |\left(\overline{AK}{|}^{2}+\overline{LG}{|}^{2}\right)\phantom{\rule{0.3em}{0ex}}\cdot \phantom{\rule{0.3em}{0ex}}\text{tan}\theta ,

(14)

where : \overline{AK}=\frac{a}{2}-\left({R}_{1}+\frac{a}{2}\right)\cdot \text{tan}\frac{\theta}{2}, \overline{LG}=\frac{a}{2}-\left({R}_{1}-\frac{a}{2}\right)\cdot \text{tan}\frac{a}{2}, when {R}_{1}>\frac{a}{2}.

#### 3.2.2. Case 2: image center not in the block

We can see from Figure 7 that in this case, the overlapped region is the octagon *VILSQNUT*, which is:

{S}_{VILSQNUT}\mathsf{\text{=}}{S}_{ALMD}\mathsf{\text{{}}{S}_{AiV}\mathsf{\text{{}}{S}_{NGM}\mathsf{\text{{}}2{S}_{SQG}\mathsf{\text{,}}

(15)

According to the geometric expressions: \overline{AK}=\overline{JF}\overline{AI}=\overline{IF}, we have \overline{IK}=\overline{IJ}. So, we conclude that the line \overline{OI} is the bisector of the angle ∠*JOK*.

Similarly, we can prove that the line \overline{ON} is ∠*XOP'* s bisector. So, we have

\left\{\begin{array}{c}\hfill \overline{AK}=\overline{OK}\cdot \text{tan}\frac{\theta}{2}\hfill \\ \hfill \overline{NP}=\overline{OP}\phantom{\rule{0.3em}{0ex}}\cdot \phantom{\rule{0.3em}{0ex}}\text{tan}\frac{\theta}{2},\hfill \end{array}\right.

(16)

{S}_{AIV}=\frac{1}{2}\cdot |\overline{AI}{|}^{2}\cdot \text{tan}\theta ,

(17)

where \overline{AI}=\overline{AK}-\overline{IK}. Similarly, we have

{S}_{NGM}=\frac{1}{2}\cdot |\overline{NG}{|}^{2}\cdot \text{tan}\theta ,

(18)

where *NG* = *NP* + *PG*. And

{S}_{SQG}=\frac{1}{2}\cdot |\overline{SG}{|}^{2}\cdot \text{tan}\theta ,

(19)

where \overline{SG}=\overline{FG}-\overline{FL}-\overline{LS}, \overline{FL}=\overline{AI}\cdot \text{tan}\theta, and \overline{LS}=\overline{\frac{LB}{\text{sin}\theta}}=\frac{1}{\text{sin}\theta}\left[\overline{AB}-\overline{AI}\left(1+\frac{1}{\text{cos}\theta}\right)\right].

At the same time, we have

{S}_{ALMD}=\frac{1}{2}\left(\overline{AL}+\overline{MD}\right)\cdot \overline{AD},

(20)

where \overline{AL}=\overline{AI}\left(1+\frac{1}{\text{cos}\theta}\right), \overline{MD}=\overline{DC}+\overline{CM}, \overline{CM}=\overline{\frac{NG}{\text{cos}\theta}}-\overline{XC}+\overline{NP}.

From the above equations, we can compute the overlapped area (public pixels) as:

\begin{array}{c}{S}_{VILSQNUT}={S}_{ALMD}-{S}_{AIV}-{S}_{NGM}-2{S}_{SQG}\\ =\frac{1}{2}\left(\overline{AL}+\overline{MD}\right)\cdot \overline{AD}-\frac{1}{2}\text{tan}\theta \left(|\overline{AI}{|}^{2}+|\overline{NG}{|}^{2}+2|\overline{SG}{|}^{2}\right),\end{array}

(21)

where the length of the lines can be calculated from Equations (17), (18), (19), and (20).

Referring to Figures 6 and 7, from the above theoretical analysis results formulated in Equations (14) and (21) we can conclude that, the ratio of public pixels after the rotation is related to the distance between the block center and the image center, the block size and the rotation angle. The smaller distance between a block and the image center is, or the smaller the rotation angle is, or the larger the block size is, so the bigger the ratio of public pixels after the rotation is, as a result the stronger rotational robustness can be achieved from a block-based hashing algorithm. The above mathematical analysis results regarding the ratio of public pixels against the rotation is beneficial to improving the rotational robustness of those block-based hashing algorithms. The strategy is to choose a desired region (the central part of an image), and then divide the region into blocks in an ideal size. The region and the block in size can be computed in advance by referring to the rotation angle that an image may suffer from. In such a way, the effect of the rotation operations will be significantly reduced. Especially, the blocking strategy is useful for those image hashing schemes based on local statistical characteristics of an image, such as the NMF-based hashing algorithm proposed in [20]. For an image block, the more public pixels are staying in this block after a rotation operation, the better the statistical characteristics will be kept. In this article, we denote the blocking strategy as *Restricted Blocking Strategy*.