1 Introduction

Wireless video sensor networks (WVSNs) consist of micro video sensor nodes having perception, computing and communication abilities [2, 14]. Compared with traditional wireless sensor networks [1], WVSNs are able to capture, process and transmit image or video data for visual monitoring applications. Thus WVSNs are becoming highly attractive during the past few years. Nevertheless, there are some critical problems restricting applications of this technology. For video sensor nodes, the energy, bandwidth and computing resources are limited, which leads to the fact that image communication in sensor networks becomes difficult. Reducing the volume of data to be transmitted contributes to saving energy greatly and overcoming the communication bottleneck. Therefore it is necessary to compress images before transmission over WVSNs.

For some traditional image compression algorithms, such as JPEG [24] or JPEG2000 [7], the key idea is to extract and retain only a bit of high-energy coefficients and encode them while discarding the remaining ones. It has been proved that these methods can achieve good compression performance at the cost of complex computation and high overhead. Besides, these methods are unable to reconstruct the images when some important data packets are lost [16, 20]. Although error correction mechanisms, such as forward error correction (FEC) [27] and multiple description coding (MDC) [25] techniques, are adopted to deal with packet losses, additional redundancy for transmission reliability incurs energy consumption and transmission latency. Therefore, these approaches are not suitable to be applied directly to the resource-constrained video sensor nodes [11, 15].

Compressive sensing (CS) [5, 9] has been proved to be effective in data compression. According to CS theory, an image can be sampled and compressed with less computation cost. Furthermore, the quality of recovered image only depends on the number of compressive measurements, not on which of the measurements that are received. Thus, CS-based image compression has a better robustness to packet losses over wireless sensor networks than those conventional compression algorithms [8]. Many researches have studied the concept of CS in image compression during the past years. Pudlewski et al. [17] made a case for why CS should be used in video encoding for low power WVSN nodes. Gao et al. [13] proposed a CS-based image compression algorithm, in which the input images are transformed into a sparse matrix by using discrete cosine transform (DCT), and then two CS sampling schemes based respectively on coefficient random permutation and energy contribution of DCT coefficients are considered. Although the image can be successfully recovered, the quality of reconstructed image is reduced because of the blocking artifacts from DCT. Zhang et al. [29] took advantage of discrete wavelet transform (DWT) to replace DCT for thinning the original signal, which results in the quality improvement of recovered images. In [12], Gan put forward block-based compressive sensing (BCS) compression algorithm aiming to reduce the dimension of measurement matrix and computational complexity. The image is firstly divided into non-overlapping blocks with equal size, and then every block is processed in order by using the same random sampling matrix. Since the length of coefficients and the dimension of measurement matrix are decreased, this method requires less memory and has fast running speed. However, a critical deficiency lies in the fact that the structure of image data is not utilized completely. Yang et al. [28] introduced an additional weight matrix into the compressive sampling. Qureshi et al. [19] proposed a strategy where DWT coefficients are arranged by specific rules before compressive sampling. Experimental results indicate that the two methods enable to improve the quality of recovered images. Especially, the coefficients arrangement in [19] can further decrease the execution time and memory spaces. Nevertheless, the main shortcoming of these algorithms mentioned above is that all of them utilize a fixed measurement ratio (MR) to compress the whole image. In this case, it occurs a contradiction that a large MR provides a higher recovered quality but consumes more energy, and vice versa. In fact, for a natural image, the amount of information varies in different regions. More measurements should be assigned to regions with rich information, and a handful of measurements are enough to achieve good recovery quality for the other regions. According to this idea, Zhu et al. [30] proposed an adaptive sampling method based on BCS, in which the original image is firstly divided into some same size blocks. Then different compressive measurements are distributed to each block according to the amount of the specific statistic characteristic in this block. However, this method is too complicated to apply to video sensor nodes in practice.

