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:
(8)
(9)
So since the line in length is shorter than .
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 ( crosses at crosses at crosses at crosses at N). From the expressions: , , and , we have . As a result, we conclude that the line is the bisector of the angle ∠PON. Similarly, we can prove OL is ∠PON's bisector. According to the geometric relations and , the area of the triangle Δ AKP' is
(10)
Similarly, we have:
(11)
where and . The area of trapezoidal is:
(12)
Therefore, the area of hexagon is:
(13)
Suppose that the distance of the block center to the image center O is R1, the block is a square in size a × a, then the overlapped area (public pixels) between □ABCD and □EFGH can be computed as:
(14)
where : , , when .
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:
(15)
According to the geometric expressions: , we have . So, we conclude that the line is the bisector of the angle ∠JOK.
Similarly, we can prove that the line is ∠XOP' s bisector. So, we have
(16)
(17)
where Similarly, we have
(18)
where NG = NP + PG. And
(19)
where , , and .
At the same time, we have
(20)
where , ,
From the above equations, we can compute the overlapped area (public pixels) as:
(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.