A UAV image compression method based on region of interest extraction
By using a UAV image compression algorithm that extracts and segments regions of interest, the problem of low transmission efficiency in UAV image transmission is solved, enabling efficient image transmission and high-quality reproduction of regions of interest in emergency application scenarios.
Patent Information
- Application Number
- CN202410480951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-04-22
AI Technical Summary
Image transmission from drones is limited by wireless network bandwidth. Existing compression methods cannot improve transmission efficiency while ensuring image quality, especially in emergency application scenarios. Existing technologies cannot meet the needs of different scenarios.
A UAV image compression algorithm based on region of interest extraction is adopted. The image is divided into regions of interest and non-regions of interest through superpixel segmentation and DBSCAN region clustering. Lossless and lossy compression strategies are adopted respectively, and priority is given to ensuring the transmission quality of regions of interest.
Under bandwidth constraints, higher compression efficiency and transmission quality are achieved, meeting the timely feedback needs of emergency application scenarios while ensuring the quality of effective information in the region of interest.
Smart Images

Figure CN118381924B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of UAV image compression and transmission technology, specifically relating to a UAV image compression algorithm based on region of interest extraction. Background Technology
[0002] A drone is an aircraft that can fly without human control. Equipped with various sensors, cameras, and communication devices, it performs tasks and can fly, hover, and turn in various environments, exhibiting high flexibility and maneuverability. Drones have a wide range of applications, including geological exploration, agricultural management, urban planning, environmental monitoring, and search and rescue. Drones provide an effective solution for timely communication in emergency rescue scenarios. For example, in the event of sudden forest fires, mudslides, earthquakes, or other disasters, drones can capture images or videos and transmit them to ground stations in a timely manner, providing real-time visuals for emergency analysis and decision-making. However, drone transmission is limited by the bandwidth of wireless networks, resulting in slow real-time transmission times or even failure to complete transmission.
[0003] Drone images contain a wealth of data, much of which is redundant. Most existing image compression methods process the entire image individually. Using only lossy compression methods to achieve high compression ratios results in information loss, potentially degrading image quality, especially in important details, which could affect subsequent image analysis and applications. Lossless compression, on the other hand, preserves all image information but usually leads to a large data volume, increasing transmission and storage costs, particularly for large-scale drone image data. Therefore, a single compression method cannot adequately adapt to different scenarios and needs. Summary of the Invention
[0004] To improve transmission efficiency, save storage space, and meet the needs of real-time applications, this invention provides a UAV image compression algorithm based on region of interest extraction. When there are target individuals in the UAV image, different regions and different compression strategies are adopted to achieve higher compression efficiency. Under bandwidth constraints, priority is given to ensuring the transmission quality of the region of interest, which not only meets the need for timely feedback in emergency application scenarios, but also ensures better quality of effective information in the transmitted image.
[0005] To achieve the above objectives, the technical solution adopted by this invention is as follows: a UAV image compression method based on region of interest extraction, the specific steps of which are as follows:
[0006] Step 1: Region of Interest Extraction and Segmentation: The input image is preprocessed using the SLIC superpixel segmentation algorithm to initialize the number of superpixels K, dividing the input image into K roughly equal-sized blocks. The original RGB color image is then converted to the CIELAB color space through mapping. The color features (L, a, b) and coordinates (x, y) of each pixel in the CIELAB color space are combined into a vector (L, a, b, x, y) for distance measurement. Cluster centers C are initialized by selecting cluster centers through uniform intervals or based on pixel features. k =[L k ,a k ,b k ,x k ,y k ] T .
[0007] For each pixel p, assume that pixel p is related to the cluster center C k Distance D between p Then, assign pixel p to the nearest cluster center; use the average value of all pixels in the cluster as the new cluster center, and update the center of each cluster; check if the cluster centers have converged. If the movement is less than a certain threshold, terminate the algorithm; otherwise, return to the previous steps.
[0008] After superpixel segmentation, K superpixel blocks are obtained. These K superpixel blocks are then clustered using the DBSCAN region clustering algorithm. The parameters are initialized with the neighborhood radius ε and the minimum number of points within the neighborhood MinPts. A cluster center C is then arbitrarily selected from each superpixel block. p Calculation with C p N(p) is the number of points in the neighborhood centered at ε with radius ε.
[0009] If N(p)≥MinPts, then C p Point q is considered a core point if it lies within the ε-neighborhood of point p and p is a core point; if a point q is density-reachable from point p, then point q is considered a core point if there exists a sequence of points p1, p2, ..., p. n Where p1 = p, p n =q, and for any p i ,p i+1 All are made by p i If the density is reachable, then point q is said to be connected by the density of point p.
[0010] Based on the density connectivity, the K superpixel blocks are divided into several clusters. Each cluster contains at least one core point and all points that are reachable by the density of the core point. Points that do not belong to any cluster are marked as noise points.
[0011] After region clustering, based on the pixel color features of the input image, its region of interest will be divided into a cluster, the coordinate position information of the region of interest will be recorded, and it will be determined whether each pixel of the image belongs to the region of interest, thus dividing the original image into regions of interest and non-regions of interest.
[0012] Step 2, JPEG image compression: After segmentation, the original image is divided into two sub-images. Different compression ratios are applied to the two sub-images. Lossless compression is used for the region of interest, while high compression ratio is used for the region of non-interest.
[0013] III. Transmission or Storage: After image compression, the compressed data information is combined with the coordinate location information of the region of interest and transmitted to the ground receiving station via a wireless channel.
[0014] IV. Image Reconstruction: After receiving the image data, the image is first decompressed, and then the region of interest and non-region of interest sub-images are synthesized based on the coordinates of the region of interest to reconstruct the original image.
[0015] In step one, the color features (L, a, b) and coordinates (x, y) of each pixel are combined into a vector (L, a, b, x, y) for distance measurement. Pixel C k The color distance d between p and p lab Specifically as follows:
[0016]
[0017] Pixel C k The spatial distance d between p and xy Specifically as follows:
[0018]
[0019] Among them, l n (n=k,p) represents the characteristic distance value of brightness in the color space, a n b represents the characteristic distance value of the magenta hue in the color space. n x represents the characteristic distance value of the yellow family in the color space. n The x-coordinate value of a pixel, y n This represents the ordinate value of a pixel.
[0020] Through D p Measure the final distance:
[0021]
[0022] Where m represents the spatial and pixel color metric, and m ranges from [1, 40], d c This represents the maximum spatial distance within the class.
[0023] In step two, the input image is divided into multiple 8*8 blocks. A two-dimensional DCT transform is performed on each 8*8 block. After the DCT transform, 64 discrete cosine transform coefficients in the frequency domain are obtained. The 64 discrete cosine transform coefficients are quantized to obtain an 8*8 coefficient. Then, the quantized coefficients are entropy encoded using an entropy coding table to obtain the compressed image data.
[0024] Quantization adjusts the compression quality by changing the quality factor (qf), controlling the compression ratio and the degree of distortion between the compressed image and the original image. qf can take any integer between 1 and 100. The larger the qf, the lower the compression ratio, the larger the space occupied by the compressed image file, and the higher the similarity between the compressed image and the original image. When qf = 100, JPEG is a near-lossless compression algorithm.
[0025] The effect of qf on image compression is achieved through the quantization matrix. The specific algorithm is as follows: Input a default quantization matrix Q and a quality parameter qf. Calculate the scaling factor (sf) based on qf. If qf ≥ 50, then sf = (100 - qf) / 50; if qf < 50, then sf = 50 / qf. Multiply sf by the default quantization matrix Q to obtain the scaled quantization matrix. When qf = 50, sf = 1, and the scaled quantization matrix is the same as the original quantization matrix. When qf = 100, sf = 0, and the scaled quantization matrix is replaced by a matrix of all 1s. A matrix of all 1s means there is no loss of precision during quantization, and the output matrix retains all the values of the original matrix, thus achieving lossless compression.
[0026] After segmentation, the original image is divided into two sub-images. When compressing the two sub-images with different compression ratios, lossless compression is used for the region of interest with qf=100, and high compression ratio is used for the region of non-interest with qf adjusted to the range [1,90].
[0027] Compared with existing technologies, the specific benefits of this invention are as follows: When there are target individuals in the UAV image, this invention adopts different compression strategies for different regions. It applies lossy image compression to non-interested regions and lossless image compression to regions of interest, achieving higher compression efficiency. Under bandwidth constraints, it prioritizes the transmission quality of regions of interest, which not only meets the need for timely feedback in emergency application scenarios, but also ensures better quality of effective information in the regions of interest of the transmitted image. Attached Figure Description
[0028] Figure 1 This is the overall flowchart of the present invention.
[0029] Figure 2 This is a flowchart of the SLIC algorithm.
[0030] Figure 3 This is a flowchart of the DBSCAN algorithm.
[0031] Figure 4 This is a flowchart of the JPEG algorithm.
[0032] Figure 5 This is the original image of sample 1 in the example.
[0033] Figure 6 The image shown is the sample 1 image after compression, transmission, decompression and reconstruction in the embodiment.
[0034] Figure 7 This is a graph showing the maximum compression ratio of the entire image as a function of the ROI ratio in this algorithm. Detailed Implementation
[0035] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0036] like Figure 1 As shown, a UAV image compression method based on region of interest extraction has the following specific steps:
[0037] Step 1: Extraction and segmentation of the region of interest: such as Figure 2 As shown, the number of superpixels K is initialized, and the input image is divided into K blocks of approximately equal size. The original RGB color image is transformed to the CIELAB color space through mapping. The CIELAB color space consists of three elements (L, a, b), where L represents luminance, a represents the range from magenta to green, and b represents the range from yellow to blue. Compared to the RGB space, the CIELAB space can retain a wider color area and provide richer color features. The color features (L, a, b) and coordinates (x, y) of each pixel in the CIELAB color space are combined into a vector (L, a, b, x, y) for distance measurement; cluster centers C are initialized by selecting cluster centers through uniform intervals or based on pixel features. k =[L k ,a k ,b k ,x k ,y k ] T For each pixel p, assume it is clustered with the cluster center C. k Distance D between pAnd assign it to the nearest cluster center. C k The color distance d between p and p lab and spatial distance d xy The specific formula is as follows:
[0038]
[0039] Among them, l k l represents the feature distance value of the brightness of pixel k in the color space. p The feature distance value representing the brightness of pixel p in the color space; a n b represents the characteristic distance value of the magenta hue in the color space. n x represents the characteristic distance value of the yellow family in the color space. n The x-coordinate value of a pixel, y n This represents the ordinate value of a pixel, and then through D p Measure the final distance:
[0040]
[0041] Where m represents the space and pixel color metric, ranging from 1 to 40 (in pixels), d c D is the maximum spatial distance within the class. p The smaller the value, the more similar the two clusters are. The average value of all pixels within that cluster is used as the new cluster center, and the center of each cluster is updated accordingly. The algorithm checks if the cluster centers have converged; if the shift is less than a certain threshold, the algorithm terminates; otherwise, it returns to the previous steps.
[0042] like Figure 3 As shown, after superpixel segmentation, K superpixel blocks are obtained. Clustering is performed using the DBSCAN region clustering algorithm. The parameters are initialized with the neighborhood radius ε and the minimum number of points in the neighborhood MinPts. A cluster center C is arbitrarily selected from the superpixel blocks. p Calculation with C p N(p) is the number of points in the neighborhood centered at ε with radius ε.
[0043] If N(p)≥MinPts, then C p Point q is considered a core point. If point q is within the ε-neighborhood of point p, and point p is a core point, then point q is considered density-reachable from point p. If there exists a sequence of points p1, p2, ..., p... n Where p1 = p, p n =q, and for any p i ,p i+1 All are made by p iIf a point q is density-reachable, it is said to be density-connected by point p. Based on the density connectivity, the K superpixel blocks are divided into several clusters. Each cluster contains at least one core point and all points density-reachable from the core point. Points not belonging to any cluster are marked as noise points. After region clustering, based on the pixel color features of the input image, its region of interest (ROI) will be divided into a cluster. The coordinate position information of the ROI is recorded, and it is determined whether each pixel in the image belongs to the ROI, thus segmenting the original image into ROI and non-ROI regions.
[0044] like Figure 4 As shown, JPEG compression works as follows: After segmentation, the original image is divided into two sub-images, and different compression ratios are applied to these two parts. Lossless compression is used for the region of interest (ROI), while a high compression ratio is applied to the non-ROI region. This ensures both high-efficiency image compression and high-quality reproduction of the ROI. The JPEG algorithm achieves efficient image compression and decompression through techniques such as Discrete Cosine Transform (DCT), quantization, and zero-value coding. The input image is first divided into many 8*8 (pixel) blocks. Then, a two-dimensional DCT is performed on each 8*8 (pixel) block. After the DCT, 64 discrete cosine transform coefficients in the frequency domain are obtained, and these 64 coefficients are quantized. The specific values of the quantization table necessary for DCT coefficient quantization and the table necessary for entropy coding vary depending on the encoded image. The quantized result is still an 8*8 64 coefficient, but this coefficient is a low-frequency 8*8 coefficient concentrated in the upper left corner. Finally, entropy coding is performed using the entropy coding table, resulting in the compressed image data. Quantization adjusts the compression quality by changing the quality factor (qf), controlling the compression ratio and the degree of distortion between the compressed image and the original image. qf can take any integer between 1 and 100. The larger the qf, the lower the compression ratio, the larger the compressed image file size, and the higher the similarity between the compressed image and the original image. When qf = 100, JPEG is a near-lossless compression algorithm.
[0045] The effect of qf on image compression is achieved through the quantization matrix. The specific algorithm is as follows: Input the default quantization matrix Q and the quality parameter qf. Calculate the scaling factor (sf) based on qf. If qf ≥ 50, then sf = (100 - qf) / 50; if qf < 50, then sf = 50 / qf. Multiply sf by the default quantization matrix Q to obtain the scaled quantization matrix. When qf = 50, sf = 1, and the scaled quantization matrix is the same as the original quantization matrix. When qf = 100, sf = 0, and the scaled quantization matrix is replaced by a matrix of all 1s. A matrix of all 1s means there is no loss of precision during quantization, and the output matrix retains all the values of the original matrix, thus achieving lossless compression. After segmentation, the original image is divided into two sub-images. When compressing the two sub-images using different compression ratios, lossless compression is used for the region of interest (ROI) with qf = 100, while a high compression ratio is used for the non-ROI region, adjusting the qf range to [1, 90].
[0046] Transmission or storage: After image compression, the compressed data information of the two parts and the coordinate position information of the region of interest are combined and transmitted to the ground receiving station through a wireless channel.
[0047] Image reconstruction: After receiving image data, the image is first decompressed, and then the region of interest and non-region of interest sub-images are synthesized based on the coordinates of the region of interest, thereby reconstructing the original image.
[0048] This invention utilizes MATLAB R2018a programming environment to simulate and verify the algorithm. In the experiment, as... Figure 5 As shown, the fire image was used as the experimental image for sample 1, with an image size of 720*960. The performance of the algorithm was analyzed from the perspectives of compression ratio (CR), peak signal-to-noise ratio (PSNR), and structural similarity (SSIM). The image of sample 1 after compression, transmission, decompression, and reconstruction is shown in the figure. Figure 6 As shown, the transmitted image has high fidelity.
[0049] During the simulation verification process, the processing results of this algorithm and the JPEG algorithm were compared. The results are shown in Table 1. The calculation formula of the evaluation index is given below.
[0050] Image compression ratio (CR) refers to the ratio between the number of pixels before compression and the number of pixels after compression of an image. Usually, the image pixel compression ratio is expressed in numerical form, and the calculation formula is shown in formula (4):
[0051] Image pixel compression ratio = Original image pixel count / Compressed image pixel count (4)
[0052] Peak signal-to-noise ratio (PSNR) is a measure of the peak error between two images, as shown in Equation (5), where R represents the maximum pixel value of the input image:
[0053]
[0054] Structural similarity (SSIM) is an index used to judge the similarity between two images. SSIM can be used to measure the quality degradation of an image after image compression, as shown in formula (6), where x and y represent the two images respectively.
[0055] μ x μ y σ represents the average pixel value of the two images. xy σ is the covariance of image x and image y. 2x σ 2y Let C1 = (k1L) represent the variances of image x and image y, respectively. 2 C2 = (k2L) 2 Let k1 be two constants to avoid division by zero, and L be the range of pixel values, typically k1 = 0.01 and k2 = 0.03.
[0056]
[0057] As shown in Table 1, when the compression ratios of the entire image in Sample 1 are close to 27, 25, and 14 respectively, the objective evaluation metrics of ROI, PSNR = 46.37 dB and SSIM = 99.94%, achieved by our algorithm, are higher. Furthermore, when PSNR and SSIM are similar to the comparison algorithm, our algorithm achieves a higher compression ratio, reaching a maximum CR = 27.56 in Sample 1, effectively improving the image compression ratio and coding efficiency while ensuring the visual quality of the reconstructed ROI. Experiments show that a combination of lossy and lossless compression yields better PSNR and SSIM. Lossy compression of non-ROI regions provides a higher compression ratio, while lossless compression of ROI regions provides better PSNR and SSIM.
[0058] Table 1 Performance Comparison of Sample 1 Algorithm
[0059]
[0060] Figure 7The curves showing the extreme compression ratio of the algorithm on sample images as a function of the ROI ratio were plotted. It can be seen that when the ROI ratio is [0, 0.1], the extreme compression ratio ranges from [30, 100]; when the ROI ratio is [0.1, 0.5], the extreme compression ratio ranges from [10, 30]; and when the ROI ratio is [0.5, 1], the extreme compression ratio ranges from [5, 10]. This demonstrates that the algorithm can greatly improve coding efficiency while ensuring the visual quality of the ROI.
[0061] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the scope of the present invention.
Claims
1.A method for compressing images of a UAV based on region of interest extraction, characterized in that, The specific steps are as follows: Step one, extraction and segmentation of the region of interest: through the superpixel segmentation algorithm SLIC, the input original image is preprocessed, the number of superpixels K is initialized, the original image is divided into K blocks of equal size, the input original RGB color image is converted to CIELAB color space through mapping, the color features (L, a, b) and coordinates (x, y) of each pixel point in CIELAB color space are combined into a vector (L, a, b, x, y) for distance measurement; the cluster centers C are initialized by uniform spacing or based on pixel feature selection k = [L k ,a k ,b k ,x k ,y k ] T ; For each pixel p, assume the distance D k between pixel p and cluster center C p and assign pixel p to the nearest cluster center, update the center of each cluster using the average of the combined vectors of all pixels within the cluster as the new cluster center, check if the cluster centers have converged, if the amount of movement is less than some threshold, terminate the algorithm, otherwise repeat the above calculation of distances between pixels and cluster centers, implementation of clustering and calculation of cluster centers; After superpixel segmentation, K superpixel blocks are obtained, and the K superpixel blocks are clustered through a DBSCAN regional clustering algorithm, an initial parameter neighborhood radius ε and a minimum number of points in the neighborhood MinPts are selected from the superpixel blocks p arbitrarily as a cluster center C p , the number of points N(p) in the neighborhood with C as the center and a radius of ε is calculated; If N(p) ≥ MinPts, then C p is considered a core point; If point q is within the ε-neighborhood of point p, and point p is a core point, then point q is considered to be density-reachable from point p; if there exists a sequence of points p1, p2, ..., p... n p1 = p, p n =q, and for any p i ,p i+1 All are made by p i If the density is reachable, then point q is said to be connected by the density of point p; According to the density connection relationship, the K superpixel blocks are divided into a plurality of clusters, each cluster contains at least one core point and all points reachable from the core point, and points not belonging to any cluster are marked as noise points; After regional clustering, based on the pixel color features of the input original image, the region of interest is divided into a cluster, the coordinate position information of the region of interest is recorded, it is judged whether each pixel of the original image belongs to the region of interest, and the original image is divided into the region of interest and the non-region of interest; Step two, JPEG image compression: after segmentation, the original image is divided into a region of interest and a non-region of interest, and different compression ratios are used for compression of the two subgraphs, lossless compression is used for the region of interest, and high compression ratio is used for compression of the non-region of interest; Step three, transmission or storage: after compression of the original image, the compressed data information and the coordinate position information of the region of interest are combined and transmitted to the ground receiving station through a wireless channel; Step four, image reconstruction: receive the image data information transmitted in step three, first perform decompression operation, then synthesize the region of interest subgraph and the non-region of interest subgraph according to the coordinate position information of the region of interest, and reconstruct the original image. 2.The UAV image compression method based on the ROI extraction of claim 1, wherein, In step one, the color feature (L, a, b) and the coordinate (x, y) of each pixel point are combined into a vector (L, a, b, x, y) for distance measurement, and the cluster center C k The color distance d between the pixel point p and the cluster center C lab Specifically as follows: Cluster center C k Spatial distance d between pixel p and the cluster center C xy As follows: wherein, l n (n=k, p) represents the characteristic value of brightness in the color space, a n (n=k, p) represents the magenta value in the color space, b n (n=k, p) represents the yellow value in the color space, x n (n=k, p) represents the horizontal coordinate value of the cluster center (when n=k) or the pixel point (when n=p), y n (n=k, p) represents the vertical coordinate value of the cluster center (when n=k) or the pixel point (when n=p). By D p Measure final distance: where m represents the metric of the space and the metric of the pixel color, m is in the range of [1, 40], d c is the intra-class maximum spatial distance. 3.The UAV image compression method based on the ROI extraction of claim 1, wherein, In step two, the input original image is divided into a plurality of 8*8 blocks, two-dimensional DCT transformation is performed on each 8*8 block, 64 discrete cosine transform coefficients in the frequency domain are obtained after DCT transformation, quantization is performed on the 64 discrete cosine transform coefficients to obtain an 8*8 coefficient, and entropy coding is performed on the quantized coefficient by using an entropy coding table to obtain the compressed image data; Quantization adjusts the compression quality by changing the quality parameter, controls the compression ratio and the distortion degree of the compressed image and the original image, and qf takes any integer between 1 and 100; The influence of qf on image compression is realized by a quantization matrix, and the specific algorithm is: input the default quantization matrix Q and the quality parameter qf, calculate the scaling factor sf according to qf, if qf≥50, then sf=(100-qf) / 50, if qf<50, then sf=50 / qf, multiply sf and the default quantization matrix Q to obtain the scaled quantization matrix; when qf=50, sf=1, the scaled quantization matrix is the same as the original quantization matrix; when qf=100, sf=0, the scaled quantization matrix is replaced by a full 1 matrix; After segmentation, the original image is divided into two subgraphs, and different compression ratios are used for compression of the two subgraphs, lossless compression is used for the region of interest with qf=100, and high compression ratio is used for compression adjustment of the non-region of interest, qf ranges from 1 to 90.
Citation Information
Patent Citations
Reconnaissance image compression method for unmanned aerial vehicle
CN104754340A
Unmanned aerial vehicle image processing and transmission method
CN112839228A