For image compressive transmission in WVSNs, except for the hardware resource constraints, the residual energy of nodes should also be taken into consideration because it is very crucial for prolonging the network lifetime. Our earlier work [26] presented an image quality control mechanism based on the residual energy of sensor nodes. Specifically, sensor nodes with sufficient residual energy will be assigned a relatively large MR for the purpose of exchanging for better image quality, in the meanwhile, the other nodes are assigned a small MR so that less computation and measurements are used to prevent rapid depletion of the residual energy, so as to balance the energy consumption among nodes. This method reaches a good tradeoff between energy consumption and compression performance. Additionally, some researches [3, 18] show that the link quality of network has a strong connection with the packet loss rate (PLR). This means the link quality of network is also an important factor for image transmission. For instance, data packets are subject to loss over the wireless channel when the link quality of network gets worse, resulting in the poor image quality. Therefore, if the MR correspondingly increases on this occasion, more measurements will be transmitted to the receiver side and the image quality can be improved to some extent. As another example, under the worst circumstance that the link quality is extremely poor, the number of received measurements is too little to reconstruct the original image. In this case, it is not necessary for sensor nodes to compress and transmit the image from the point of view of energy saving. Thus it is crucial to choose a proper way to evaluate the link quality of network so as to adaptively adjust MR according to the link quality. Preceding studies [4, 21] indicate that the average link quality indicator (ALQI) can exactly and objectively reflect the link quality of network. Thus ALQI is used as a metric to measure the link quality in our solution.

In this paper, we propose a low-complexity and energy-efficient image compression algorithm for video sensor nodes. This BCS-based scheme gives consideration to both energy saving and compression performance, and adaptively adjusts the image quality by combining the residual energy of nodes with the link quality of network. The contributions of this paper are summarized as follows:

  1. 1)

    We introduce BCS and coefficient rearrangement into image compression. BCS greatly decreases the complexity of compression and promote the robustness of transmission. Moreover, coefficient rearrangement can further reduce the dimension of measurement matrix so that the compression procedure can run faster.

  2. 2)

    We design an image quality control strategy, which means the number of compressive measurements can be adjusted according to the residual energy of nodes and the link quality of network. The proposed scheme can balance energy consumption of nodes while achieving good image quality.

  3. 3)

    We develop the prototype of video sensor nodes and establish a tiny star wireless sensor network which consists of three video sensor nodes to evaluate the compression performance under different conditions of the residual energy of nodes and the link quality of network. Experimental results demonstrate that the proposed scheme is suitable and feasible for resource-constrained video sensor nodes.

The rest of this paper is organized as follows. Section 2 briefly describes the approach overview. Section 3 describes the image compression and transmission in detail. Section 4 introduces the customized video sensor node and presents the experimental results. Section 5 concludes this paper and provides future directions.

2 Approach Overview

To improve the efficiency of image compression in video sensor nodes, we propose a novel compression scheme that has good performance in lowering energy consumption and guaranteeing image quality. The processing flow of the proposed scheme is illustrated in Fig. 1. Firstly, the original image is divided into equal size and non-overlapping blocks, and then these image blocks are processed block by block. Through doing this, the computational complexity and memory requirements can be reduced greatly. Nevertheless, as the original image blocks are not sparse, CS can not be straightforward applied on it. Thus Haar wavelet transform (HWT) is used for the sparse representation of each image block, because it has the simplest structure and keeps the computing efficiency. However, the coefficient matrix of each block is still not fit for compressive sampling. The coefficient rearrangement, as stated earlier, is introduced into our scheme. Unlike traditional methods in which the coefficients of every block are arranged into a column vector, the rearrangement converts the coefficients into a sparse matrix whose size is determined by the level of HWT and the size of image block. As a result, the dimension of measurement matrix is reduced greatly. Subsequently, compressive sampling is performed to compress HWT coefficients. Since different areas have different amount of information, it is inappropriate to employ a fixed MR to each block. We design an adaptive image quality control strategy, in which the residual energy of video sensor nodes and the link quality of network are taken into consideration to strike a balance between the image quality and energy consumption. Finally, since the traditional quantization schemes are not suitable for compressive measurements [10], compressive measurements are directly grouped into packets and transmitted to the host for image recovery.

Fig. 1
figure 1

The flowchart of the proposed scheme

3 Image Compression and Transmission

3.1 HWT and Coefficient Rearrangement

