CN113038139A - Image compression method applied to machine patrol picture uploading - Google Patents
Image compression method applied to machine patrol picture uploading Download PDFInfo
- Publication number
- CN113038139A CN113038139A CN202110322161.2A CN202110322161A CN113038139A CN 113038139 A CN113038139 A CN 113038139A CN 202110322161 A CN202110322161 A CN 202110322161A CN 113038139 A CN113038139 A CN 113038139A
- Authority
- CN
- China
- Prior art keywords
- compression method
- picture
- target
- image
- compression
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses an image compression method applied to machine patrol picture uploading, which comprises the following steps: step 1, obtaining a target picture; step 2, detecting whether the target picture needs to be compressed; step 3, judging whether the target picture can use a WebP compression method or not in the current application scene if compression is needed; if yes, selecting a WebP compression method and jumping to the step 5; step 4, judging whether a Guetzli compression method can be used in the current application scene; if so, selecting a Guetzli compression method; if not, selecting a Libjpg compression method; step 5, selecting compression parameters to perform image compression according to the size of the source image to obtain a target compressed image; the problem of accepting or rejecting the compatibility, the compression ratio, the picture quality and the compression performance of the picture compression method under the application scene of uploading the machine patrol pictures is solved.
Description
Technical Field
The invention belongs to the picture compression technology, and particularly relates to an image compression method applied to machine patrol picture uploading.
Background
The images inevitably occupy a large amount of storage space and network bandwidth in the transmission and processing processes, the unmanned aerial vehicle shoots a large amount of inspection pictures in the inspection process, and tens of thousands of defective pictures generated in each inspection are necessarily compressed, so that the storage space, the transmission time, the signal frequency band, the network flow and the like are saved.
At present, in network transmission, three common image compression modes are Libjpeg, WebP and Guetzli.
Libjpeg is a free library written entirely in the C language that handles JPEG image data formats. It contains an algorithmic implementation of the JPEG codec, and various utilities for processing JPEG data. As the most commonly used image compression method at present, the distance from the release of the initial edition is nearly 30 years, the technical scheme is stable, and the compatibility is excellent. The problem is that compared with the newly proposed compression algorithm, the compression rate is high, and it is gradually difficult to meet the requirements of more and more picture compression and storage.
WebP is a picture file format that provides both lossy and lossless compression (reversible compression), derived from the video encoding format VP8, published by Google in 2010. According to the earlier test by Google, WebP's lossless compression ratio reduced file size by 45% less than PNG files found on the web, which could be reduced by 28% even though they were processed using pngcrush and PNGOUT. According to the test, the compression rate of WebP is superior to Libjeg and Guetzli under the same quality. The problem of the WebP compression method is that the compatibility is poor, and the early PC and mobile device cannot decode the pictures in the WebP format well.
Guetzli is a JPEG encoder whose goal is to achieve excellent compression density with high visual quality. Images produced by Guetzli are typically 20-30% smaller than images of equivalent quality produced by libjpeg. Guetzli only generates sequential (non-progressive) JPEG because they provide faster decompression speed. Since the output format of Guetzli is JPEG, the compatibility of this method is the same as libjpeg, while providing lower compression ratio and better visual effect at the same quality factor. However, the problem of Guetzli is that the compression delay is much higher than that of Libjpeg and WebP, and real-time compression cannot be performed.
To sum up: the compression method of tens of thousands of defective pictures generated by each inspection is difficult to accept and reject in compatibility, compression ratio, picture quality and compression performance.
Disclosure of Invention
The invention aims to solve the problems that: the image compression method applied to the machine patrol image uploading is provided, and the problem of accepting or rejecting compatibility, compression ratio, image quality and compression performance in the image compression method in the prior art is solved.
The technical scheme adopted by the invention is as follows:
an image compression method applied to machine patrol picture uploading comprises the following steps:
step 1, obtaining a target picture;
step 2, detecting whether the target picture needs to be compressed;
step 3, judging whether the target picture can use a WebP compression method or not in the current application scene if compression is needed; if yes, selecting a WebP compression method and jumping to the step 5;
step 4, judging whether a Guetzli compression method can be used in the current application scene;
if so, selecting a Guetzli compression method; if not, selecting a Libjpg compression method;
and 5, selecting compression parameters to perform image compression according to the size of the source image to obtain a target compressed image.
The implementation method of the step 5 is as follows: setting more than one expected target file size according to the size of a source image, and selecting compression parameters to perform image compression according to each compression mode which is tested and calculated in advance and the corresponding relation between the compression parameters and the target file size to obtain a target compressed image.
The way of obtaining the target picture in the step 1 is as follows: a series of images shot in the unmanned aerial vehicle inspection process are taken as target pictures.
Step 2, the method for detecting whether the target picture needs to be compressed comprises the following steps: judging whether the resolution of the target picture is greater than a set threshold value or not; if so, the picture needs to be compressed.
Step 3, the method for detecting whether the target picture can use the WebP compression method comprises the following steps: sending a picture request by an application end, checking an Accept field in a request header received by a server end, and checking whether an image/webp exists; if so, indicating that the target picture can use the WebP compression method in the current application scene, otherwise, indicating that the target picture cannot use the WebP compression method.
The method for judging whether the Guetzli compression method can be used or not in the step 4 is as follows: counting the average file size of the target picture, and calculating the total time for compressing the target picture according to the compression time corresponding to the file size of each stage under the predetermined 95 quality coefficient and the CPU core number under the application scene; judging whether the total time is greater than the set time threshold value, if so, indicating that the current application scene cannot use the Guetzli compression method; if not, it may be used.
Step 5, setting the size of the target file expected by more than one gear comprises the following steps: the target file sizes are expected to be 10KB, 100KB, 200KB, 500KB or 1MB, respectively.
Step 5, the size of the target file is 100 KB; the compression parameter is the mass factor 90.
The invention has the beneficial effects that:
according to the respective characteristics of three image compression algorithms which are widely used at present, reasonable image compression algorithms and selection bases of image compression parameters are designed; the problem of accepting or rejecting the compatibility, the compression ratio, the picture quality and the compression performance of the picture compression method under the application scene of uploading the machine patrol pictures is solved.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Detailed Description
An image compression method is applied to machine patrol picture uploading, and comprises the following steps:
step 1, obtaining a target picture;
a series of images shot in the unmanned aerial vehicle inspection process are obtained and used as target pictures.
Step 2, detecting whether the target picture needs to be compressed;
specifically, in an implementation manner, detecting whether the target picture needs to be compressed may include:
and judging whether the resolution of the target picture is larger than a self-set threshold value or not. If yes, the picture needs to be compressed, and the step 3 is skipped.
Step 3, judging whether the target picture can use a WebP compression method or not in the current application scene;
specifically, in an implementation manner, determining whether the target picture can use the WebP compression method in the current application scenario includes:
the application end sends out a picture request, checks an Accept field in a request header received by the server end, and checks whether an image/webp exists. If yes, the target picture can use the WebP compression method in the current application scene, and if not, the step 4 cannot be carried out.
Step 4, judging whether a Guetzli compression method can be used in the current application scene;
specifically, the average file size of the target picture is statistically calculated, and the total time for compressing the target picture is estimated according to the compression time corresponding to the file size of each stage under the 95-quality coefficient tested in advance and the number of CPU cores (each core can run 1 Guetzli compression process) under the application scene. And judging whether the total time is greater than the set time threshold value, if so, indicating that the current application scene cannot use the Guetzli compression method. If not, it may be used.
And 5, setting several expected target file sizes according to the file size of the target image, and selecting proper compression parameters for image compression by using the compression method selected in the steps 3 and 4 according to each compression mode which is tested and calculated in advance and the corresponding relation between the compression parameters and the target file size. And obtaining a target compressed picture.
For example: the adopted compression method is Guetzli, the sizes of several expected target files are respectively set to be 10KB, 100KB, 200KB, 500KB and 1MB, the file size of the target image is 500KB, the size of the target file is 100KB, the required compression rate threshold is calculated to be 20%, and the quality coefficient 90 is set as the compression coefficient assuming that the compression rate of Guetzli under the 95 quality coefficient obtained by the previous test and calculation is 21.30% and the compression rate under the 90 quality coefficient is 14.50%.
Claims (8)
1. An image compression method applied to machine patrol picture uploading comprises the following steps:
step 1, obtaining a target picture;
step 2, detecting whether the target picture needs to be compressed;
step 3, judging whether the target picture can use a WebP compression method or not in the current application scene if compression is needed; if yes, selecting a WebP compression method and jumping to the step 5;
step 4, judging whether a Guetzli compression method can be used in the current application scene;
if so, selecting a Guetzli compression method; if not, selecting a Libjpg compression method;
and 5, selecting compression parameters to perform image compression according to the size of the source image to obtain a target compressed image.
2. The image compression method applied to the machine patrol picture uploading according to claim 1, wherein the image compression method comprises the following steps: the implementation method of the step 5 is as follows: setting more than one expected target file size according to the size of a source image, and selecting compression parameters to perform image compression according to each compression mode which is tested and calculated in advance and the corresponding relation between the compression parameters and the target file size to obtain a target compressed image.
3. The image compression method applied to the machine patrol picture uploading according to claim 1, wherein the image compression method comprises the following steps: the way of obtaining the target picture in the step 1 is as follows: a series of images shot in the unmanned aerial vehicle inspection process are taken as target pictures.
4. The image compression method applied to the machine patrol picture uploading according to claim 1, wherein the image compression method comprises the following steps: step 2, the method for detecting whether the target picture needs to be compressed comprises the following steps: judging whether the resolution of the target picture is greater than a set threshold value or not; if so, the picture needs to be compressed.
5. The image compression method applied to the machine patrol picture uploading according to claim 1, wherein the image compression method comprises the following steps: step 3, the method for detecting whether the target picture can use the WebP compression method comprises the following steps: sending a picture request by an application end, checking an Accept field in a request header received by a server end, and checking whether an image/webp exists; if so, indicating that the target picture can use the WebP compression method in the current application scene, otherwise, indicating that the target picture cannot use the WebP compression method.
6. The image compression method applied to the machine patrol picture uploading according to claim 1, wherein the image compression method comprises the following steps: the method for judging whether the Guetzli compression method can be used or not in the step 4 is as follows: counting the average file size of the target picture, and calculating the total time for compressing the target picture according to the compression time corresponding to the file size of each stage under the predetermined 95 quality coefficient and the CPU core number under the application scene; judging whether the total time is greater than the set time threshold value, if so, indicating that the current application scene cannot use the Guetzli compression method; if not, it may be used.
7. The image compression method applied to the machine patrol picture uploading according to claim 2, wherein the image compression method comprises the following steps: step 5, setting the size of the target file expected by more than one gear comprises the following steps: the target file sizes are expected to be 10KB, 100KB, 200KB, 500KB or 1MB, respectively.
8. The image compression method applied to the machine patrol picture uploading according to claim 2, wherein the image compression method comprises the following steps: step 5, the size of the target file is 100 KB; the compression parameter is the mass factor 90.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110322161.2A CN113038139B (en) | 2021-03-25 | 2021-03-25 | Image compression method applied to machine inspection picture uploading |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110322161.2A CN113038139B (en) | 2021-03-25 | 2021-03-25 | Image compression method applied to machine inspection picture uploading |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113038139A true CN113038139A (en) | 2021-06-25 |
CN113038139B CN113038139B (en) | 2023-05-12 |
Family
ID=76473973
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110322161.2A Active CN113038139B (en) | 2021-03-25 | 2021-03-25 | Image compression method applied to machine inspection picture uploading |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113038139B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0705040A2 (en) * | 1994-09-29 | 1996-04-03 | Sony Corporation | Video encoding with quantization step control |
CN1314053A (en) * | 1999-06-14 | 2001-09-19 | 株式会社尼康 | Compression encoding method, recorded medium on which compression encoding program is recorded, and imaging device |
JP2004295564A (en) * | 2003-03-27 | 2004-10-21 | Casio Comput Co Ltd | File storage device, file storage method, and file storage program |
CN1860792A (en) * | 2003-09-02 | 2006-11-08 | 索尼株式会社 | Video encoding device, video encoding control method, and computer readable storage medium storing video encoding control program |
CN102684705A (en) * | 2012-05-30 | 2012-09-19 | 奇智软件(北京)有限公司 | Method and device for data compression |
CN102957906A (en) * | 2011-08-29 | 2013-03-06 | 广州九游信息技术有限公司 | Method and system for image classifying compression |
JP2014078860A (en) * | 2012-10-11 | 2014-05-01 | Samsung Display Co Ltd | Compressor, driving device, display device, and compression method |
CN105787868A (en) * | 2016-02-18 | 2016-07-20 | 北京金山安全软件有限公司 | Picture compression method and device and electronic equipment |
-
2021
- 2021-03-25 CN CN202110322161.2A patent/CN113038139B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0705040A2 (en) * | 1994-09-29 | 1996-04-03 | Sony Corporation | Video encoding with quantization step control |
CN1314053A (en) * | 1999-06-14 | 2001-09-19 | 株式会社尼康 | Compression encoding method, recorded medium on which compression encoding program is recorded, and imaging device |
JP2004295564A (en) * | 2003-03-27 | 2004-10-21 | Casio Comput Co Ltd | File storage device, file storage method, and file storage program |
CN1860792A (en) * | 2003-09-02 | 2006-11-08 | 索尼株式会社 | Video encoding device, video encoding control method, and computer readable storage medium storing video encoding control program |
CN102957906A (en) * | 2011-08-29 | 2013-03-06 | 广州九游信息技术有限公司 | Method and system for image classifying compression |
CN102684705A (en) * | 2012-05-30 | 2012-09-19 | 奇智软件(北京)有限公司 | Method and device for data compression |
JP2014078860A (en) * | 2012-10-11 | 2014-05-01 | Samsung Display Co Ltd | Compressor, driving device, display device, and compression method |
CN105787868A (en) * | 2016-02-18 | 2016-07-20 | 北京金山安全软件有限公司 | Picture compression method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
何天宇: "端到端的图像视频压缩研究" * |
Also Published As
Publication number | Publication date |
---|---|
CN113038139B (en) | 2023-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114584849B (en) | Video quality evaluation method, device, electronic equipment and computer storage medium | |
JP5164866B2 (en) | Method and apparatus for adapting temporal frequency of video image sequences | |
KR101832418B1 (en) | Method and system for optimization of image encode quality | |
US6934418B2 (en) | Image data coding apparatus and image data server | |
WO2022205058A1 (en) | Method and apparatus for determining image processing mode | |
WO2017190691A1 (en) | Picture compression method and apparatus | |
CN112565777B (en) | Deep learning model-based video data transmission method, system, medium and device | |
CN1825958A (en) | Compressed video quality checking method for image quality evaluation | |
US11910017B2 (en) | Method for predicting point cloud attribute, encoder, decoder, and storage medium | |
US20230342985A1 (en) | Point cloud encoding and decoding method and point cloud decoder | |
CN110149515B (en) | Data transmission method and device | |
WO2022067775A1 (en) | Point cloud encoding and decoding method, encoder, decoder and codec system | |
WO2018196502A1 (en) | Method and device for image transcoding | |
CN113038139B (en) | Image compression method applied to machine inspection picture uploading | |
CN115086649B (en) | A method, device, electronic device and medium for testing performance of coding and decoding algorithms | |
CN101296166B (en) | Index-based multimedia data measurement method | |
WO2022067776A1 (en) | Point cloud decoding and encoding method, and decoder, encoder and encoding and decoding system | |
WO2022140937A1 (en) | Point cloud encoding method and system, point cloud decoding method and system, point cloud encoder, and point cloud decoder | |
CN110290381A (en) | Video quality assessment method, device, electronic equipment and computer storage medium | |
CN118354087B (en) | Lossless image compression method and system | |
CN118468945A (en) | Quantization method and related device for coding and decoding network model | |
CN116016904A (en) | Video data network transmission quality testing method and system | |
CN116634190A (en) | Method, terminal and medium for reducing real-time streaming media transmission bandwidth consumption | |
WO2022133752A1 (en) | Point cloud encoding method and decoding method, and encoder and decoder | |
WO2024007843A1 (en) | Encoding method and apparatus, decoding method and apparatus, and computer device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |