## Abstract

A novel optical encoding method based on single-shot ptychography is proposed for the application of optical watermarking. For the inherent properties of single-shot ptychography, the watermark is encoded into a series of tiny diffraction spots just in one exposure. Those tiny spots have high imperceptibility and compressibility, which are quite suitable for the optical watermarking application. The security of the proposed watermarking is mainly supported by the strong imperceptibility, as well as the introduction of compression encoding and scrambling encoding. In addition, the diversity of the multi-pinhole array and the structural parameters can also be served as security keys. Both numerical simulation and optical experiment demonstrate the high security and the easy implementation of the single-shot-ptychography-based optical watermarking. Further, the compression encoding can largely improve the embedding capacity that enables the multiple-watermarking for more transmitted information and higher security.

© 2016 Optical Society of America

## 1. Introduction

As an important branch of optical security, optical watermarking has a wide field of application [1–8]. Recently, ptychography [9–14], ghost imaging [15], diffraction imaging [16], and holography [17] have substantiated their remarkable roles in optical encryption, and these techniques have great illumination to the development of optical watermarking. Double random phase encoding (DRPE) technique is one of the most effective methods, which offers high security and robustness [18], and can be applied into various optical security systems [19,20]. Ptychographical encryption techniques are also based on the DRPE technique, the introduction of probes can enhance its security dramatically by enlarging the key space [12–14]. However, the phase masks are extremely sensitive to the position errors in DRPE-based optical security schemes, resulting that the optical experiments are very difficult to carry out.

Here, we propose a single-shot-ptychography encoding (SPE) method for optical watermarking, which has strong experimental feasibility, imperceptibility, security, embedding capacity, and robustness. Compared with the previous ptychography-based encryption technique, SPE cannot only encode the complex-valued object by single exposure, but also requires no mechanical scanning and random phase masks [21,22]. As a result, the encoding method of SPE has high encoding efficiency and experimental feasibility. The diffraction pattern obtained by single-shot ptychography is constituted by numbers of tiny spots, and the sizes of these tiny spots can also be decreased by adjusting the structural parameters, which means that the object has strong imperceptibility after being encoded by single-shot ptychography. Further, the diffraction pattern has strong compressibility, we can introduce compression encoding to extract those tiny spots and remove the redundancy of the diffraction pattern, which can improve the embedding capacity to a great extent. Without the using of random phase masks, the security of our proposed system is still relatively strong. Besides the high imperceptibility, the security can be enhanced greatly by compression encoding scrambling encoding, and the scrambling modes can be increased largely by the increase of the pinholes. In addition, the ample structural parameters ($\lambda $,${f}_{1}$, ${f}_{2}$, $d$) and diversity of the multi-pinhole array can also be severed as keys, the diversity includes the distribution pattern of the array, the shape and size of the pinhole [23], and the distance *b* between the consecutive pinholes. The high imperceptibility, security and embedding capacity mean that SPE is extremely suitable for the application of optical watermarking. We have performed optical experiment and numerical simulation to demonstrate the above features of SPE-based optical watermarking system.

## 2. Theory

#### 2.1 System description

Figure 1 shows the schematic of the optical watermarking system, which can be divided into two parts. Part 1 is single-shot-ptychography encoding system. Part 2 is performed to embed the encoded image into the host image.

In part 1, the complex watermark we wish to encode is placed at distance $d\ne 0$ before the Fourier plane of the 4*f* system, the focal distances of Lens 1 and Lens 2 are ${f}_{1}$, and${f}_{2}$, respectively. A plate of $N\ast N$ multi-pinhole square array ($N=4$in the schematic) is located at the input plane of the 4*f* system, the diameter of the circular pinhole is *D*, and the distance between the consecutive pinholes is *b*. Firstly, the plane wave is diffracted into ${N}^{2}$ beams by the multi-pinhole array. Secondly, the watermark is illuminated by ${N}^{2}$partially overlapping beams simultaneously. Thirdly, the diffraction pattern is captured by the CCD located at the output plane of the 4f system. Fourthly, the diffraction pattern is compressed through the compression encoding method. Finally, the compressed image is scrambled in a jigsaw mode [24], which is the last procedure of the optical encoding. The compression encoding and scrambling encoding are performed by the simple operation in computer. We cannot identify the distribution of the complex watermark from the encoded image, and what we can see are just some tiny diffraction spots with good imperceptibility. Thus, it is extremely suitable to apply SPE into optical watermarking. In part 2, the encoded image is embedded into a host image numerically. The encoded image is attenuated by $\alpha $firstly, and then the attenuated image is embedded into a host image. The simple process of watermark embedding is just a non-blind watermarking technique in spatial domain, which is used to demonstrate that SPE is extremely suitable for watermarking. SPE can also be applied into the blind watermarking technique in frequency domain, and the imperceptibility and security will be enhanced.

#### 2.2 Single-shot-ptychography encoding

SPE is the core of the proposed watermarking technique. Compared with ptychography-based encryption [23], the object is illuminated by multiple partially overlapping beams simultaneously without mechanical scanning, and it just generates one diffraction pattern constituted by multiple tiny spots (marked in yellow dotted blocks) at the output plane of single-shot ptychography, which can improve the encoding efficiency largely. Moreover, single-shot ptychography is implemented without the using of random phase masks, since random phase masks are very sensitive to position error, there are few groups having completed the optical experiment of DRPE so far. Therefore, SPE has excellent experimental feasibility. Further, the size of these tiny spots can be decreased to less than 10*μ*m by adjusting the structural parameters (the size of pinhole, ${f}_{1}$, and${f}_{2}$), the improvement of imperceptibility can also enhance the security of SPE-based watermarking. Besides, the diffraction pattern obtained by single-shot ptychography has strong compressibility, the introduction of compression encoding can increase the embedding capacity to a great extent. Different from the previous compression modes [25], our proposed compression encoding is conducted by getting rid of the redundancy of diffraction pattern and just extracting the tiny spots. In single-shot ptychography, the position of each tiny spot in the diffraction pattern is strictly fixed. Each diffraction spot is solely corresponding to an illumination beam that illuminates on a certain area of the object. The complex-valued watermark cannot be reconstructed, when the distribution pattern and orders of those spots are scrambled. We scramble those tiny spots by a simple jigsaw method, and change the distribution patterns and orders of those tiny spots discretionarily, as shown in Fig. 2(b). The multi-pinhole array we use in the paper is a $4\ast 4$ square array, the diffraction pattern can be compressed into 16 discrete spots blocks, as shown in Fig. 2(b). Then, we use scrambling encoding to realign these small blocks, and if we just change the orders of those tiny spots with the distribution pattern as S2, the amount of scrambling modes is $16!\approx 2.1\cdot {10}^{13}$, let alone change the distribution patterns of those tiny spots, resulting that it is extremely difficult to recover the distribution of diffraction pattern. The larger $N$ is, the higher security will be. In addition, as can be easily deduced from Fig. 2(a), all of the system structural parameters ($\lambda $,${f}_{1}$, ${f}_{2}$, $d$) and the diversity of the multi-pinhole array can be served as keys, the diversity includes the distribution pattern of the array, the shape and size of the pinhole, and the distance *b* between the consecutive pinholes. All of these form a large key space, the security of SPE and our proposed watermarking system can be guaranteed, and the security can also be improved constantly by increasing the number of pinholes and decreasing the size of diffraction spots. In short, SPE has high encoding efficiency, experimental feasibility, imperceptibility, security, and embedding capacity, which means that SPE is particularly applicable to optical watermarking.

#### 2.3 Watermark encoding and embedding algorithm

In order to make the simulation more realistic, the angular spectrum propagation theory is used for free propagation, and the quadratic phase factor $t=\mathrm{exp}[-j\cdot k/2f\cdot ({x}^{2}+{y}^{2})]$ is applied to simulate the modulation of lens [26]. The process of watermark embedding is just a non-blind watermarking technique in spatial domain, the reason why we choose an extremely simple embedding method is that we would like to demonstrate that SPE is particularly suitable for the application of watermarking. The process of the above two parts can be numerically expressed as four steps:

- 1. A plane wave is divided into multiple beams, these consecutive beams overlap with each other in a certain region between Lens 1 and Lens 2. $N\ast N$ probes $U$ illuminated on the watermark are generated simultaneously:$${U}_{n}={\xi}_{({f}_{1}-d)}[{\xi}_{{f}_{1}}[P(r-{R}_{n})]\cdot t]\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}},$$$$U={\displaystyle \sum _{n}{U}_{n}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}},\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}(n=1,\text{\hspace{0.05em}}\text{\hspace{0.05em}}2,\cdots ,{N}^{2}).$$
- 3. The encoded image $E$is generated by the compression encoding and scrambling encoding of diffraction pattern $I$, as shown in Figs. 1 and 2(b) . That is the second step of SPE, and the above steps 1and 2 are the first step of SPE.
- 4. The encoded image is embedded into the host image$H$, using a non-blind watermarking technique in spatial domain:
where ${\xi}_{d}[\cdot ]$ is the angular spectrum propagation with the distance

*d*, the $\sum _{n}P(r-{R}_{n})$ stands for the $N\ast N$ pinholes, ${R}_{n}$ is the center of the ${n}_{th}$ pinholes, ${U}_{n}$ is the ${n}_{th}$ probe illuminated on the watermark, ${I}_{n}$ is the ${n}_{th}$ diffraction pattern corresponding to the ${n}_{th}$ pinholes, $f(x,y)$ is the complex watermark, $\alpha $is the attenuation coefficient, and $W$is the transmitted image.

#### 2.4 Watermark extraction algorithm

The extraction of watermark is the inversion of the encoding and embedding of watermark. Firstly, the encoded image is extracted from the transmitted image faultlessly. Secondly, the encoded image is arranged into right distribution pattern and order. Finally, the phase and amplitude of the watermark can be reconstructed with the standard PIE algorithm [10, 27]. The above process can be described as follows:

- 2. Split the encoded image $E$ into $N\ast N$separate patterns, and then arrange these patterns ${I}_{n}$ in the correct order named ${I}_{1},\text{\hspace{0.05em}}\text{\hspace{0.05em}}{I}_{2},\text{\hspace{0.05em}}\text{\hspace{0.05em}}\cdots ,{I}_{{N}^{2}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}$.
- 3. Guess the complex value of the input watermark ${f}_{g}(x,y)$, and then begin the following iterative process.
- 4. In the
*m*-th iteration, ${f}_{ng}^{m}(x,y)$ is illuminated by the*n*-th probe, and the intensity ${I}_{ng}^{m}$ is acquired at the output plane of the 4*f*system: - 5. Substitute the amplitude term of ${I}_{ng}^{m}$ with the detected pattern ${I}_{n}$, while preserving the phase:
- 6. Take the inverse transform of ${I}_{n}^{m}$ to the object plane:
where ${t}^{\ast}$ is the conjugate of $t$.

- 7. Renew ${f}_{ngNew}^{m}(x,y)$ with ${f}_{(n+1)g}^{m}(x,y)$ according to:
- 8. Repeat the above steps 4 through 7 for $N\ast N$separate patterns to complete an entire iteration.
- 9. Calculate the coefficient (
*Co*) between the extracted watermark $f$ and the original watermark ${f}_{0}$ [28],where$\mathrm{cov}(f,{f}_{0})$ denotes the cross-covariance between $f$and ${f}_{0}$, ${\sigma}_{f}$ is the standard deviation. The value of ranges from 0 to 1, $\mathrm{cov}(f,{f}_{0})=1$ means that watermark is extracted perfectly.

- 10. Calculate the peak signal to noise ratio ($PSNR$), which is usually used to measure the watermarked image quality [6],
where $MSE$ is the mean squared error, ${f}_{p,q}$ and ${{f}^{\prime}}_{p,q}$ are the original and the watermarked images respectively. The size of ${f}_{p,q}$ and ${{f}^{\prime}}_{p,q}$are $P\cdot Q$, and maximum pixel value of the image is $MaxPV$.

## 3 Results and analysis

#### 3.1 Experimental results and analysis

We have performed the optical experiment of the proposed SPE-based optical watermarking technique, the experiment schematic is shown as Fig. 1. In the optical experiment, the wavelength of the laser is$\lambda =473\mathrm{nm}$, the focal distances of Lens1 and Lens2 are${f}_{1}={f}_{2}=75\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{mm}$. The $4\ast 4$ square multi-pinhole array is located at the input plane of the 4*f* system, the diameter *D* of the circular pinhole is 49.5*μ*m, and the distance *b* between consecutive pinholes is 1.54mm. The complex watermark is placed at a distance $d=19\mathrm{mm}$ before the Fourier plane of the 4*f* system. The pixel size of the CCD is 5.5*μ*m. And the complex watermark is a figure of 6, as shown in Fig. 3.