The CS theory indicates that it is possible to recover a signal from a small set of linear measurements if the signal is sparse in spatial domain or a certain transform domain. Nevertheless, it is undesirable for video sensor nodes to directly apply CS to the whole image. The original image usually has high dimension, the storage space for measurement matrix is huge and the corresponding computation is expensive for the resource-limited video sensor nodes. Therefore BCS [12] scheme is proposed to solve this problem.

According to BCS, the original image of dimension M × N is divided into B sub-blocks with the same size of m × m, where B = (M/m) × (N/m). Then these image blocks are processed block by block through a random projection. For ith (i = 1,..., B) block, a l-level HWT is applied independently and the wavelet coefficient matrix is denoted as b i . As well known, though the detail coefficients in b i are nearly sparse, the approximation coefficients are not sparse. In our solution, these coefficients can be rearranged in a similar way in [19] before random projection. Firstly, b i is further divided into non-overlap small parts α t (t = 1, 2,..., Z) of size m b  × m b , where m b  = m/(2^l), Z is the total number of small parts and is computed by\( Z=1+3{\sum}_{k=1}^l{4}^{k-1} \). Then we group the HWT coefficients to form the sparse vectors in the following manner\( {\mathbf{x}}_j=\left\{{\alpha}_t^j\right\} \), where \( {\alpha}_t^j \) is the jth component of α t , x j (j = 1,..., m b ^2) is a sparse vector of dimension Z × 1. As a result, the coefficient matrix b i of dimension m × m is rearranged into a new matrix {x j } of dimension Z × (m b ^2). For instance, Z and m b are separately 64 and 2 under m = 16 and l = 3. The dimension of the rearranged matrix is 64 × 4. For traditional methods based on BCS, the coefficient matrix is usually transformed into a column vector of m 2 × 1, i.e., 256 × 1. If MR is set to 0.5, the dimension of measurement matrix of traditional methods and the proposed method are 128 × 256 and 32 × 64, respectively. Comparatively, the dimension of measurement matrix reduces 16 times by using the coefficient rearrangement. Moreover, it contributes to shortening the execution time of image compression, as so to reduce energy consumption of video sensor nodes. All of these can be confirmed from the experimental results described later.

For each column in the rearranged matrix {x j }, the compressive sampling can be realized by the following random projection

$$ {\mathbf{y}}_j={\boldsymbol{\Phi} \mathbf{x}}_j $$
(1)

where Φ is the measurement matrix obeyed the restricted isometry property (RIP) [6], and y j is the corresponding compressive measurements of the sparse column vector x j . Subsequently, these measurements will be grouped into packets and transmitted to the receiver side via the wireless channel. The recovery at the receiver side is formulated by solving the following convex optimization problem

$$ {\widehat{\mathbf{x}}}_j= \arg \min {\left\Vert {\mathbf{x}}_j\right\Vert}_{\ell_1}\kern2.5em \mathrm{s}.\mathrm{t}.\kern1em \left\Vert {\mathbf{y}}_j-{\boldsymbol{\Phi} \mathbf{x}}_j\kern0.5em \right\Vert <\varepsilon $$
(2)

where ε bounds the noise level in the measurements. In our solution, orthogonal matching pursuit (OMP) [23] is utilized for reconstruction of the sparse vector\( {\widehat{\mathbf{x}}}_j \). Once the rearranged matrix {\( {\widehat{\mathbf{x}}}_j \)} is obtained, all the small parts\( {\widehat{\alpha}}_t \)can be reconstructed in reverse order as before. Afterwards, we can get the coefficient matrix \( {\widehat{b}}_i \) according to the combination of \( {\widehat{\alpha}}_t \). Finally, the original image blocks can be recovered by the inverse Haar wavelet transform (IHWT).

3.2 Adaptive Compressive Sampling

For each image block, compressive sampling is used to reduce the number of data to be transmitted. At present, conventional image compression algorithms based on BCS usually adopt a fixed MR for every block, resulting in the fact that the overall quality of the recovered image is limited. To overcome this problem, an adaptive compressive sampling scheme is designed to ensure that the diversities of blocks are considered. Specifically, more compressive measurements are assigned to those blocks with rich edge and texture information, while a handful of measurements are assigned to other blocks which are relatively smooth. In our approach, the absolute sum of HWT coefficients of each block that exhibits the amount of information is evaluated to determine the corresponding MR. The idea behind this is that more measurements will be assigned to those blocks containing large absolute coefficients. For b i (i = 1,...,B), let \( {b}_i^k \) (k = 1,..., m 2) be the kth HWT coefficient, the absolute sum S i is calculated as

$$ {S}_i=\sum_{k=1}^{m^2}\left|{b}_i^k\right| $$
(3)

Then MR of the ith block, MR i , can be determined by

$$ {\mathrm{MR}}_i={\mathrm{MR}}_{pre}\times \frac{B\times {S}_i}{\sum_{j=1}^B{S}_j}\kern0.5em $$
(4)

where MR pre is the predefined MR that is evaluated according to the residual energy of sensor nodes and the link quality of network, and the details will be described in the next section. Note that, for convenience, the value of MR i is set in the range of 0.2 to 0.8. Accordingly, the number of compressive measurements of the ith block is computed as M i  = [MR i  × m 2], where [·] is the round operation.

3.3 Image Quality Control

Since energy consumption is of high priority on energy-constrained video sensor nodes, an adaptive image quality control strategy is desired. The quality of recovered images depends largely on the number of compressive measurements, thus it is important for sensor nodes to achieve a tradeoff between the energy consumption and image quality. To solve this problem, we propose to adaptively adjust MR pre according to the residual energy of nodes so as to control image quality. That is, a relatively large MR pre is predefined if a certain sensor node has sufficient residual energy, and vice versa.

On the other hand, the link quality of network also has important effects on the quality of image recovery. As mentioned before, the image quality decreases with the decrease of ALQI. For the purpose of achieving good image quality, MR pre should also be adjusted based on ALQI. Simply, a larger MR pre should be assigned when ALQI decreases. Moreover, the link quality is extremely poor when ALQI drops below a certain value. In this case, the number of received measurements at the host is too small to recover the original image. In our solution, if ALQI is less than a threshold, there is no need to compress images for sensor nodes. Conversely, the network link becomes more stable as ALQI increases. A small MR pre that is adequate for desirable image quality allows nodes to reduce the computation cost and communication overhead.

Considering the two factors mentioned above, we propose an image quality control strategy, whose strength is that MR pre can be adaptively generated according to the residual energy of nodes and the link quality of network. For a certain video sensor node, its MR pre is formulated as

$$ {\mathrm{MR}}_{pre}=1-{\left(\frac{\mathrm{ALQI}-{\mathrm{ALQI}}_{th}}{1-{\mathrm{ALQI}}_{th}}\right)}^{\frac{2{E}_r}{E_o}} $$
(5)

where E r and E o denote the residual energy and initial energy of the sensor node, respectively. E r /E o is the ratio between them, and denotes the level of residual energy that is a key parameter to adjust MR pre . Concretely, a value smaller than 0.5 corresponds to a low energy level, which means the concerning point is energy saving and the image quality is secondary. On the contrary, a value greater than 0.5 means a large MR pre can be assigned for better image quality by the sacrifice of energy efficiency. Besides, ALQI theoretically ranging from 0 to 1 indicates the current link qulity, and ALQI th is the specific threshold. Once MR pre is predetermined, MR i can be designated according to (4).

The relationship curves of MR pre vs. ALQI under three different conditions of E r /E o are illustrated in Fig. 2. There are several points learned from this figure. Firstly, MR pre increases with the decrease of ALQI in all situations. As a result, video sensor nodes will increase the number of compressive measurements when the link quality of network gets worse. Through doing this, a desirable image quality can be achieved at the receiver side. Secondly, MR pre corresponding to a high value of E r /E o is larger than that with low E r /E o under the same ALQI. For example, when ALQI is equal to 0.8, MR pre under three levels of residual energy are 0.29, 0.50 and 0.75, respectively. That is, a larger MR pre is assigned to a sensor node with sufficient residual energy for better image quality. On the contrary, for a node with less residual energy, MR pre is relatively small to prevent excessive energy consumption. This is very conducive to balancing the energy of nodes and further prolonging the network lifetime.

Fig. 2
figure 2

MR pre vs. ALQI curves under different E r /E o

3.4 Image transmission

