CN111681291A - Image processing method, device, equipment and computer readable storage medium - Google Patents

Image processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111681291A
CN111681291A CN202010346589.6A CN202010346589A CN111681291A CN 111681291 A CN111681291 A CN 111681291A CN 202010346589 A CN202010346589 A CN 202010346589A CN 111681291 A CN111681291 A CN 111681291A
Authority
CN
China
Prior art keywords
target image
image
parameter
target
resolution
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.)
Pending
Application number
CN202010346589.6A
Other languages
Chinese (zh)
Inventor
李远超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010346589.6A priority Critical patent/CN111681291A/en
Publication of CN111681291A publication Critical patent/CN111681291A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Abstract

The application relates to the technical field of artificial intelligence, and provides an image processing method, an image processing device, image processing equipment and a computer-readable storage medium, wherein the method comprises the following steps: acquiring a target image to be processed, and determining whether the data volume of the target image is greater than or equal to a preset data volume threshold value; if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image; and processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image. The application relates to image processing, and the adaptability and the display effect of a target image on different display devices are effectively enhanced.

Description

Image processing method, device, equipment and computer readable storage medium
Technical Field
The present application relates to the field of image processing in artificial intelligence, and in particular, to an image processing method, apparatus, device, and computer-readable storage medium.
Background
In image processing, picture compression is often used. For example, at a mobile phone end, when a picture needs to be displayed, the picture with a large data volume is loaded and displayed due to limited performance of the mobile phone, so that excessive mobile phone memory resources are occupied, and even abnormal operation of the mobile phone may be caused. Therefore, in order to load the picture more reasonably and properly, the picture is compressed, the picture quality is reduced, and the picture is suitable for being displayed at a mobile phone end.
When the picture needs to be compressed, a plurality of compressors are used at an Android (Android) development end, and the Android development end has Luban and Compressor open source libraries. However, since the screen sizes of mobile phones in the market are different, the resolution of the picture needs to be compressed to the resolution corresponding to the specified screen size, or the picture size needs to be accurately compressed to the specified size range according to different use scenes, the two open source libraries with more audiences cannot meet the requirements at present, only approximate compression can be achieved, and the processed picture display effect is poor.
Disclosure of Invention
The present application mainly aims to provide an image processing method, an image processing apparatus, an image processing device, and a computer-readable storage medium, which aim to improve the adaptability of image compression achieved by artificial intelligence related technical means in different scenes and achieve a better display effect.
In a first aspect, the present application provides an image processing method, comprising:
acquiring a target image to be processed, and determining whether the data volume of the target image is greater than or equal to a preset data volume threshold value;
if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image;
and processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image.
In a second aspect, the present application also provides an image processing apparatus comprising:
the acquisition module is used for acquiring a target image to be processed;
the determining module is used for determining whether the data volume of the target image is larger than or equal to a preset data volume threshold value;
the acquisition module is further configured to acquire a resolution parameter, a compression quality parameter and an image size parameter of the target image if the data amount of the target image is greater than or equal to a preset data amount threshold;
the processing module is used for processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter;
and the output module is used for outputting the processed target image.
In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the image processing method as described above.
In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the image processing method as described above.
The application provides an image processing method, an image processing device and a computer readable storage medium, the application obtains the resolution parameter, the compression quality parameter and the image size parameter of a target image by determining the target image with larger loading data volume and externally setting the resolution parameter, the compression quality parameter and the image size parameter of the target image by a user or obtaining the resolution parameter, the compression quality parameter and the image size parameter of the target image by a default value set inside a terminal device, and processes the target image according to the obtained resolution parameter, the compression quality parameter and the image size parameter, so that an image meeting the individual requirements of the user or meeting the display standard of the target device is obtained, and the adaptability and the display effect of the target image on different display devices are effectively enhanced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another image processing method according to an embodiment of the present application;
FIG. 3 is a flow diagram illustrating sub-steps of the image processing method of FIG. 2;
fig. 4 is a schematic flowchart of another image processing method according to an embodiment of the present application;
fig. 5 is a schematic block diagram of an image processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic block diagram of another image processing apparatus provided in an embodiment of the present application;
fig. 7 is a schematic block diagram of another image processing apparatus provided in an embodiment of the present application;
fig. 8 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation. In addition, although the division of the functional blocks is made in the device diagram, in some cases, it may be divided in blocks different from those in the device diagram.
The embodiment of the application provides an image processing method, an image processing device, image processing equipment and a computer readable storage medium. The image processing method can be applied to terminal equipment or a server, and the terminal equipment can be electronic equipment such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and wearable equipment; the server may be a single server or a server cluster including a plurality of servers. The following explains the application of the image processing method to a terminal device as an example.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart illustrating an image processing method according to an embodiment of the present disclosure.
As shown in fig. 1, the image processing method includes steps S101 to S103.
Step S101, a target image to be processed is obtained, and whether the data volume of the target image is larger than or equal to a preset data volume threshold value or not is determined.
When an image with a large data size needs to be transmitted or displayed, a target image to be transmitted or displayed is usually compressed to reduce the operation data size of the terminal device.
The target image can be prestored in a memory of the terminal device, so that the target image can be directly acquired by the terminal device. The target image may also be stored in a database or an external device, and the terminal device acquires the target image from the database or the external device and determines the data amount of the target image. It should be noted that the target image may be one or more, the terminal device may be a mobile phone, a tablet computer, a notebook computer, etc., the database includes a local database and a cloud database, and the external device may be a plug-in hard disk, a secure digital card, a flash memory card, etc. equipped with the terminal device.
Specifically, a target image to be processed is selected through a control page, a menu bar or a popup of the terminal device; through the selection operation, the terminal equipment generates a corresponding image processing task; and acquiring a target image based on the execution instruction and the image identifier in the image processing task. The image identifier uniquely corresponds to the target image, and it should be noted that the selection operation may be a single selection of the target image or a batch selection.
In an embodiment, a plurality of candidate images are obtained by shooting through a camera installed on the terminal device, and the candidate images are stored in an image library of the terminal device, and a user can select one or more candidate images from the image library as a target image to be processed. It can be understood that the candidate image may also be obtained by shooting with a camera of another device, and then the candidate image obtained by shooting is sent to the terminal device, which is not specifically limited in this application.
After the target image is acquired, it is determined whether the data amount of the target image is greater than or equal to a preset data amount threshold. It should be noted that the preset data amount threshold may be set according to an actual situation, which is not specifically limited in this application, and optionally, the data amount threshold is 5M. By confirming the target image with larger data quantity and further processing the target image with larger data quantity, the method can be more suitable for display on terminal equipment or other equipment, and brings better display effect.
In one embodiment, when a user requests to access a webpage on a terminal device, the terminal device generates a webpage access request and sends the webpage access request to a server, wherein the webpage comprises at least one image. And after receiving the image acquisition request, the server sends the data of the webpage to the terminal equipment so that the terminal equipment can load and display the webpage. When the terminal device loads the image in the web page, it needs to determine whether the data volume of the image is greater than or equal to a preset data volume threshold value, so as to further process the image with a larger data volume. Specifically, the further processing may include performing resolution compression, quality compression and scaling on the image to adapt the image to the presentation on the terminal device, thereby improving the presentation effect on the terminal device.
Step S102, if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image.
And if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring parameters to be configured of the target image, wherein the parameters to be configured comprise a resolution parameter, a compression quality parameter and an image size parameter. The parameter to be configured is used for adapting the target image, so that the target image is more suitable for being displayed on the target equipment. It should be noted that the target device includes a terminal device or other display devices, and the other display devices include, but are not limited to, a television, an intelligent refrigerator, and the like. The resolution parameter, the compression quality parameter, and the image size parameter are used to adapt the target image, and may be set according to an actual situation, which is not specifically limited in the present application. For example, the resolution parameter is a resolution according to the display screen of the target device, and optionally, the resolution parameter is consistent with the resolution of the display screen of 800 × 600.
And S103, processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image.
After the parameters to be configured of the target image are determined, the target image is processed according to the resolution parameter, the compression quality parameter and the image size parameter in the parameters to be configured, and the processed target image is output. The output of the processed target image may be display, storage and/or transmission of the processed target image. The target image is processed according to the parameters to be configured of the target image, so that the processed target image can be well adapted to display on terminal equipment or other equipment, and a better display effect is achieved.
Illustratively, the parameter to be configured is a parameter adapted to loading presentation of a screen, where the screen may be a screen of the terminal device itself, such as a mobile phone screen; the display device may also be a screen of another display device connected to the terminal device, for example, the terminal device sends the processed target image to a wearable device (e.g., smart glasses) for display.
In one embodiment, processing a target image and outputting the processed target image includes: according to the compression quality parameters, performing quality compression on the target image to obtain a first target image; and performing resolution compression on the first target image based on the resolution parameters to obtain a second target image, and outputting the second target image. The compression quality parameter may be a preset compression quality ratio, which may be set according to an actual situation, and optionally, the compression quality ratio is 60. It should be noted that, the target image is subjected to quality compression according to a preset compression quality ratio, and the obtained compression quality of the first target image is the compression quality ratio. For example, when the compression quality ratio is 60, the compression quality of the resulting first target image is 60. When the data volume of the target image is large, the redundant data of the target image can be removed by performing quality compression on the target image, and the operation burden of the terminal equipment is reduced.
Because the screen sizes of different display devices are different, the resolution required to compress the picture to the resolution corresponding to the specified screen size is different. The terminal device performs resolution compression on the first target image based on the preset resolution parameter to obtain a second target image with resolution corresponding to the resolution parameter, and meanwhile, the second target image can be sent to a second terminal device for display. It should be noted that the preset resolution parameter may be set according to an actual situation, which is not specifically limited in this application, and optionally, the resolution parameter may be a resolution of 800 × 600 corresponding to a screen size of the second terminal device.
In one embodiment, according to an image size parameter of a target image, a resolution parameter corresponding to the image size parameter is read from a preset resolution parameter and image size parameter correspondence table. The image size parameter may include only the width and height of the target image, and may also include the length, width and height of the target image. It should be noted that the preset correspondence table between the resolution parameter and the image size parameter may be set according to actual situations, which is not specifically limited in this application.
In an embodiment, after the target image is subjected to quality compression, the obtained first target image may be previewed to show the compression effect of the first target image. The user can determine whether to continue compressing the first target image based on a control button of a display page of the terminal device, and the terminal device performs corresponding processing according to the operation of the control button by the user. For example, if the user touches the "continue compression" button, the terminal device continues to compress the first target image, and obtains the first target image after continuing to compress. It is to be understood that, after the resolution compression is performed on the first target image, the obtained second target image may be previewed, and the present application is not limited in particular.
In the image processing method provided by the embodiment, the target image with a large loading data volume is determined, the resolution parameter, the compression quality parameter and the image size parameter of the target image are set by the outside of the user, or the resolution parameter, the compression quality parameter and the image size parameter of the target image are obtained by the default value set inside the terminal device, and the target image is processed according to the obtained resolution parameter, compression quality parameter and image size parameter, so that an image meeting the personalized requirements of the user or meeting the display standard of the target device is obtained, and the adaptability and the display effect of the target image on different display devices are effectively enhanced.
Referring to fig. 2, fig. 2 is a schematic flowchart of another image processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the image processing method includes steps S201 to S205.
Step S201, acquiring a target image to be processed, and determining whether a data amount of the target image is greater than or equal to a preset data amount threshold.
The terminal device obtains the target image from the database or the external device, and determines whether the data volume of the target image is larger than or equal to a preset data volume threshold value. It should be noted that the target image may be one or more, the terminal device may be a mobile phone, a notebook computer, etc., the database includes a local database and a cloud database, and the external device may be a plug-in hard disk, a secure digital card, a flash memory card, etc. equipped with the terminal device. It should be noted that the preset data amount threshold may be set according to an actual situation, and this is not specifically limited in this application. The target image with large data volume is confirmed and further processed, so that the target image with large data volume is more suitable for display on the display equipment, and a better display effect is brought.
Step S202, if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image.
And if the data volume of the target image is greater than or equal to a preset data volume threshold value, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image. The resolution parameter, the compression quality parameter and the image size parameter are used for adapting the target image, so that the target image is more suitable for display on the target device and can be set according to actual conditions, and the method is not specifically limited in the application. It should be noted that the target device includes a terminal device or other display devices, and the other display devices include, but are not limited to, a television, an intelligent refrigerator, and the like. For example, if the target image is to be transmitted to a television for display, the resolution parameter may be a resolution corresponding to a display screen of the television.
And S203, performing resolution compression on the target image according to the resolution parameter to obtain a first target image.
Specifically, according to the determined resolution parameter, a target sampling rate of the target image is obtained from a preset resolution parameter and sampling rate corresponding table; and according to the target sampling rate, performing resolution compression on the target image to obtain a first target image. It should be noted that the sampling rate is a frequency at which the target screen of the target device can acquire the touch signal within one second, and the preset resolution parameter and the corresponding table of the sampling rate may be set according to an actual situation, which is not specifically limited in the present application.
In one embodiment, as shown in fig. 3, step S203 includes: substeps S2031 to substep S2032.
And a substep S2031 of judging whether the resolution parameter is abnormal.
The resolution parameter is used for adapting the target image, and may be a resolution corresponding to a display screen of the target device. And if the resolution corresponding to the display screen of the target equipment cannot be obtained, the determined resolution parameter is considered to be abnormal. It can be understood that, if the deviation between the determined resolution parameter and the actual resolution is too large, or the terminal device cannot process the target image according to the determined resolution parameter, the resolution parameter may also be considered as abnormal. This is not a particular limitation of the present application.
And a substep S2032, if the resolution parameter is abnormal, acquiring a target resolution of the target image from a preset image size parameter and resolution correspondence table according to the image size parameter.
And if the resolution parameter is judged to be abnormal, acquiring the target resolution of the target image from a preset image size parameter and resolution corresponding table according to the determined image size parameter. The image size parameter is used for adapting the target image, can be a preset image width and height size, namely the width and height of the image, and can be flexibly set. It should be noted that the preset mapping table of the image size parameter and the resolution may be set according to actual situations, which is not specifically limited in this application.
And S2033, performing resolution compression on the target image according to the target resolution to obtain a first target image.
Specifically, according to the determined target resolution, the target sampling rate of the target image is obtained from a preset resolution and sampling rate correspondence table; and according to the target sampling rate, performing resolution compression on the target image to obtain a first target image. It should be noted that the sampling rate is a frequency at which the target screen of the target device can acquire the touch signal within one second, and the preset correspondence table between the resolution and the sampling rate may be set according to an actual situation, which is not specifically limited in the present application.
For example, the preset resolution-sampling rate correspondence table may be established in the following manner: the method comprises the steps of collecting and establishing samples for all terminal devices in the market in advance, obtaining the resolution ratio of each sample, then establishing the one-to-one correspondence relationship between the resolution ratio of each type of terminal device and the corresponding sampling rate, and making and storing a preset resolution ratio and sampling rate correspondence table.
In an embodiment, if the resolution parameter is not abnormal, obtaining a target sampling rate of the target image from a preset resolution parameter and sampling rate correspondence table according to the resolution parameter; and according to the target sampling rate, carrying out resolution compression on the target image to obtain a first target image. The sampling rate is the frequency at which the target screen of the target device can acquire the touch signal within one second, and the preset resolution parameter and sampling rate correspondence table can be set according to actual conditions, which is not specifically limited in the present application. It should be noted that the target sampling rate may also be manually set in advance by a user, or automatically set by an operating system of the target device, and in addition, may also be downloaded from other devices/servers through a network for use, which is not specifically limited in this application.
And S204, performing quality compression on the first target image based on the compression quality parameter to obtain a second target image.
In an embodiment, the compression quality parameter includes a compression quality range, and the manner of obtaining the second target image may specifically be: determining the current compression quality of the first target image, and judging whether the current compression quality is within the compression quality range; if the current compression quality is not within the preset compression quality range, acquiring a preset compression quality value; and circularly compressing the first target image through the compression quality value until the compression quality of the first target image is within the compression quality range to obtain a second target image.
It should be noted that the compression quality range is between 0 and 100, and can be flexibly set. The specific process of compression comprises: and circularly compressing the first target image, wherein the quality of each compression step is a compression quality value, and the compression quality values can be different or the same until the quality of the first target image meets a set compression quality range. The compression quality value is, for example, in the quality range of 3-8, but may also be 5.
And further, previewing the obtained second target image, and determining whether to decompress the second target image according to a previewing result so as to update the second target image. The preview result may be "decompress", "stop compressing", and "continue compressing", and it should be noted that, if the preview display effect is not good, and the user is dissatisfied and issues a decompressing instruction, the terminal device receives and executes the instruction, so as to improve the display effect of the second target image.
And S205, zooming the second target image according to the image size parameter to obtain a third target image, and outputting the third target image.
And zooming the second target image according to the determined image size parameters, wherein a third target image is obtained, and the image size parameters are used for adapting the target image and comprise width parameters and height parameters of the image. It should be noted that, after the second target image is scaled, the obtained third target image may be directly displayed, or the third target image may be stored locally, or directly sent to another terminal device or display device in wired or wireless connection. The wireless connection mode of the embodiment may include a 3G communication network, a 4G communication network, a 5G communication network, or other WIFI networks, a dedicated internet of things, and the like.
Specifically, the operation of scaling the second target image may be: newly building a canvas, and transmitting a width parameter and a height parameter of an image; and zooming the picture on the canvas according to the transmitted width parameter and the transmitted height parameter to obtain a zoomed second target image. It should be noted that, by directly scaling the picture, the thumbnail can be quickly obtained, and the adaptability of the target image in different scenes is enhanced.
In the image processing method provided by the embodiment, the target image with a large loading data volume is determined, the resolution parameter, the compression quality parameter and the image size parameter of the target image are obtained, and the resolution compression is performed on the target image according to the resolution parameter to obtain the first target image; performing quality compression on the first target image based on the compression quality parameter to obtain a second target image; and zooming the second target image according to the image size parameter to obtain a third target image, so that the adaptability and the display effect of the target image in different scenes can be effectively enhanced.
Referring to fig. 4, fig. 4 is a flowchart illustrating another image processing method according to an embodiment of the present disclosure.
As shown in fig. 4, the image processing method includes steps S301 to S307.
Step S301, a target image to be processed is obtained, and whether the data volume of the target image is larger than or equal to a preset data volume threshold value or not is determined.
The terminal device obtains the target image from the database or the external device, and determines whether the data volume of the target image is larger than or equal to a preset data volume threshold value. It should be noted that the target image may be one or more, the terminal device may be a mobile phone, a notebook computer, etc., the database includes a local database and a cloud database, and the external device may be a plug-in hard disk, a secure digital card, a flash memory card, etc. equipped with the terminal device. It should be noted that the preset data amount threshold may be set according to an actual situation, and this is not specifically limited in this application. By confirming the target image with larger data quantity and further processing the target image with larger data quantity, the method can be more suitable for display on terminal equipment or other equipment, and brings better display effect.
In one embodiment, acquiring a target image to be processed includes: acquiring an image to be processed and acquiring a target watermark to be added; the target watermark is added to the target image to update the target image. The target watermark includes, but is not limited to, text, symbols, and patterns. By adding the watermark to the target image, the actual use of the image is attached, so that the target image after updating has stronger adaptability.
It should be noted that, in order to further ensure the privacy and security of the related information such as the target watermark, the related information such as the target watermark may also be stored in a node of a block chain, and the technical scheme of the present application may also be applicable to adding other data files stored in the block chain, where the block chain referred to in the present invention is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Step S302, if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image.
And if the data volume of the target image is greater than or equal to a preset data volume threshold value, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image. The resolution parameter, the compression quality parameter and the image size parameter are used for adapting the target image, so that the target image is more suitable for display on the target device and can be set according to actual conditions, and the method is not specifically limited in the application. It should be noted that the target device includes a terminal device or other display devices, and the other display devices include, but are not limited to, a television, an intelligent refrigerator, and the like. For example, if the target image is to be sent to a television for display, the resolution parameter may be a resolution corresponding to a display screen of the television.
And step S303, processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter.
After the resolution parameter, the compression quality parameter and the image size parameter of the target image are determined, the target image is processed according to the resolution parameter, the compression quality parameter and the image size parameter, and the processed target image is obtained. It should be noted that, the target image is processed according to the resolution parameter, the compression quality parameter and the image size parameter of the target image, and the obtained processed target image can be well adapted to display on a terminal device or other display devices.
And step S304, obtaining a target watermark to be added, and adding the target watermark to the processed target image to obtain the target image with the watermark.
The target watermark to be added can be characters, symbols or patterns, the processed target image is used as a background, and the target image with the watermark can be obtained by selecting a proper position of the background to add the target watermark.
Further, the manner of adding the target watermark to the processed target image is specifically as follows: by a random ordering algorithm, disordering the positions of all pixel points in the watermark drawing board filled with the target watermark to obtain a disordered watermark drawing board, and setting the pixel sizes of the watermark drawing board and the target image to be consistent; according to a preset superposition intensity coefficient, superposing the disturbed watermark drawing board and the frequency spectrum image to obtain a superposed image, wherein the frequency spectrum image is obtained by carrying out two-dimensional discrete Fourier transform on a target image; and performing two-dimensional inverse discrete Fourier transform on the superposed image to obtain a watermark target image embedded with the target watermark, and recording the watermark target image as the target image with the watermark. It should be noted that the preset superposition strength coefficient may be set according to an actual situation, which is not specifically limited in this application.
Step S305, determining whether the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold value.
And judging whether the data volume of the target image with the watermark is larger than or equal to a preset data volume threshold value or not. It should be noted that the preset data amount threshold may be set according to an actual situation, and this is not specifically limited in this application. The target image with the watermark and with the large data volume is confirmed and further processed, so that the target image with the watermark and with the large data volume can be more suitable for display on display equipment, and a better display effect is brought.
Step S306, if the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image with the watermark.
After the target image is processed, the data volume of the processed target image is smaller, and after the target watermark is added to the processed target image, the data volume of the obtained watermarked target image is correspondingly increased.
And step S307, processing the target image with the watermark according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image with the watermark.
After the resolution parameter, the compression quality parameter and the image size parameter of the target image with the watermark are determined, the target image with the watermark is processed according to the resolution parameter, the compression quality parameter and the image size parameter, and the processed target image with the watermark is obtained. It should be noted that, the target image is processed through the resolution parameter, the compression quality parameter and the image size parameter of the watermarked target image, and the processed watermarked target image can be better adapted to be displayed on a terminal device or a display device.
In the image processing method provided by the embodiment, the target watermark is added to the processed target image, the target image with the watermark is processed, and the actual use of the target image is fitted, so that the processed target image with the watermark has stronger adaptability, is suitable for more use scenes, and meets the specific requirements of users.
Referring to fig. 5, fig. 5 is a schematic block diagram of an image processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the image processing apparatus 400 includes: an acquisition module 401, a determination module 402, a processing module 403 and an output module 404.
An obtaining module 401, configured to obtain a target image to be processed;
a determining module 402, configured to determine whether a data amount of the target image is greater than or equal to a preset data amount threshold;
the obtaining module 401 is further configured to obtain a resolution parameter, a compression quality parameter, and an image size parameter of the target image if the data amount of the target image is greater than or equal to a preset data amount threshold;
a processing module 403, configured to process the target image according to the resolution parameter, the compression quality parameter, and the image size parameter;
and an output module 404, configured to output the processed target image.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and the modules and units described above may refer to the corresponding processes in the foregoing embodiment of the image processing method, and are not described herein again.
Referring to fig. 6, fig. 6 is a schematic block diagram of another image processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the image processing apparatus 500 includes:
an obtaining module 501, configured to obtain a target image to be processed.
A determining module 502, configured to determine whether a data amount of the target image is greater than or equal to a preset data amount threshold.
The obtaining module 501 is further configured to obtain a resolution parameter, a compression quality parameter, and an image size parameter of the target image if the data amount of the target image is greater than or equal to a preset data amount threshold.
And a compression module 503, configured to perform resolution compression on the target image according to the resolution parameter to obtain a first target image.
The compression module 503 is further configured to perform quality compression on the first target image based on the compression quality parameter to obtain a second target image.
And a scaling module 504, configured to scale the second target image according to the image size parameter to obtain a third target image.
An output module 505, configured to output the third target image.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and the modules and units described above may refer to the corresponding processes in the foregoing embodiment of the image processing method, and are not described herein again.
Referring to fig. 7, fig. 7 is a schematic block diagram of another image processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, the image processing apparatus 600 includes:
the acquiring module 601 is configured to acquire a target image to be processed.
A determining module 602, configured to determine whether a data amount of the target image is greater than or equal to a preset data amount threshold.
The obtaining module 601 is further configured to obtain a resolution parameter, a compression quality parameter, and an image size parameter of the target image if the data amount of the target image is greater than or equal to a preset data amount threshold.
A processing module 603, configured to process the target image according to the resolution parameter, the compression quality parameter, and the image size parameter.
The adding module 604 is configured to obtain a target watermark to be added, and add the target watermark to the processed target image to obtain a target image with a watermark.
The determining module 602 is further configured to determine whether a data amount of the watermarked target image is greater than or equal to a preset first data amount threshold.
The obtaining module 601 is further configured to obtain a resolution parameter, a compression quality parameter, and an image size parameter of the watermarked target image if the data amount of the watermarked target image is greater than or equal to a preset first data amount threshold.
The processing module 603 is further configured to process the target image with the watermark according to the resolution parameter, the compression quality parameter, and the image size parameter.
And an output module 605, configured to output the processed target image with the watermark.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and the modules and units described above may refer to the corresponding processes in the foregoing embodiment of the image processing method, and are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program, which can be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram illustrating a structure of a computer device according to an embodiment of the present disclosure. The computer device may be a server or a terminal device.
As shown in fig. 8, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions which, when executed, cause a processor to perform any of the image processing methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for running a computer program in the non-volatile storage medium, which, when executed by the processor, causes the processor to perform any of the image processing methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the processor may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
acquiring a target image to be processed, and determining whether the data volume of the target image is greater than or equal to a preset data volume threshold value;
if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image;
and processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image.
In one embodiment, when the processor implements the processing on the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputs the processed target image, the processor is configured to implement:
according to the resolution parameter, performing resolution compression on the target image to obtain a first target image;
performing quality compression on the first target image based on the compression quality parameter to obtain a second target image;
and zooming the second target image according to the image size parameter to obtain a third target image, and outputting the third target image.
In an embodiment, when the processor performs resolution compression on the target image according to the resolution parameter to obtain a first target image, the processor is configured to perform:
judging whether the resolution parameter is abnormal or not;
if the resolution parameter is abnormal, acquiring the target resolution of the target image from a preset image size parameter and resolution corresponding table according to the image size parameter;
and according to the target resolution, performing resolution compression on the target image to obtain a first target image.
In one embodiment, after implementing the determining whether the resolution parameter is abnormal, the processor is further configured to implement:
if the resolution parameter is not abnormal, acquiring a target sampling rate of the target image from a preset resolution parameter and sampling rate corresponding table according to the resolution parameter;
and according to the target sampling rate, carrying out resolution compression on the target image to obtain a first target image.
In one embodiment, the processor includes a compression quality range in implementing the compression quality parameter; and when the first target image is subjected to quality compression based on the compression quality parameter to obtain a second target image, the method is used for realizing that:
determining the current compression quality of the first target image, and judging whether the current compression quality is within the compression quality range;
if the current compression quality is not within a preset compression quality range, acquiring a preset compression quality value;
and circularly compressing the first target image according to the compression quality value until the compression quality of the first target image is within the compression quality range to obtain a second target image.
In one embodiment, the processor, when implementing the acquiring the target image to be processed, is configured to implement:
acquiring an image to be processed and acquiring a target watermark to be added;
and adding the target watermark to the image to obtain a target image.
In one embodiment, the processor is further configured to, prior to implementing the outputting the processed target image:
acquiring a target watermark to be added, and adding the target watermark to the processed target image to obtain a target image with the watermark;
judging whether the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold value or not;
and if the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold value, executing the step of acquiring the resolution parameter, the compression quality parameter and the image size parameter of the target image.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the computer device described above may refer to the corresponding process in the foregoing embodiment of the image processing method, and is not described herein again.
Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, where the computer program includes program instructions, and a method implemented when the program instructions are executed may refer to various embodiments of the image processing method of the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An image processing method, comprising:
acquiring a target image to be processed, and determining whether the data volume of the target image is greater than or equal to a preset data volume threshold value;
if the data volume of the target image is larger than or equal to a preset data volume threshold, acquiring a resolution parameter, a compression quality parameter and an image size parameter of the target image;
and processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter, and outputting the processed target image.
2. The image processing method according to claim 1, wherein said processing the target image according to the resolution parameter, the compression quality parameter, and the image size parameter and outputting the processed target image comprises:
according to the resolution parameter, performing resolution compression on the target image to obtain a first target image;
performing quality compression on the first target image based on the compression quality parameter to obtain a second target image;
and zooming the second target image according to the image size parameter to obtain a third target image, and outputting the third target image.
3. The image processing method of claim 2, wherein the performing resolution compression on the target image according to the resolution parameter to obtain a first target image comprises:
judging whether the resolution parameter is abnormal or not;
if the resolution parameter is abnormal, acquiring the target resolution of the target image from a preset image size parameter and resolution corresponding table according to the image size parameter;
and according to the target resolution, performing resolution compression on the target image to obtain a first target image.
4. The image processing method according to claim 3, wherein after determining whether the resolution parameter is abnormal, the method further comprises:
if the resolution parameter is not abnormal, acquiring a target sampling rate of the target image from a preset resolution parameter and sampling rate corresponding table according to the resolution parameter;
and according to the target sampling rate, carrying out resolution compression on the target image to obtain a first target image.
5. The image processing method according to any of claims 2-4, wherein the compression quality parameter comprises a compression quality range; the quality compression of the first target image based on the compression quality parameter to obtain a second target image comprises:
determining the current compression quality of the first target image, and judging whether the current compression quality is within the compression quality range;
if the current compression quality is not within a preset compression quality range, acquiring a preset compression quality value;
and circularly compressing the first target image according to the compression quality value until the compression quality of the first target image is within the compression quality range to obtain a second target image.
6. The image processing method according to any one of claims 1 to 4, wherein the acquiring the target image to be processed includes:
acquiring an image to be processed and acquiring a target watermark to be added;
and adding the target watermark to the image to obtain a target image.
7. The image processing method according to any one of claims 1 to 4, wherein before outputting the processed target image, further comprising:
acquiring a target watermark to be added, and adding the target watermark to the processed target image to obtain a target image with the watermark;
determining whether the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold value;
and if the data volume of the target image with the watermark is larger than or equal to a preset first data volume threshold value, executing the step of acquiring the resolution parameter, the compression quality parameter and the image size parameter of the target image.
8. An image processing apparatus characterized by comprising:
the acquisition module is used for acquiring a target image to be processed;
the determining module is used for determining whether the data volume of the target image is larger than or equal to a preset data volume threshold value;
the acquisition module is further configured to acquire a resolution parameter, a compression quality parameter and an image size parameter of the target image if the data amount of the target image is greater than or equal to a preset data amount threshold;
the processing module is used for processing the target image according to the resolution parameter, the compression quality parameter and the image size parameter;
and the output module is used for outputting the processed target image.
9. A computer arrangement, characterized in that the computer arrangement comprises a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, wherein the computer program, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 7.
CN202010346589.6A 2020-04-27 2020-04-27 Image processing method, device, equipment and computer readable storage medium Pending CN111681291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010346589.6A CN111681291A (en) 2020-04-27 2020-04-27 Image processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010346589.6A CN111681291A (en) 2020-04-27 2020-04-27 Image processing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111681291A true CN111681291A (en) 2020-09-18