As can be seen from Fig. 3, in the first step of SPE, the complex watermark is encoded into a diffraction pattern with $1120\ast 1120$ pixels, and the intensity of the complex watermark is just stored in 16 tiny spots of the diffraction pattern, the diameter of each circular spot is only 9 pixels. It is clearly that the imperceptibility of the watermark is particularly strong. Further, the optical experiment of this step is quite easy to be implemented, as it not only does not need the random phase masks, but also just takes one exposure to complete the acquisition of the complex watermark. What is more, all of the structural parameters ($\lambda $,${f}_{1}$,${f}_{2}$, $d$) and the diversity of the multi-pinhole array are keys. In this experiment, the diversity of the multi-pinhole array consists the square distribution of the array, the shape of the pinhole, the number of the pinholes (${N}^{2}$), the distance between the neighboring pinholes (*b*). In the second step of SPE, inspired by the nature of single-shot ptychography, we adopt compression encoding and scrambling encoding to enhance the embedding capacity and security. For compression encoding, the diffraction pattern is split into 16 tiny spot square blocks by removing the redundancy and extract the spots, as shown in Fig. 2(b). Since the size of diffraction pattern is $1120\ast 1120$pixels, the diameter of each tiny spot is 9 pixels, the ideal compression ratio is about 1000:1. In our experiment, the compression ratio is 196:1, the size of each little spot square block and the total size of 16 little spot square blocks are $20\ast 20$ pixels and $80\ast 80$ pixels, respectively. In ptychography-based encryption, it requires 16 mechanical scanning steps, and generates 16 ciphertexts with $1120\ast 1120$pixels. The data of ptychography-based encryption are about 3136 times of SPE. As a result, the increase of embedding capacity introduced by compression encoding makes SPE applicable to optical watermarking. For scrambling encoding, it is easy to rearrange these tiny spot square blocks into various kinds of distribution patterns and orders, S1, S2, and S3 are three of the whole scrambling modes, as shown in Fig. 2(b). In our experiment, the scrambling mode we use is the same as S2, which is arranged by the orders marked in dotted blue blocks. For each distribution pattern, the scrambling modes are $16!\approx 2.1\cdot {10}^{13}$, and the scrambling modes are ${N}^{2}!$ when the number of pinholes is ${N}^{2}$, which can enhance the security of the encoding system significantly. Only using the whole right keys, can we decode successfully. Before being embedded into a host image, the encoded image is attenuated by 0.1, and the size of the host image is no less than the encoded image.

Using the watermark extraction algorithm, the amplitude and phase of the complex watermark are extracted commendably, as shown in Fig. 3. From the above experimental results and analysis, it is demonstrated that SPE-based watermarking system has high experimental feasibility and effectiveness.

#### 3.2 Numerical results and analysis

Numerical experiments are performed to accurately evaluate the effectiveness of the proposed watermarking technique, due to limitation of the experimental equipment. First, we select two grayscale images with ample details as the amplitude and phase distributions of the watermark, respectively, as shown in Fig. 4(a). Second, we select two near binary-value images with the periodic structure, displayed in Fig. 4(b). The system structure is depicted in Fig. 1 with the following parameters:$N=4$, $b=1.54\mathrm{mm}$, *D* = 44*μ*m, $\lambda =473\mathrm{nm}$, ${f}_{1}={f}_{2}=75\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{mm}$, $d=19\mathrm{mm}$, and $\alpha =0.1$. The overlapping rate $\delta $ of the neighboring probes is 72.9% [29].

In Fig. 4 the sizes of the watermark and the encoded image are $1120\ast 1120$ and $80\ast 80$ pixels, respectively. The compression ratio is about 196:1, the same as the above optical experiment. Using the whole right keys, the amplitude and phase of the watermark can be extracted successfully, as displayed in Figs. 4(a) and 4(b). For the watermark with ample details, the value of $Co$ is more than 99%. For the watermark with periodical fringes, the corresponding extracted quality is slightly worse than Fig. 4(a). Thus, we select watermark with periodical fringes in the following analysis, to verify the high security and robustness of the proposed technique powerfully. Both optical experiment and numerical simulation show the strong feasibility and effectiveness of our proposed optical watermarking technique. Owing to the errors introduced by optical elements and experimental operation, the extracted amplitude and phase by numerical simulation are more excellent.

## 4. Security of SPE-based optical watermarking

The security of SPE-based optical watermarking is mainly supported by the high imperceptibility and the scrambling encoding. Besides, the diversity of the multi-pinhole array and the structural parameters ($\lambda $,${f}_{1}$, ${f}_{2}$, $d$) can also be served as keys. Since that SPE-based watermarking in this manuscript is a non-blind watermarking technique in spatial domain, the security of the watermarking system almost totally depends on the security of SPE. That is to say, the security demonstrations of the watermarking system are also the proofs about the security of SPE. In order to demonstrate the security of SPE and the watermarking system, we have performed a series of simulations about the keys.

#### 4.1 Imperceptibility

For invisible watermarking, the imperceptibility is the most important characteristic, which has great influence on the security. The higher imperceptibility is, the stronger security will be. Different from the previous watermarking technique, the encoded image of the SPE-based watermarking is just constituted by some tiny diffraction spots. In the optical experiment, the width of the square diffraction pattern is 6160*μ*m, and the diameter of the tiny spot is just 49.5*μ*m. In numerical simulation, the width of the square diffraction pattern is 6160*μ*m, and the diameter of the tiny spot is just 44*μ*m. These mean that SPE-based watermarking has strong imperceptibility. Further, the diameter of these tiny spots can be decreased to less than 10*μ*m by adjusting the structural parameters (the size of pinhole, ${f}_{1}$, and${f}_{2}$). We cannot identify those tiny spots by our naked eyes when the diameter of spot is less than 10*μ*m. The improvement of imperceptibility can enhance the security of SPE observably.

In order to demonstrate the high imperceptibility of the watermarked image intuitively, we calculate the $PSNR$ between the watermarked image and host image with compression encoding and without compression encoding, respectively. The introduction of compression encoding can greatly get rid of the redundancy, which is helpful for the improvement of imperceptibility. To make the analysis results more convincing, the used watermarked image is obtained by numerical simulation with bigger diffraction spots. Table 1 shows the values of $PSNR$, it clearly indicates the strong imperceptibility of SPE-based watermarking system.

#### 4.2 Scrambling encoding

Scrambling encoding is also a remarkably powerful method to enhance the secuirty of our proposed system. In single-shot ptychography, each diffraction spot is solely corresponding to an illumination beam that illuminates on a certain area of the object. The position of each tiny spot in the diffraction pattern is strictly fixed. We cannot reconstruct the complex-valued object, when the distribution pattern and orders of those spots are scrambled. We have demonstrated the effectiveness of scrambling encoding by both numerical simulation and experiment results. The scrambling mode we use is the same as S2, which is arranged by the orders marked in dotted blue blocks, as shown in Fig. 2(b). We assume that the distribution pattern of those tiny spots is right, and only the distribution order is wrong. Using the wrong distribution order the same as S2, the extracted watermarks are shown in Fig. 5. Figures 5(a) and 5(b) are the numerical results, Figs. 5(c) and 5(d) are the experimental results. It is obvious that the extraction is totally failing, using the wrong scrambling mode. There are varieties of distribution patterns, and for each distribution pattern, the scrambling modes achieve$16!\approx 2.1\cdot {10}^{13}$, and the scrambling modes are ${N}^{2}!$ when the number of pinholes is${N}^{2}$, it is extremely difficulty to recover the right distribution and order of those tiny spots from the encoded image. And the larger $N$ is, the higher security will be. Therefore, the scrambling modes can enlarge the key space prominently.

#### 4.3 Diversity of multi-pinhole array and structural parameters

Firstly, we demonstrate that the diversity the multi-pinhole array is effective key, the diversity includes the distribution pattern of the array, the shape and size of the pinhole, and the distance $b$ between the consecutive pinholes simultaneously. For the numerical simulation, the correct parameters of are $N=16$, *b* = 1.54*μ*m, *D* = 44*μ*m. Firstly, we just alter *D* = 44*μ*m to *D* = 55*μ*m, Figs. 6(a) and 6(b) are the extracted amplitude and phase. Then, we just change *b* = 1.54*μ*m to *b* = 1.485*μ*m, Figs. 6(c) and 6(d) are the extracted amplitude and phase are the extracted amplitude and phase. It is hard to identify the amplitude and phase of the watermark when we just change one parameter of the array, let alone change all of the parameters of multi-pinhole array.

Secondly, due to the acceptance of the minute errors about the structural parameters ($\lambda $,${f}_{1}$,${f}_{2}$, $d$), the optical experiment is easy to conduct, but there is a limitation to the acceptance. Thereupon, we have performed the numerical simulation to attest the security of the structural parameters. Figures 7(a)-7(f) express how the correlation coefficient curves of the extracted amplitude and phase change over the different structural parameters, which are plotted by the Gaussian curve approximation. The correct parameters are $\lambda =473\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{nm}$, ${f}_{1}={f}_{2}=75\text{\hspace{0.05em}}\mathrm{mm}$, and $d=19\text{\hspace{0.05em}}mm$. Except for ${f}_{1}$ and ${f}_{2}$, we just change one parameter, and keep the other parameters correct during each simulation. For${f}_{1}$ and ${f}_{2}$, we alter ${f}_{1}$ and ${f}_{2}$ at the same time, and keep ${f}_{1}={f}_{2}$. This can better indicate the effectiveness of ${f}_{1}$ and ${f}_{2}$ as keys, because it is more difficult to extract the watermark when${f}_{1}\ne {f}_{2}$. It is obvious that the extracted qualities are appreciably more sensitive to ${f}_{1}$ and ${f}_{2}$ than $\lambda $ and *d*. Then, we slightly change $\lambda $ and $d$ simultaneously with $\lambda =490\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{nm}$, and $d=25\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{mm}$, and the extracted watermark are shown as Figs. 8(a) and 8(b). Furthermore, we use experiment results to further demonstrate the effectiveness of the structural keys, and the correct parameters are $\lambda =473\text{\hspace{0.05em}}\mathrm{nm}$, $d=19\text{\hspace{0.05em}}\mathrm{mm}$, and ${f}_{1}={f}_{2}=75\mathrm{mm}$. Figures 8(c) and 8(d) show the extracted watermark with $\lambda =490\text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{nm}$, $d=25\text{\hspace{0.05em}}\mathrm{mm}$, and ${f}_{1}={f}_{2}=70\mathrm{mm}$, we cannot identify any information of the watermark when the whole structural parameters have just has tiny errors simultaneously. It turns out that the whole structural parameters $\lambda $, ${f}_{1}$, ${f}_{2}$ and $d$ are strong keys, too.

## 5. Robustness analysis

In this section, we test the robustness of our proposed watermarking technique against the attacks of noise and occlusion, and give an optimized encoding scheme to enhance the robustness.

#### 5.1 Numerical analysis

Firstly, we add 2% salt & pepper noise and 5% normalized random noise to the transmitted image, the extracted images are shown in Fig. 9. The extracted qualities are not very good, the reason is that the encoded image is made up by 16 small diffraction spots, the diameter of each spot is just 8 pixels, and the diffraction spots will be drowned by the strong background noises.

Secondly, we demonstrate the robustness to occlusion attack. For watermarked image, the occlusion attack is similar to cropping attack, both of them can cause the loss of information. The transmitted images are occluded by 1/16, 1/8, and 3/16, respectively, as shown in Figs. 10(a), 10(e), and 10(i). To make the results more convincing, we assume that the size of the encoded image is the same as the host image, and occlude one, two, and three diffraction spots, respectively, as shown in Figs. 10(b), 10(f), and 10(j). Figures 10(c), 10(g), and 10(k) show the extracted amplitude distributions, Figs. 10(d), 10(h), and 10(l) show the extracted phase distributions. Even lost three diffraction spots, the complex watermark still can be identified. That is to say, our proposed technique has strong robustness to occlusion attack.

#### 5.2 Optimization scheme

Based on the compression encoding, we propose an optimization scheme to improve the robustness and security of SPE-based optical watermarking. In our numerical simulation, the encoded image is just constituted by 16 tiny diffraction spots, and the diameter of each spot is 8 pixels. As a result, if the noises we add into the transmitted image are much more than the diffraction spots, it will be extremely hard to ignore the influence of the noises. And that is the reason why the occlusion attack has so big destructiveness on the extracted quality. Inspired by the above compression coding method, we come up with an optimized encoding scheme. The optimized process is quite easy to realize. Firstly, the diffraction spots are increased by multiple times. Secondly, all of the spots are scrambled in a predefined mode. Figure 11 shows that the original diffraction spots in Fig. 11(a) are increased by 2 times and scrambled into Fig. 11(b), both Figs. 11(a) and 11(b) are just sketches, actual diffraction spots are particularly weeny. On the one hand, the signal-to-noise ratio (SNR) can be enhanced largely by the increasing of diffraction spots, and then the anti-noise ability of the watermarking system will be promoted significantly. On the other hand, the integrality of the overall diffraction spots will not be compromised by the occlusion attack. The larger times the increase of the diffraction spots are, the lower impact the occlusion attack will bring. Moreover, the optimized encoding scheme can also enhance the security, for it is too difficult to return Fig. 11(b) back to Fig. 11(a).