After compressive sampling, all of measurements of each block are packeted for wireless transmission without quantization and coding. ZigBee technology is utilized for data packets transmission between nodes. Since the maximum packet size of physical layer is 127 bytes, considering the overhead at the network, MAC and physical layers, we set the maximum payload per packet to 70 bytes, in which no more than 64 bytes for measurements and the fixed-length 6 bytes for side information, such as total packet length and block position in the image.

As previously mentioned, the quality of the recovered images relies on the number of measurements. Even if there occurs packet losses during transmission, the degradation of image quality is graceful. Since the side information can inform the receiver which part of measurements is received, it is feasible to recover the original images. It is worth mention that the measurement matrix should be regrouped by eliminating the rows corresponding to the lost measurements.

4 Experiment Results

4.1 Video Sensor Nodes

As for wireless video sensor nodes, there are hardly standard solutions or off-the-shelf products on the market as far as we know. Tavli et al. presented an overview of nine available video sensor nodes, most of which are designed based on expensive commercial sensor platforms [22]. Besides, for some video sensor nodes, there is no OS governing the operation of the platforms. This adds up many difficulties to reprogram those platforms for different applications.

Different from the existing video sensor nodes, we customize a wireless video sensor node using a completely original architecture, as shown in Fig. 3. The node is designed to be a three-tier structure to reduce the size. The bottom layer mainly integrates a high speed 32-bit ARM processor, 128 MB external SDRAM and 2 MB FLASH storing image data and compression code, respectively. In the middle layer, a ZigBee module (CC2530) is used as the transceiver for networking and wireless communication. According to TI Z-Stack, a ZigBee compliant protocol stack for IEEE 802.15.4, video sensor nodes can be easily deployed to form a star, tree or mesh network. The top layer consists of sensing modules, i.e., a small size and low power CMOS image sensor (OV9655) and two scalar sensors (microwave induction module and pyroelectric infrared sensor). Note that only if the scalar sensors detect moving objects, the processor is triggered to control the camera module to capture images. Otherwise, the processor and the camera module stay inactive for energy saving. The rationale is not addressed herein because the scalar sensors are not used in this paper. The entire video sensor nodes can be powered by either 3.3 V battery, USB cable or 5 V DC power adapter. Embedded Linux system and OpenCV library are transplanted into the platform to simplify the image compression.

Fig. 3
figure 3

A prototype of wireless video sensor node

4.2 Performance Evaluation

The performance evaluation is conducted in terms of the quality of recovered images, execution time and energy consumption. Since the peak signal to noise ratio (PSNR) has a good character to reflect the similarity of the two images with a low cost, it is used to evaluate the image quality in our experiments. The higher PSNR the better image quality. PSNR is the ratio of the peak signal energy to the mean squared error (MSE) between the recovered image and the original image, and is usually expressed as

$$ \mathrm{PSNR}={10 \log}_{10}\left(\frac{255^2}{\mathrm{MSE}}\right) $$
(6)
$$ \mathrm{MSE}=\frac{1}{ M N}\sum_{x=1}^M\sum_{y=1}^N{\left[\mathbf{I}\left( x, y\right)-{\mathbf{I}}_{\mathbf{r}}\left( x, y\right)\right]}^2 $$
(7)

where I(x, y) and I r (x, y) represent the value of pixel at (x, y) of the original image and the recovered image, respectively. Besides, energy consumption E can be computed as E = VIt, where V is the operating voltage, I is the current consumption and t is the execution time. The proposed algorithm is implemented in C++ and successfully tested on video sensor nodes. Note that the experimental results with respect to PSNR, E and t are the averaged value of 20 repeated tests, and the parameters used in our scheme are as follows: m = 16, l = 3, ε = 10 and ALQI th  = 0.6.

In this section, the compression algorithm is tested on a single video sensor node. We analyze the compression performance under different conditions of the residual energy and LAQI. In our experiments, all the real-world images (320 × 240) are captured by the customized nodes and other several standard images (256 × 256) are previously stored in the on-board SDRAM. Due to space constraints, only parts of experimental results are given and discussed below.

4.2.1 Adaptive MR