Family

ID=72452519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010346589.6A Pending CN111681291A (en) 2020-04-27 2020-04-27 Image processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111681291A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104085A (en) * 2019-12-31 2020-05-05 深圳市康冠智能科技有限公司 Display screen adaptation method and device, computer equipment and storage medium
CN112752107A (en) * 2020-12-26 2021-05-04 广东工业大学 Webpage picture preprocessing method, system, storage medium and computer equipment
CN113422983A (en) * 2021-08-24 2021-09-21 腾讯科技(深圳)有限公司 Data processing method, computer device, and storage medium
CN113724345A (en) * 2021-08-04 2021-11-30 德邦证券股份有限公司 Picture compression method, device and storage medium
CN113747061A (en) * 2021-08-25 2021-12-03 国网河北省电力有限公司衡水供电分公司 Image acquisition method, device, terminal and storage medium
CN113872947A (en) * 2021-09-15 2021-12-31 珠海格力电器股份有限公司 Data reporting method and device, electronic equipment and computer readable storage medium
CN113891015A (en) * 2021-09-16 2022-01-04 平安养老保险股份有限公司 Image processing method and device based on artificial intelligence and computer equipment
CN114302146A (en) * 2021-12-30 2022-04-08 阿里巴巴新加坡控股有限公司 Image processing method, image processing device, electronic equipment and computer storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104085A (en) * 2019-12-31 2020-05-05 深圳市康冠智能科技有限公司 Display screen adaptation method and device, computer equipment and storage medium
CN111104085B (en) * 2019-12-31 2024-02-06 深圳市康冠智能科技有限公司 Display screen adaptation method, device, computer equipment and storage medium
CN112752107A (en) * 2020-12-26 2021-05-04 广东工业大学 Webpage picture preprocessing method, system, storage medium and computer equipment
CN113724345A (en) * 2021-08-04 2021-11-30 德邦证券股份有限公司 Picture compression method, device and storage medium
CN113724345B (en) * 2021-08-04 2024-03-15 德邦证券股份有限公司 Picture compression method, device and storage medium
CN113422983A (en) * 2021-08-24 2021-09-21 腾讯科技(深圳)有限公司 Data processing method, computer device, and storage medium
CN113422983B (en) * 2021-08-24 2021-11-23 腾讯科技(深圳)有限公司 Data processing method, computer device, and storage medium
WO2023024832A1 (en) * 2021-08-24 2023-03-02 腾讯科技(深圳)有限公司 Data processing method and apparatus, computer device and storage medium
CN113747061A (en) * 2021-08-25 2021-12-03 国网河北省电力有限公司衡水供电分公司 Image acquisition method, device, terminal and storage medium
CN113872947A (en) * 2021-09-15 2021-12-31 珠海格力电器股份有限公司 Data reporting method and device, electronic equipment and computer readable storage medium
CN113891015A (en) * 2021-09-16 2022-01-04 平安养老保险股份有限公司 Image processing method and device based on artificial intelligence and computer equipment
CN114302146A (en) * 2021-12-30 2022-04-08 阿里巴巴新加坡控股有限公司 Image processing method, image processing device, electronic equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN111681291A (en) Image processing method, device, equipment and computer readable storage medium
US8943164B2 (en) Apparatus and methods for retrieving/ downloading content on a communication device
US20170109371A1 (en) Method and Apparatus for Processing File in a Distributed System
CN106453572B (en) Method and system based on Cloud Server synchronous images
CN109309842B (en) Live broadcast data processing method and device, computer equipment and storage medium
CN106202273A (en) File management method and system
CN108810610B (en) Screen sharing method and device
CN115358911B (en) Screen watermark generation method, device, equipment and computer readable storage medium
CN111225288A (en) Method and device for displaying subtitle information and electronic equipment
CN111327921A (en) Video data processing method and device
CN110399511A (en) Image cache method, equipment, storage medium and device based on Redis
CN112965650A (en) Thermodynamic diagram visualization method and system and computer equipment
KR101437843B1 (en) Font processing method for maintaining document layout, and computer-readable recording medium with font processing program for the same
EP4080507A1 (en) Method and apparatus for editing object, electronic device and storage medium
CN113395538A (en) Sound effect rendering method and device, computer readable medium and electronic equipment
WO2019024160A1 (en) Image tampering detection method and system, electronic device, and readable storage medium
CN108777810B (en) Video data storage method, device, equipment and storage medium
CN113938750A (en) Video processing method and device, electronic equipment and storage medium
US20190197986A1 (en) Methods for dynamically providing an image to be displayed
US10509826B2 (en) Server device, client device, information processing method, and recording medium
CN112445394A (en) Screenshot method and device
CN106790466B (en) Method, server and terminal equipment for pushing
CN107688572B (en) Page display method and terminal
CN113918861A (en) Icon library display method and device
CN105469433B (en) Picture compression method and equipment 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