## 6. Summary

In conclusion, we have demonstrated the feasibility and effectiveness of the SPE, and applied SPE into optical watermarking successfully. This technique is just performed in single exposure, and without the using of random phase masks, which makes the system is quite simple and feasible. Both of the optical experiment and numerical simulation results show the excellent imperceptibility, compressibility, security of SPE, which indicates that SPE are particularly applicable to optical watermarking. On the one hand, the diffraction pattern obtained by single-shot ptychography is constituted by numbers of tiny spots, and the sizes of these tiny spots can also be decreased by adjusting the structural parameters, which means that SPE-based watermarking has strong imperceptibility. On the other hand, the introduction of compression encoding can extract those tiny spots and remove the redundancy of the diffraction pattern, which can improve the embedding capacity to a great extent. Moreover, plenty of scrambling modes introduced by scrambling encoding are powerful security keys. The strong imperceptibility, multiple scrambling modes, the diversity of the multi-pinhole array and the structural parameters ($\lambda $, *f*_{1}, *f*_{2}, and *d*) form a large key space. Then, an optimized encoding scheme based on compression encoding is proposed to enhance the robustness and security. Furthermore, owing to the high embedding capacity and encoding efficiency of the SPE-based optical watermarking system, it has potential to perform multiple watermarks, and it can also improve the security of the watermarking system.

## Funding

National Natural Science Foundation of China (Nos. 61575197 and 61307018); K. C. Wong Education Foundation; Fusion Foundation of Research and Education, Chinese Academy of Sciences; Youth Innovation Promotion Association CAS.

## Acknowledgments

We are very grateful to Dr. Pavel Sidorenko for his invaluable suggestions on the details of the optical experiments of single-shot ptychography.

## References and links

**1. **N. Takai and Y. Mifune, “Digital watermarking by a holographic technique,” Appl. Opt. **41**(5), 865–873 (2002). [CrossRef] [PubMed]

**2. **H. T. Chang and C. L. Tsan, “Image watermarking by use of digital holography embedded in the discrete-cosine-transform domain,” Appl. Opt. **44**(29), 6211–6219 (2005). [CrossRef] [PubMed]

**3. **L. Z. Cai, M. Z. He, Q. Liu, and X. L. Yang, “Digital image encryption and watermarking by phase-shifting interferometry,” Appl. Opt. **43**(15), 3078–3084 (2004). [CrossRef] [PubMed]

**4. **S. Wang, S. Huang, X. Zhang, and W. Wu, “Hologram-based watermarking capable of surviving print-scan process,” Appl. Opt. **49**(7), 1170–1178 (2010). [CrossRef] [PubMed]

**5. **J. Li, “An optimized watermarking scheme using an encrypted gyrator transform computer generated hologram based on particle swarm optimization,” Opt. Express **22**(8), 10002–10016 (2014). [CrossRef] [PubMed]

**6. **A. Poljicak, L. Mandic, and D. Agic, “Discrete Fourier transform- based watermarking method with an optimal implementation radius,” J. Electron. Imaging **20**(3), 033008 (2011). [CrossRef]

**7. **H. Song, S. Yu, X. Yang, L. Song, and C. Wang, “Contourlet-based image adaptive watermarking,” Signal Process-Image. **23**(3), 162–178 (2008). [CrossRef]

**8. **W. Chen, B. Javidi, and X. Chen, “Advances in optical security systems,” Adv. Opt. Photonics **6**(2), 120–155 (2014). [CrossRef]

**9. **A. M. Maiden, J. M. Rodenburg, and M. J. Humphry, “Optical ptychography: a practical implementation with useful resolution,” Opt. Lett. **35**(15), 2585–2587 (2010). [CrossRef] [PubMed]