We firstly compare the differences between adaptive MR and fixed MR. For a given MR pre , adaptive MR denotes that MR of each block is determined according to (4), while fixed MR means that all blocks adopt MR pre . In order to illustrate that image compression benefits from adaptive MR, five real-world images are tested using the two different compression strategies. These images are the lake view pictures taken in the morning, noon, night, sunny day and rainy day, respectively. The corresponding results under different values of MR pre are presented in Table 1.

Table 1 Performance comparisons between adaptive MR and fixed MR

For both strategies, we can observe from Table 1 that the larger MR pre and the longer the execution time. This means that the runtime of compression depends largely on the number of compressive measurements. Besides, the image quality increases with the increase of MR pre . Comparatively, the PSNRs of adaptive MR outperforms those of fixed MR about 0.6 dB to 3.5 dB, mainly because adaptive MR assigns more measurements to image blocks with rich feature information. Furthermore, adaptive MR runs more quickly than fixed MR in all situations. Take the image Morning for example, compared to fixed MR, the execution time of adaptive MR are separately reduced by 14.09 ms, 41.92 ms and 62.41 ms when MR pre is set to 0.35, 0.5 and 0.65, respectively. Shortening the execution time helps reduce energy consumption, thus adaptive MR prefers for video sensor nodes. In particular, for image Night, the execution time of adaptive MR is approximately 99 ms less than that of fixed MR under MR pre  = 0.65. This is because that most of blocks in this image are smooth regions whose MRs are assigned small values so that adaptive MR spends less computation time than fixed MR. The experiment indicates that adaptive MR gets better results in terms of PSNR and execution time.

The visual comparison is shown in Fig. 4, where the recovered images are generated under MR pre  = 0.5 and the columns from left to right separately correspond to original images, the recovered images with adaptive MR and the recovered images with fixed MR. Obviously, the recovered images of adaptive MR look more realistic than those of fixed MR. Specifically, adaptive MR preserves more details of the pavilion and trees regions. The results further validate that adaptive MR can achieve better image quality than fixed MR.

Fig. 4
figure 4

Recovered images under MR pre  = 0.5 (a) Original image, (b) Adaptive MR, (c) Fixed MR

4.2.2 Image Compression Comparisons

We report the overall and extensive experimental results to evaluate compression efficiency of our scheme in relation to two traditional algorithms. For convenience, the proposed scheme is named as Scheme A. The algorithm presented in [12] is called as Scheme B, which is also based on BCS. Like conventional methods, it converts the coefficients of every block into a column after DWT and assigns the same MR to each block. The algorithm mentioned in [19] is called as Scheme C, in which the similar coefficient rearrangement is utilized, but DWT and the coefficient rearrangement are operated on the whole image. Besides, an extra weight matrix is introduced into compressive sampling to promote the image quality. Three standard images (Baboon, Lena and Fruits), and three real-word images (Camera, Lab and Testbed) are used in the experiments.

The comparisons of PSNR, execution time and energy consumption are displayed in Table 2 under three different MR pre conditions. From Table 2, we can see that PSNRs of Scheme A are larger than those of Scheme B for all images. For example, the PSNR of Scheme A outperforms Scheme B about 1.1 dB for image Camera under MR pre  = 0.65. The reason for this is that Scheme A adopts adaptive MR, whereas Scheme B uses the fixed MR. As a result, the image quality of Scheme A is improved under the same MR pre . However, we can also find that Scheme C is superior to our scheme in PSNR. The rationale behind this is easy to understand. According to the reference, Scheme C introduces a weight matrix that calculated from the transformed coefficients into the compressive sampling. Through a new measurement matrix generated by combining the weight matrix with a Gaussian matrix, higher weights are assigned to low-frequency components that represent the important features of an image, which leads to the improvement of image quality. Nevertheless, this procedure increases the computational complexity greatly. Moreover, unlike Scheme A in which the measurement matrix is a preset Bernoulli matrix, the new measurement matrix adopted in Scheme C varies for different images. This requires that the new measurement matrix should be transmitted to the host accompanied with the compressive measurements. Once some of the data packets corresponding to the new matrix are lost, which is likely to occur during transmission via the lossy channel, the original image can not be recovered according to the received measurements. Therefore, except for reducing communication overhead, Scheme A also has better robustness to packet losses than Scheme C.

