3. WIRELESS IMAGE TRANSMISSION ERROR RECOVERY
3.3. Image Transmission Algorithms
3.3.2. Watermarking based error concealment algorithm
In this study, watermarking based EC algorithm is utilized to mitigate the errors due to channel and node failures. The algorithm has two phases, named EC encoding and EC decoding. The encoding phase occurs at the Ci sensor node. In this phase,
Discrete Wavelet Transform (DWT) is used to produce subbands/wavelet coefficients and minimized replica of the image.
The minimized replica is embedded into the host macro-blocks in subbands of the to-be-transmitted image. Locations of the macro-blocks are determined by using a shared-key-dependent pseudo-random sequence. Then, watermarked image in wavelet domain is transformed into pixel domain by inverse discrete wavelet transform (IDWT). EC encoding phase produces the watermarked image without changing the size of the original image.
The EC decoding phase is employed at the sink. In EC decoding phase, DWT is applied on the received watermarked image to determine the location of the embedded replicas. Then the received image is scanned for lost pixels and blocks. All replica coefficients, corresponding to lost ones, are found. Then their average is placed into the image.
If all of the replicas’ coefficients embedded in the subbands are lost, then each pixel in the lost macroblock is replaced by the median value of the sequence of neighboring macroblocks’ corresponding pixel. All steps of the EC algorithm and the transmission of the watermarked image over WMSN are illustrated in Fig. 3.3. The EC algorithm employed is a modified version of the wavelets based error concealment algorithm EC
Watermarked image Reconstructed image 256 x 256 pixels LENA image 64 64 HH LH HL Take the replica from the LLL subband Embed each macroblock of replica into each other subband at the
randomly determined points LL LLL replica Cisensor node Received Image from Path2 Fusion Received Image from Path1 Path1 Path2 DWT Detect lost pixels Use embedded replicas for reconstructing each lost pixel
of image
Sink
Figure 3.3: An illustration of the error concealment scheme with multihopping through possibly disjoint multipath over intermediate nodes to a sink with fusion capabilities.
proposed in [16] and [69]. The algorithm is adapted for WMSN, so as to correct all pixel and block losses due to channel and node failures.
The EC encoding algorithm used by the source node is given as:
At the Nodes Cj,
1. Capture the original image, I, with size of N1× N2pixels.
2. Check the image: if there are pixels consisting of all 0’s, then replace a pixel value in each of these pixels with 1. This step facilitates fragile watermarking for error detection [70].
3. Take Kth level pyramid-structured DWT of the original image I and produce the replicas to be embedded with size of (N1/2K)× (N1/2K).
4. Scale each replica by the designated coefficient, then embed that scaled replica in each pyramid-structured wavelet subband, excluding LL ones, by using shared-key dependent sequence for each individual subband. .
5. Take inverse DWT (IDWT) of the watermarked image, namely IWM, and round the floating-point pixel values to the corresponding integer values.
PRR=0.2 PRR=0.4 PRR=0.6 PRR=0.8
Figure 3.4: The received EC coded images at different packet reception rates. 1. Read the received image, Ireceived, and determine the lost pixels by searching
bytes consisting of 0’s. Thus, fragile watermarks were utilized in this step for error-detection.
2. Take Kthlevel pyramid-structured DWT of the received image Ireceived.
3. By generating shared-key dependent random sequence, which is also used in the encoder, determine the location of lost pixels’ replicas for each individual subband.
4. Multiply each replica with the known scaling coefficient used in the encoder and take Kth level IDWT of the extracted replicas.
5. If there is more than one non-zero extracted pixels, take the average of all those non-zero values, then place that average into the received image, Ireceived, as the lost pixels. After this process is finished, we have constructed the extracted image, Iext.
6. Scan Iextfor lost pixels, which could not be healed. If there are still pixels consisting
of all 0’s, then replace them with the median value of the neighboring healthy blocks. After this process, the healed image Ihealedin the sink was constructed. The received images Ireceived at different packet reception rates (PRR) and their healed
ones Ihealed are given in Figure 3.4.
The pseudo-codes of the EC encoding and EC decoding algorithms are also given in Fig. 3.5 and Fig. 3.6, respectively.
1: Input:
2: I← Capture the original image with the size of N1X N2;
3: Begin:
<4 - 10 > : Check the image: if there are pixels consisting of all 0’s then replace a pixel value in each of these pixels with 1
4: for(i = 1 to N1) 5: for( j = 1 to N2) 6: If(I(i, j) == 0) then 7: I(i, j) = 1; 8: end if 9: end for 10: end for
Take DTW of the original image I to produce the subbands 11: [LL, LH, HL, HH] = DWT(I);
Create the replica by using LL subband 12: Irepk = DWT(LL);
Scale the replica for decreasing visual impact in watermarked image 13: W= Irepk /a ;
<14 - 16 > : Embed the replicas into the each subband excluding LL ones 14: foreach (j = LH,HL,HH)
15: [LHw, HLw, HHw] = EMBED(W, j, rand());
16: end foreach
Take inverse DWT of the watermarked image 17: Iwmd= IDWT(LL, LHw, HLw, HHw)
Transmit the watermarked image with the size of N1X N2to the sink
18: SEND(Iwmd, sink);
1: Input:
2: Icor← Receive the corrupted image with
the size of N1X N2;
3: Begin:
Create a copy of the corrupted image for the healing 4: Ihealed ← Icor;
Take DTW of the corrupted image Icorto produce the subbands
5: [LL, LH, HL, HH] = DWT (Icor);
<6 - 8 > : Create temporary variables for the healing 6: counter ← 0
7: avgpixel ← 0;
8: mdnpixel ← 0;
<9 - 14 > : Determine the lost pixels and find the lost pixel’s replicas 9: foreach(k = LH, HL, HH)
10: Pixelk=FindPixel(i , j , k )* a;
11: If (Pixelk∼=0)
12: counter= counter + 1;
13: avgpixel= avgpixel + Pixelk;
14: end if
15: If (counter∼= 0)
Take the average of the redundant pixels 16: avgpixel= avgpixel / counter;
17: else
If redundant pixels are not found, take median of the neighbor pixels around the lost pixel
18: avgpixel=Median(i,j,k)
19: end if
Change the lost pixel with the corrected pixel 20: Ihealed(i, j) = avgpixel
21: end all