**10. **J. M. Rodenburg, “Ptychography and related diffractive imaging methods,” Adv. Imaging Electron Phys. **150**, 87–184 (2008). [CrossRef]

**11. **J. Zhang, Z. Wang, T. Li, A. Pan, Y. Wang, and Y. Shi, “3D object hiding using three-dimensional ptychography,” J. Opt. **18**(9), 095701 (2016). [CrossRef]

**12. **Y. Shi, T. Li, Y. Wang, Q. Gao, S. Zhang, and H. Li, “Optical image encryption via ptychography,” Opt. Lett. **38**(9), 1425–1427 (2013). [CrossRef] [PubMed]

**13. **N. Rawat, I. Hwang, Y. Shi, and B. Lee, “Optical image encryption via photon-counting imaging and compressive sensing based ptychography,” J. Opt. **17**(6), 065704 (2015). [CrossRef]

**14. **N. Rawat, Y. Shi, B. Kim, and B.-G. Lee, “Sparse-based multispectral image encryption via ptychography,” Opt. Commun. **356**, 296–305 (2015). [CrossRef]

**15. **P. Clemente, V. Durán, V. Torres-Company, E. Tajahuerce, and J. Lancis, “Optical encryption based on computational ghost imaging,” Opt. Lett. **35**(14), 2391–2393 (2010). [CrossRef] [PubMed]

**16. **W. Chen, X. Chen, and C. J. R. Sheppard, “Optical image encryption based on diffractive imaging,” Opt. Lett. **35**(22), 3817–3819 (2010). [CrossRef] [PubMed]

**17. **M. T. Shiu, Y. K. Chew, H. T. Chan, X. Y. Wong, and C. C. Chang, “Three-dimensional information encryption and anticounterfeiting using digital holography,” Appl. Opt. **54**(1), A84–A88 (2015). [CrossRef] [PubMed]

**18. **P. Refregier and B. Javidi, “Optical image encryption based on input plane and Fourier plane random encoding,” Opt. Lett. **20**(7), 767–769 (1995). [CrossRef] [PubMed]

**19. **H. Singh, A. K. Yadav, S. Vashisth, and K. Singh, “Fully phase image encryption using double random-structured phase masks in gyrator domain,” Appl. Opt. **53**(28), 6472–6481 (2014). [CrossRef] [PubMed]

**20. **X. Wang, W. Chen, and X. Chen, “Fractional Fourier domain optical image hiding using phase retrieval algorithm based on iterative nonlinear double random phase encoding,” Opt. Express **22**(19), 22981–22995 (2014). [CrossRef] [PubMed]

**21. **P. Sidorenko and O. Cohen, “Single-shot ptychography,” Optica **3**(1), 9–14 (2016). [CrossRef]

**22. **X. Pan, C. Liu, and J. Zhu, “Single shot ptychographical iterative engine based on multi-beam illumination,” Appl. Phys. Lett. **103**(17), 171105 (2013). [CrossRef]

**23. **Y. Shi, Y. Wang, and S. Zhang, “Generalized ptychography with diverse probes,” Chin. Phys. Lett. **30**(5), 054203 (2013). [CrossRef]

**24. **P. Kumar, J. Joseph, and K. Singh, “Optical image encryption using a jigsaw transform for silhouette removal in interference-based methods and decryption with a single spatial light modulator,” Appl. Opt. **50**(13), 1805–1811 (2011). [CrossRef] [PubMed]

**25. **A. Alfalou and C. Brosseau, “Optical image compression and encryption methods,” Adv. Opt. Photonics **1**(3), 589–636 (2009). [CrossRef]

**26. **E. Hecht, *Optics*, 4th ed. (Addision-Wesley, 2001).

**27. **A. M. Maiden and J. M. Rodenburg, “An improved ptychographical phase retrieval algorithm for diffractive imaging,” Ultramicroscopy **109**(10), 1256–1262 (2009). [CrossRef] [PubMed]

**28. **T. Li and Y. Shi, “Security risk of diffractive-imaging-based optical cryptosystem,” Opt. Express **23**(16), 21384–21391 (2015). [CrossRef] [PubMed]

**29. **O. Bunk, M. Dierolf, S. Kynde, I. Johnson, O. Marti, and F. Pfeiffer, “Influence of the overlap parameter on the convergence of the ptychographical iterative engine,” Ultramicroscopy **108**(5), 481–487 (2008). [CrossRef] [PubMed]