Table 2 Performances comparisons of different compression algorithms

Furthermore, Scheme A has special advantages over other two schemes in execution time and energy consumption. For instance, for image Baboon under MR pre  = 0.65, Scheme A runs faster than Scheme B and Scheme C about 496 ms and 149 ms, respectively. Besides, Scheme A separately saves energy around 148.8 mJ and 44.7 mJ relative to Scheme B and Scheme C, which demonstrates that our scheme conforms to the goal of saving energy. Likewise, the execution time and energy consumption of Scheme A are still are predominant for other images in other conditions. The reasons for this come from two aspects. Firstly, compared to Scheme B, Scheme A utilizes the coefficient rearrangement and adaptive MR, which leads to the reduction in computational overhead. Secondly, since Scheme C adopts the weight matrix and directly processes the whole image instead of block division, the computational complexity will significantly increase.

For visual observation, the recovered images under MR pre  = 0.5 are shown in Fig. 5, where the original image, the recovered images of Scheme A, B and C are given from left to right. We can see from this figure that Scheme A is better than Scheme B while slightly worse than Scheme C in terms of image quality. However, as mentioned earlier, our scheme achieves a good trade-off between energy consumption and compression performance. From this point of view, it is clear that Scheme A is the most suitable for the source-constrained video sensor nodes.

Fig. 5
figure 5

Recovered image under MR pre  = 0.5 (a) Original image, (b) Scheme A, (c) Scheme B, (d) Scheme C

4.2.3 Image Quality Control

In this experiment, we focus on how the residual energy of nodes and the link quality of network affect image quality. Once E r /E o and ALQI are preset, video sensor nodes can automatically generate their respective MR pre using (5). To simulate the packet loss during wireless transmission, we bring in the relationship between PLR and ALQI, as described in [21]. The relationship points out that PLR gradually reduces as ALQI increases, and the data packets begin to be received only if ALQI exceeds 0.6. Thus only PSNRs under ALQI from 0.675 to 0.95 are shown in Table 3, and three representative values of E r /E o are discussed due to space constraints. According to the PSNRs under different conditions, it is concluded that the proposed scheme achieves the image quality control as expected.

Table 3 Image quality under different conditions of ALQI and E r /E o

There are a few points we can learn from Table 3. First, the larger E r /E o and the better the image quality under the same ALQI. We analyze the results in Table 3 with the example of Lena. Compared with E r /E o  = 1, PSNRs decrease by 2.89 dB at most under E r /E o  = 0.5. When E r /E o further reduces to 0.25, the maximum reduction of PSNRs reaches to 5.1 dB. This means that a sensor node with sufficient residual energy will be assigned a large MR pre , which leads to better image quality. On the contrary, if the node has less residual energy, it will be assigned a small MR pre to reduce computational overhead and communication consumption. Second, for all test images, PSNRs have a maximum value and always hold a relatively high level in a certain range of ALQI. Specifically, for image Lena, PSNRs are almost equal when ALQI varies from 0.75 to 0.85 under E r /E o  = 0.25, which accounts for approximately 25% of the effective range of ALQI. Besides, we can get the similar conclusions in other two situations. It is the consequence of the unique control scheme by which the image quality can be adaptively adjusted based on the link quality of network. It indicates that a large MR pre should be assigned to video sensor nodes for the purpose of promoting the image quality when the link quality is poor. On the other hand, a relative small MR pre that is enough for desirable image quality can be used to reduce energy consumption of sensor nodes when the network is stable.

Furthermore, Fig. 6 shows the relationship curves of PSNR versus ALQI and E r /E o . In the beginning, PSNRs stay at a low level and nearly equal to each other because of the unstable link quality. Under this circumstance, a high PLR results in the poor image quality despite of the residual energy. In the middle of curves, the image quality has a gradual increase and keeps stable within a certain ALQI range, as aforementioned. In the end, PSNRs decreases with the continuous increase of ALQI, which means we put more weight on reducing energy consumption when PLR is low.

Fig. 6
figure 6

PSNR curves of Lena with respect to ALQI and E r /E o

4.3 Realistic Application

