CN113038139B - Image compression method applied to machine inspection picture uploading - Google Patents
Image compression method applied to machine inspection picture uploading Download PDFInfo
- Publication number
- CN113038139B CN113038139B CN202110322161.2A CN202110322161A CN113038139B CN 113038139 B CN113038139 B CN 113038139B CN 202110322161 A CN202110322161 A CN 202110322161A CN 113038139 B CN113038139 B CN 113038139B
- Authority
- CN
- China
- Prior art keywords
- compression
- picture
- compression method
- target
- image
- 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.)
- Active
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 inspection picture uploading, which comprises the following steps: step 1, obtaining a target picture; step 2, detecting whether the target picture needs compression or not; step 3, judging whether the target picture can use a WebP compression method or not under 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 yes, 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 picture; the method solves the problem of compatibility, compression rate, picture quality and compression performance of the picture compression method in the application scene of machine inspection picture uploading.
Description
Technical Field
The invention belongs to a picture compression technology, and particularly relates to an image compression method applied to machine inspection picture uploading.
Background
The image is inevitably occupied with 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 compression processing is necessary to the tens of thousands of defect pictures generated in each inspection so as to save storage space, transmission time, signal frequency bands, network flow and the like.
Currently, in network transmission, three common image compression modes are Libjpeg, webP and Guetzli.
Libjpeg is a free library written entirely in C language that processes JPEG image data formats. It contains an algorithmic implementation of a JPEG codec, as well as various utilities for processing JPEG data. As the most commonly used picture compression method at present, the release of the picture compression method is nearly 30 years away from the release of the original edition, and the technical scheme is stable and has excellent compatibility. The problem is that compared with the newly proposed compression algorithm, the compression rate is higher, and the increasingly more image compression storage requirements are difficult to meet.
WebP is a picture file format that provides both lossy compression and lossless compression (reversible compression), derived from video coding format VP8, published by Google in 2010. According to Google's earlier test, webP's lossless compression is 45% smaller than PNG files found on the network, even though these PNG files were processed using pngcrush and PNGOUT, webP could be reduced by 28% in file size. According to the test, the compression ratio of WebP is better than that of Libjpeg and Guetzli under the same quality. The WebP compression method has a problem in that compatibility is poor, and neither early PC nor mobile device can decode pictures in WebP format well.
Guetzli is a JPEG encoder whose goal is to obtain excellent compression density with high visual quality. The images produced by Guetzli are typically 20-30% smaller than the equivalent quality images produced by libjpeg. Guetzli only generates sequential (non-progressive) JPEG's, as they provide faster decompression speeds. Since the output format of Guetzli is JPEG, the compatibility of this method is the same as libjpeg, while providing a lower compression ratio and better visual effect at the same quality coefficient. However, the problem with Guetzli is that compression is far more delayed than Libjpeg and WebP, and cannot be performed in real time.
To sum up: the compression method of tens of thousands of defective pictures generated by each inspection has the advantages of compatibility, compression rate, picture quality and compression performance which are difficult to take into account.
Disclosure of Invention
The invention aims to solve the problems that: the image compression method applied to the machine inspection picture uploading is provided to solve the problem that compatibility, compression rate, picture quality and compression performance in the picture compression method are selected and compromised in the prior art.
The invention adopts the following technical scheme:
an image compression method applied to machine inspection picture uploading comprises the following steps:
step 1, obtaining a target picture;
step 2, detecting whether the target picture needs compression or not;
step 3, judging whether the target picture can use a WebP compression method or not under 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 yes, selecting a Guetzli compression method; if not, selecting a Libjpg compression method;
and 5, selecting compression parameters according to the size of the source image to perform image compression to obtain a target compressed picture.
The implementation method of the step 5 is as follows: setting more than one file of expected target file size according to the size of the source image, and selecting compression parameters to compress the image according to each compression mode which is subjected to experiments and statistical calculation in advance and the corresponding relation between the compression parameters and the target file size to obtain a target compressed picture.
The method for obtaining the target picture in the step 1 is as follows: and taking a series of images shot in the unmanned aerial vehicle inspection process as target pictures.
The method for detecting whether the target picture needs to be compressed in the step 2 is as follows: judging whether the resolution ratio of the target picture is larger than a set threshold value or not; if so, the picture needs to be compressed.
The method for detecting whether the target picture can use the WebP compression method in the step 3 is as follows: an application end sends a picture request, and checks an Accept field in a request header received by a server end to see whether an image/webp exists; if yes, the target picture in the current application scene can use the WebP compression method, and if not, the target picture can not use the WebP compression method.
The judging method for judging whether the Guetzli compression method can be used in the step 4 is as follows: calculating the average file size of the target picture by statistics, and calculating the total time of compressing the target picture according to the compression time corresponding to the file sizes of all levels under the predetermined 95 quality coefficient and the CPU core number under the application scene; judging whether the total time is greater than a set time threshold, if so, indicating that the current application scene cannot use a Guetzli compression method; if not, then it can be used.
Setting the expected target file size of more than one file in step 5 includes: the expected target file sizes are 10KB,100KB,200KB,500KB, or 1MB, respectively.
Step 5, the size of the target file is 100KB; the compression parameter is the quality factor 90.
The invention has the beneficial effects that:
according to the characteristics of three widely used image compression algorithms at present, reasonable image compression algorithm and selection basis of image compression parameters are designed; the method solves the problem of compatibility, compression rate, picture quality and compression performance of the picture compression method in the application scene of machine inspection picture uploading.
Drawings
FIG. 1 is a schematic flow chart of the method of the invention.
Detailed Description
An image compression method applied to machine patrol image uploading, the method comprising:
step 1, obtaining a target picture;
and obtaining a series of images shot in the unmanned aerial vehicle inspection process as target pictures.
Step 2, detecting whether the target picture needs compression or not;
specifically, in one implementation, 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. 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 one implementation manner, determining whether the target picture can use the WebP compression method in the current application scene includes:
and sending a picture request by the application terminal, checking an Accept field in a request header received by the server terminal, and checking whether an image/webp exists. If yes, the target picture can use the WebP compression method under the current application scene, if not, the target picture cannot be transferred to the step 4.
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 calculated through statistics, and the total time for compressing the target picture is estimated according to compression time corresponding to the file sizes of all levels under the 95 quality coefficients tested in advance and the number of CPU cores (each core can run 1 Guetzli compression process) under the application scene. Judging whether the total time is larger than a set time threshold, if so, indicating that the current application scene cannot use the Guetzli compression method. If not, then it can be used.
And 5, setting the sizes of several expected target files according to the file sizes of the target images, and selecting proper compression parameters for image compression by using the compression method selected in the step 3 and the step 4 according to the compression modes and the corresponding relation between the compression parameters and the target file sizes which are subjected to experiments and statistical calculation in advance. And obtaining the target compressed picture.
For example: the compression method is Guetzli, the sizes of several expected target files are 10KB,100KB,200KB,500KB and 1MB respectively, the file size of the target image is 500KB, the target file size is selected to be 100KB, the required compression rate threshold value is calculated to be 20%, the compression rate of Guetzli under 95 mass coefficients is assumed to be 21.30% and the compression rate under 90 mass coefficients is assumed to be 14.50% which are tested and calculated in advance, and the mass coefficient 90 is set to be the compression coefficient.
Claims (6)
1. An image compression method applied to machine inspection picture uploading comprises the following steps:
step 1, obtaining a target picture;
step 2, detecting whether the target picture needs compression or not;
step 3, judging whether the target picture can use a WebP compression method or not under 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 yes, selecting a Guetzli compression method; if not, selecting a Libjpg compression method;
the method for detecting whether the target picture can use the WebP compression method in the step 3 is as follows: an application end sends a picture request, and checks an Accept field in a request header received by a server end to see whether an image/webp exists; if yes, the target picture in the current application scene can use a WebP compression method, and if not, the target picture can not use the WebP compression method;
the judging method for judging whether the Guetzli compression method can be used in the step 4 is as follows: calculating the average file size of the target picture by statistics, and calculating the total time of compressing the target picture according to the compression time corresponding to the file sizes of all levels under the predetermined 95 quality coefficient and the CPU core number under the application scene; judging whether the total time is greater than a set time threshold, if so, indicating that the current application scene cannot use a Guetzli compression method; if not, then can be used;
and 5, selecting compression parameters according to the size of the source image to perform image compression to obtain a target compressed picture.
2. The image compression method applied to machine inspection image uploading according to claim 1, wherein the method comprises the following steps: the implementation method of the step 5 is as follows: setting more than one file of expected target file size according to the size of the source image, and selecting compression parameters to compress the image according to each compression mode which is subjected to experiments and statistical calculation in advance and the corresponding relation between the compression parameters and the target file size to obtain a target compressed picture.
3. The image compression method applied to machine inspection image uploading according to claim 1, wherein the method comprises the following steps: the method for obtaining the target picture in the step 1 is as follows: and taking a series of images shot in the unmanned aerial vehicle inspection process as target pictures.
4. The image compression method applied to machine inspection image uploading according to claim 1, wherein the method comprises the following steps: the method for detecting whether the target picture needs to be compressed in the step 2 is as follows: judging whether the resolution ratio of the target picture is larger than a set threshold value or not; if so, the picture needs to be compressed.
5. The image compression method applied to machine inspection image uploading according to claim 2, wherein the method comprises the following steps: setting the expected target file size of more than one file in step 5 includes: the expected target file sizes are 10KB,100KB,200KB,500KB, or 1MB, respectively.
6. The image compression method applied to machine inspection image uploading according to claim 2, wherein the method comprises the following steps: step 5, the size of the target file is 100KB; the compression parameter is the quality 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 CN113038139A (en) | 2021-06-25 |
CN113038139B true 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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0705040A2 (en) * | 1994-09-29 | 1996-04-03 | Sony Corporation | Video encoding with quantization step control |
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 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000078053A1 (en) * | 1999-06-14 | 2000-12-21 | Nikon Corporation | 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 |
JP3802521B2 (en) * | 2003-09-02 | 2006-07-26 | ソニー株式会社 | Encoding apparatus, encoding control method, and encoding control program |
CN104796155B (en) * | 2012-05-30 | 2019-03-01 | 北京奇虎科技有限公司 | Data compression method and apparatus |
CN105787868B (en) * | 2016-02-18 | 2019-04-12 | 北京金山安全软件有限公司 | Picture compression method and device and electronic equipment |
-
2021
- 2021-03-25 CN CN202110322161.2A patent/CN113038139B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0705040A2 (en) * | 1994-09-29 | 1996-04-03 | Sony Corporation | Video encoding with quantization step control |
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 |
Non-Patent Citations (1)
Title |
---|
何天宇.端到端的图像视频压缩研究.《中国优秀硕士学位论文全文数据库(电子期刊)》.2019,全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN113038139A (en) | 2021-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114584849B (en) | Video quality evaluation method, device, electronic equipment and computer storage medium | |
CN102611823B (en) | Method and equipment capable of selecting compression algorithm based on picture content | |
US20170237996A1 (en) | Real-time lossless compression of depth streams | |
KR101832418B1 (en) | Method and system for optimization of image encode quality | |
CN101485209A (en) | Method and apparatus for enhancing performance in multi-step video encoder | |
US6934418B2 (en) | Image data coding apparatus and image data server | |
JP2009530892A (en) | Method and apparatus for adapting temporal frequency of video image sequences | |
WO2022205058A1 (en) | Method and apparatus for determining image processing mode | |
CN110149515B (en) | Data transmission method and device | |
US20230342985A1 (en) | Point cloud encoding and decoding method and point cloud decoder | |
WO2018196502A1 (en) | Method and device for image transcoding | |
US11917163B2 (en) | ROI-based video coding method and device | |
CN116055726A (en) | A low-delay layered video coding method, computer equipment and medium | |
CN113038139B (en) | Image compression method applied to machine inspection picture uploading | |
CN112749802B (en) | Training method and device for neural network model and computer readable storage medium | |
CN103413336B (en) | Detection method and the device of the dual JPEG compression of a kind of grid non-alignment | |
CN112672164B (en) | Video compression system and method, and video decompression system and method | |
CN116636219A (en) | Compressing time data using geometry-based point cloud compression | |
CN105072444B (en) | A kind of HEVC video second-compressed detection methods under different quantization parameters | |
CN101296166B (en) | Index-based multimedia data measurement method | |
WO2024078892A1 (en) | Image and video compression using learned dictionary of implicit neural representations | |
KR20160040930A (en) | Method and apparatus for re-encoding an image | |
CN108933945B (en) | GIF picture compression method, device and storage medium | |
WO2022067776A1 (en) | Point cloud decoding and encoding method, and decoder, encoder and encoding and decoding system | |
US20230370620A1 (en) | Server and control method thereof |
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 |