In order to validate that the proposed scheme is feasible for the practical application, we build a tiny scale wireless video network which consists of three video sensor nodes. For simplicity, three nodes are separately named as node 1, node 2 and node 3. According to TI Z-Stack, node 2 and node 3 are configured as the end devices which monitor a specific area from different orientations. For another, node 1 is configured as the coordinator which is approximately 2 and 5 m from node 2 and node 3, respectively. Besides, it connects to a host by USB interface to send commands to sensor nodes and receive data packets from them. Finally, these data packets are utilized to reconstruct the original images via the host software. In this experiment, all of the sensor nodes are powered by two rechargeable 3.3 V 3200 mAh lithium cells connected in parallel. On-board CC2530 chip operating at 2.4 GHz is used to implement networking and wireless communication, the MAC protocol is IEEE 802.15.4 and the physical layer data rate is 250 kbps. Fig. 7 shows the recovered images of node 2 (left) and node 3 (right) at two different moments with about 7 h of time difference.

Fig. 7
figure 7

Recovered images on the host (a) node 2: E r /E o  = 0.95, ALQI = 0.88, PSNR = 22.56 dB, Energy consumption = 96.39 mJ, node 3: E r /E o  = 0.91, ALQI = 0.76, PSNR = 21.79 dB, Energy consumption = 140.51 mJ, (b) node 2: E r /E o  = 0.58, ALQI = 0.89, PSNR = 21.28 dB, Energy consumption = 73.01 mJ, node 3: E r /E o  = 0.49, ALQI = 0.75, PSNR = 20.19 dB, Energy consumption = 112.77 mJ

We can see from Fig. 7 that both of the two video sensor nodes have good image quality, and PSNRs of node 2 are slightly higher than those of node 3 at the same moment. This is because that node 2 has more residual energy and better link quality than node 3. For example, from Fig. 7 (a), the corresponding E r /E o of node 2 and node 3 are separately 0.95 and 0.91, plus their ALQIs are separately 0.88 and 0.76. Besides, the PSNRs in Fig. 7 (b) respectively decrease by about 1.28 dB and 1.6 dB, compared to Fig. 7 (a). For the same node, since the link quality of network is almost unchanged during the experiment, MR pre for image recovery is mainly determined by the residual energy. For the two nodes, the residual energy in Fig. 7 (b) is less than that in Fig. 7 (a), which indicates that the image quality indeed decreases as the residual energy of sensor nodes reduces.

Furthermore, there are two things we can learn from the view of energy consumption. Firstly, the energy consumption of node 3 is much less than that of node 2. From Fig. 7, node 2 respectively consumes 44.12 mJ and 39.76 mJ less than node 3 at two moments. The reason for this may be that node 3 has a worse link quality than node 2, that is, node 3 is more likely to lose data packets during wireless transmission. To avoid the effect on the image quality, node 3 generates and transmits more compressive measurements, which results in the increase of energy consumption. Secondly, the sensor node with insufficient residual energy will consume less energy. As for node 2, the energy consumptions at two moments are 96.39 mJ and 73.01 mJ, respectively. Comparatively, the energy consumption at the second moment reduces by about 24.3%. It is because that MR pre automatically decreases according to our scheme. Based on (5), we can notice that MR pre of the first moment is 0.63, and it reduces to 0.49 at the second moment. This means that the proposed scheme enables to prolong the lifetime of sensor nodes by degrading image quality as the residual energy gradually declines.

5 Conclusions

In this paper, a new energy-efficient image compression algorithm for video sensor nodes is proposed. The algorithm includes HWT, coefficient rearrangement and adaptive image quality control based on the residual energy of video sensor nodes and the link quality of network. As a result, our algorithm runs faster and achieves a good tradeoff between energy consumption and compression performance. Furthermore, the image quality control scheme achieves a stable compression performance in a range of the link quality of network, demonstrating that the proposed method has a better robustness to combat packet loss. The test results and practical application indicate that the proposed scheme is suitable for the resource-limited video sensor nodes. In the future, we will conduct researches centering on some key issues for image compression and communication in WVSN, such as data routing strategy, in-network image processing and error resilience. Besides, we intend to find the exactly relationship between ALQI and PLR to further optimize MR assignment.