Image processing method and device, chip, electronic equipment and storage medium

Dynamically adjusting the element values ​​of the dither matrix through the deep neural network model solves the problem in the existing technology that the dither matrix cannot be optimized according to specific image content, and achieves high-quality halftone image processing effects.

CN118741007APending Publication Date: 2024-10-01GUANGZHOU ZHONO ELECTRONICS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411001077.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing halftone image processing methods cannot dynamically optimize the dither matrix according to specific image content, resulting in unsatisfactory effects.

Method used

The deep neural network model is used to perform half-toning processing on the image to be processed, dynamically adjust the element values ​​of the dither matrix, output the optimized target dither matrix, and perform half-toning processing based on the matrix.

Benefits of technology

It achieves high-quality halftone image processing, avoids the problem of poor results caused by the inability to dynamically optimize, and improves the visual effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741007A_ABST
    Figure CN118741007A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, a chip, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-processed image, and taking the to-be-processed image as a basis for halftone processing; inputting the to-be-processed image into a preset deep neural network model, dynamically adjusting the element value of the jitter matrix according to the specific image content by using the deep neural network model, and outputting an optimized target jitter matrix; and finally, according to the target jitter matrix, performing halftone processing on the to-be-processed image to obtain a high-quality halftone image. As the jitter matrix not only determines the sequence that dots become black spots when the brightness or gray value is reduced, but also determines the quality of the halftone image, the method utilizes the deep neural network model to dynamically adjust the element value of the jitter matrix; the problem that the halftone effect is not ideal due to the fact that dynamic optimization cannot be carried out according to the specific image content is solved, the high-quality target jitter matrix is output, and then the high-quality halftone image is obtained according to the target jitter matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device, chip, electronic equipment and storage medium. Background Art

[0002] Halftoning technology is a common method in the field of image processing. Halftoning technology refers to the technology of using a small amount of colors to quantize a continuous tone image into a binary image or a color image with only a few colors, and the visual effect of the quantized image at a certain distance is similar to the original image.

[0003] Most of the existing halftone image processing is achieved through a pre-designed dither matrix. However, the traditional dither matrix is ​​manually designed and cannot be dynamically optimized according to the specific image content, resulting in a less than ideal halftone effect. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the purpose of the present invention is to provide an image processing method, device, chip, electronic device and storage medium.

[0005] The present invention proposes an image processing method, and the control method includes the following steps: acquiring an image to be processed; inputting the image to be processed into a preset deep neural network model to output an optimized target dither matrix; and performing halftone processing on the image to be processed based on the target dither matrix to obtain a target image.

[0006] According to the image processing method of the embodiment of the present invention, first, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, the method uses the deep neural network model to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0007] In addition, the image processing method according to the embodiment of the present invention may also have the following additional technical features:

[0008] Furthermore, before inputting the image to be processed into a preset deep neural network model, it also includes: constructing an initial neural network model, wherein the initial neural network model includes a convolutional layer, a pooling layer and a fully connected layer, and the initial neural network model can process the input image through the convolutional layer, the pooling layer, and the fully connected layer in sequence, and output a jitter matrix; training the initial neural network model to obtain the deep neural network model.

[0009] Furthermore, the initial neural network model is trained, including: obtaining a training data set; training the initial neural network model based on the training data set until the training is completed to obtain the deep neural network model.

[0010] Furthermore, in the process of training the initial neural network model based on the training data set, when the loss function meets a preset condition, it is determined that the training is completed.

[0011] Furthermore, the loss function includes: a mean square error between a first image and a second image, wherein the first image is a halftone image obtained by halftoning any grayscale image based on a dithering matrix output by the currently trained deep neural network model, and the second image is a standard halftone image corresponding to any grayscale image.

[0012] Further, when the mean square error is less than a preset threshold, it is determined that the loss function meets a preset condition.

[0013] Furthermore, the obtaining of the training data set includes: collecting a plurality of grayscale images and their corresponding standard halftone images; and forming the training data set according to the plurality of grayscale images and the corresponding standard halftone images.

[0014] In response to the above-mentioned problems, the present invention also proposes an image processing device, wherein the control device comprises: an acquisition module, used to acquire an image to be processed; a first processing module, used to input the image to be processed into a preset deep neural network model to output an optimized target dither matrix; and a second processing module, used to perform halftone processing on the image to be processed based on the target dither matrix to obtain a target image.

[0015] According to the image processing device of the embodiment of the present invention, first, an image to be processed is obtained as the basis for halftone processing; then, the image to be processed is input into a preset deep neural network model, and the element values ​​of the dither matrix are dynamically adjusted according to the specific image content by using the deep neural network model, and an optimized target dither matrix is ​​output; finally, the image to be processed is halftone processed according to the target dither matrix to obtain a high-quality halftone image; since the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, the image processing device dynamically adjusts the element values ​​of the dither matrix by using the deep neural network model, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0016] In response to the above-mentioned problems, the present invention also proposes a chip, comprising: an image processing device as described in the above-mentioned second aspect embodiment of the present invention, or the chip comprises: a processor, a memory, and an image processing program stored in the memory and executable on the processor, wherein the image processing program, when executed by the processor, implements the image processing method as described in the above-mentioned first aspect embodiment of the present invention.

[0017] According to the chip of the embodiment of the present invention, the image processing method of the embodiment of the present invention can be executed. First, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which the dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, when the chip executes the image processing method of the embodiment of the present invention, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0018] In view of the above-mentioned problems, the present invention further proposes an electronic device, comprising: a chip as described in the above-mentioned third aspect embodiment of the present invention.

[0019] According to the electronic device of the embodiment of the present invention, the image processing method of the embodiment of the present invention can be executed. First, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, when the electronic device executes the image processing method of the embodiment of the present invention, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0020] In response to the above-mentioned problems, the present invention further proposes a computer-readable storage medium, on which an image processing program is stored. When the image processing program is executed by a processor, the image processing method as described in the above-mentioned first aspect embodiment of the present invention is implemented.

[0021] According to the computer-readable storage medium of an embodiment of the present invention, when the image processing program stored thereon is executed by the processor, the image to be processed is first obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the element values ​​of the dither matrix are dynamically adjusted according to the specific image content by using the deep neural network model, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which the dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, therefore, when the image processing program stored thereon is executed by the processor, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0022] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0024] Figure 1 is a flowchart of an image processing method according to an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of the overall flow of an image processing method according to a specific embodiment of the present invention;

[0026] Figure 3 is a structural block diagram of an image processing device according to an embodiment of the present invention.

[0027] Reference numerals:

[0028] 100 - image processing device; 101 - acquisition module; 102 - first processing module; 103 - second processing module. DETAILED DESCRIPTION

[0029] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.

[0030] Reference below Figure 1-Figure 3 An image processing method, device, chip, electronic device, and storage medium according to embodiments of the present invention are described.

[0031] Figure 1 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 1 As shown, the image processing method according to an embodiment of the present invention specifically includes the following steps:

[0032] Step S1: Obtain an image to be processed.

[0033] In a specific embodiment, the image to be processed includes, but is not limited to, continuous-tone images (such as grayscale images and color images). A continuous-tone image refers to an image in which the tonal change from light to dark or from shallow to dark is composed of the particle density of the imaging material per unit area, and the depth and density show infinite changes. The tonal change of this image is continuous, without interruption, and rich in layers, such as photo negatives, photographs, various drawings, etc. The depth change of a continuous-tone image is stepless. The weaker the contrast, the richer the continuous-tone gradation; the stronger the contrast, the fewer the continuous-tone gradation.

[0034] Specifically, this embodiment obtains the image to be processed as the basis for halftone processing, which helps to subsequently perform halftone processing on the image to be processed, thereby quantizing a continuous tone image into a binary image or a color image with only a few colors, and ensuring that the visual effect of the quantized image at a certain distance is similar to the original image.

[0035] Step S2: Input the image to be processed into a preset deep neural network model to output an optimized target jitter matrix.

[0036] In a specific embodiment, a deep neural network model is a deep learning model widely used in fields such as image recognition, video analysis, and natural language processing. It is a complex network system formed by a large number of simple processing units (called neurons) that are widely interconnected, reflecting many basic characteristics of human brain functions. It is a highly complex nonlinear dynamic learning system. The neural network has large-scale parallelism, distributed storage and processing, self-organization, self-adaptation, and self-learning capabilities. It is particularly suitable for processing imprecise and fuzzy information processing problems that require simultaneous consideration of many factors and conditions. The basis of the deep neural network model is neurons, which are biological models based on the nerve cells of the biological nervous system.

[0037] Specifically, since the dither matrix not only determines the order in which dots turn into black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, an embodiment of the present invention adopts a pre-constructed and trained deep neural network model, that is, a preset deep neural network model. By inputting the image to be processed into a preset deep neural network model, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output an optimized target dither matrix, which helps to subsequently obtain a high-quality halftone image according to the optimized target dither matrix.

[0038] Step S3: performing halftone processing on the image to be processed based on the target dither matrix to obtain a target image.

[0039] In a specific embodiment, a target image obtained by performing halftone processing on an image to be processed is a halftone image. A halftone image is relative to a continuous tone image, and the changes in image levels and colors are expressed by the size or density of dots. The details of such images do not change continuously because the dots are discretely distributed at a certain distance in space. The tone changes of a halftone image cannot be infinitely changed like a continuous tone image, but are expressed by the composition of the dot area size. On the printed image, both color and shade are represented by dots.

[0040] Specifically, according to the target dithering matrix obtained above and optimized by the deep neural network model, halftone processing is performed on the image to be processed to obtain a high-quality halftone image.

[0041] Therefore, according to the image processing method of the embodiment of the present invention, first, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, the method uses the deep neural network model to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0042] In one embodiment of the present invention, before inputting the image to be processed into a preset deep neural network model, it also includes: constructing an initial neural network model, wherein the initial neural network model includes a convolution layer, a pooling layer and a fully connected layer, and the initial neural network model can process the input image through the convolution layer, the pooling layer, and the fully connected layer in sequence, and output a jitter matrix; training the initial neural network model to obtain a deep neural network model.

[0043] In a specific embodiment, the initial neural network model includes, for example, but is not limited to, a convolutional neural network model, and the convolutional neural network model includes a convolutional layer, a pooling layer, and a fully connected layer.

[0044] The convolution layer is the core of the convolutional neural network. It extracts the local features of the data by sliding a filter (or convolution kernel) on the input data and calculating the weighted sum of the overlapping parts of the filter and the input data. This process is also called a convolution operation. The application of convolution layers in deep learning is mainly reflected in feature extraction. It can automatically learn the local features of the input data, such as edges, textures, etc.

[0045] The pooling layer plays an important role in dimensionality reduction in convolutional neural networks. It effectively reduces the dimension and amount of computation of the data by downsampling the input data, while retaining important features and improving the generalization ability of the model. The pooling layer is generally located after the convolutional layer and downsamples the output of the convolutional layer.

[0046] The fully connected layer plays the final classification role in the convolutional neural network. After the feature extraction and dimensionality reduction of the previous convolutional layer and pooling layer, the fully connected layer maps the features to the sample's label space to complete the classification task. The fully connected layer is generally composed of multiple neurons, each of which receives all the inputs of the previous layer and outputs them to the next layer.

[0047] Specifically, the initial neural network model processes the input image through the convolution layer, the pooling layer, and the fully connected layer in sequence, and outputs the jitter matrix.

[0048] In a specific embodiment, the input image size of the initial neural network model may be 256x256, and the output may be a 16x16 jitter matrix.

[0049] Specifically, an initial neural network model is first constructed, and then the initial neural network model is trained to obtain a deep neural network model, which is convenient for the subsequent use of the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, thereby facilitating the subsequent acquisition of high-quality halftone images based on the optimized target dither matrix.

[0050] In one embodiment of the present invention, training the initial neural network model includes: obtaining a training data set; training the initial neural network model based on the training data set until the training is completed to obtain a deep neural network model.

[0051] Specifically, the training process of the neural network model is to continuously adjust the model parameters through a large number of data iterations of the training data set to optimize the model's performance. The core of this process is to minimize the loss function, which measures the gap between the model's predicted value and the true value. Through training, the neural network can learn the mapping relationship from input to output, so that the model can make accurate predictions when faced with new data.

[0052] In a specific embodiment, the Adam optimizer may be used, the learning rate may be set to 0.001, and 500 epochs may be used to train the initial neural network model.

[0053] Specifically, a training data set is first obtained as the training basis for the initial neural network model; then the initial neural network model is trained based on the training data set until the training is completed, thereby obtaining a deep neural network model, which facilitates the subsequent use of the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, thereby facilitating the subsequent acquisition of high-quality halftone images based on the optimized target dither matrix.

[0054] In one embodiment of the present invention, during the process of training the initial neural network model based on the training data set, when the loss function satisfies a preset condition, it is determined that the training is completed.

[0055] In a specific embodiment, the preset conditions include but are not limited to a mean square error being less than a preset threshold, wherein the preset conditions may be pre-input into the initial neural network model by an operator.

[0056] Specifically, when training the initial neural network model, when it is determined that the loss function meets the preset conditions, the training is determined to be completed and a deep neural network model is obtained, which facilitates the subsequent use of the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, which helps to subsequently obtain a high-quality halftone image according to the optimized target dither matrix.

[0057] In one embodiment of the present invention, the loss function includes: a mean square error between a first image and a second image, wherein the first image is a halftone image obtained by halftoning any grayscale image based on a dithering matrix output by a currently trained deep neural network model, and the second image is a standard halftone image corresponding to any grayscale image.

[0058] In a specific embodiment, a halftone image obtained by halftoning any grayscale image based on a dithering matrix output by a currently trained deep neural network model is used as a first image, and a standard halftone image corresponding to any grayscale image is used as a second image. That is, the first image is an image obtained by training the training image with a deep neural network model and halftoning, and the second image is a high-standard image corresponding to the training image, and the second image is located in the training data set.

[0059] Specifically, when training the initial neural network model, when it is determined that the mean square error between the first image and the second image meets the preset conditions, the training is determined to be completed and a deep neural network model is obtained, which facilitates the subsequent use of the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, which helps to subsequently obtain a high-quality halftone image according to the optimized target dither matrix.

[0060] In one embodiment of the present invention, when the mean square error is less than a preset threshold, it is determined that the loss function meets the preset condition.

[0061] In a specific embodiment, the preset condition is that the mean square error is less than a preset threshold, wherein the preset threshold can be pre-input into the initial neural network model by an operator.

[0062] Specifically, when the initial neural network model is trained, when it is determined that the mean square error between the first image and the second image is less than a preset threshold, it is determined that the loss function meets the preset conditions, and the training is determined to be completed, and a deep neural network model is obtained, so as to facilitate the subsequent use of the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, which helps to obtain a high-quality halftone image according to the optimized target dither matrix.

[0063] In one embodiment of the present invention, obtaining a training data set includes: collecting a plurality of grayscale images and their corresponding standard halftone images; and forming a training data set according to the plurality of grayscale images and their corresponding standard halftone images.

[0064] Specifically, the training process of the neural network model is to continuously adjust the model parameters through a large number of data iterations of the training data set to optimize the model's performance. The core of this process is to minimize the loss function, which measures the gap between the model's predicted value and the true value. Through training, the neural network can learn the mapping relationship from input to output, so that the model can make accurate predictions when faced with new data.

[0065] In a specific embodiment, multiple images, such as but not limited to 10,000 grayscale images and their corresponding standard halftone images, can be downloaded through network query to form a training data set, and a deep neural network model with better effect can be obtained through multiple data iteration training. It can be understood that the larger the amount of data in the training data set, the higher the accuracy of the deep neural network model obtained by training.

[0066] Specifically, by collecting multiple grayscale images and their corresponding standard halftone images, and forming a training data set based on the multiple grayscale images and the corresponding standard halftone images, as the training basis of the initial neural network model, it is convenient to subsequently train the initial neural network model based on the training data set to obtain a deep neural network model, and then it is convenient to use the deep neural network model to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix, which helps to obtain a high-quality halftone image according to the optimized target dither matrix.

[0067] In order to better understand the present invention, the following Figure 2 The image processing method of the embodiment of the present invention is described in detail with a specific embodiment. Figure 2 As shown, in a specific embodiment, the image processing method includes the following steps:

[0068] Step S10: Prepare a training data set.

[0069] Collect 10,000 high-resolution grayscale images and their corresponding high-quality halftone images as a training dataset.

[0070] Step S11: Designing the network structure.

[0071] Build a deep learning neural network suitable for halftone image processing, including convolutional layers, pooling layers, and fully connected layers. The input original image size is 256x256, and the output is an optimized, 16x16 dithering matrix.

[0072] Step S12: training the model.

[0073] The Adam optimizer is used, the learning rate is set to 0.001, the neural network is trained using the training data, and the training is performed for 500 epochs. The mean-square error (MSE) is used as the loss function. The optimization goal is to minimize the MSE between the generated halftone image and the high-quality halftone image. The quality of the halftone image generated by the output dither matrix is ​​evaluated through the loss function, and the network parameters are continuously adjusted.

[0074] Step S13: Optimize the dither matrix.

[0075] After the training is completed, a new original image is input and the corresponding 16x16 jitter matrix is ​​generated through the neural network model.

[0076] Step S14: Apply half-toning processing.

[0077] Use the generated 16x16 dithering matrix to halftone the input image and get a high-quality halftone image.

[0078] In order to verify the feasibility of this method, two evaluation indicators are used to evaluate the performance of this method, namely subjective evaluation and objective evaluation indicator PSNR (Peak Signal to Noise Ratio).

[0079] In a specific embodiment, by using the image processing method of the embodiment of the present invention, multiple original images are processed using an optimized dither matrix to generate high-quality halftone images. In terms of subjective visual evaluation, after comparing the input original image and the output halftone image, it can be clearly found that the output halftone image has a relatively high quality, obvious contrast, and no loss of image detail information. This can prove that the halftone algorithm proposed by the present invention meets expectations and achieves ideal results.

[0080] In terms of the objective evaluation index PSNR, the PSNR calculation is performed on the halftone image generated by the optimized dither matrix and its corresponding original image. The calculation formula of PSNR is as follows:

[0081]

[0082] Where M×N is the size of the original image, f(m,n) is the grayscale value of the original image at (m,n), and b(m,n) is the grayscale value of the result image at (m,n).

[0083] The PSNR values ​​calculated based on the halftone image generated by using the optimized dither matrix and the original image are higher than the PSNR values ​​calculated based on the halftone image generated by using the original unoptimized dither matrix and the original image. It can be seen that the PSNR value obtained by the method proposed in the embodiment of the present invention is higher and the performance is better, so the halftone image generated by using the optimized dither matrix has higher quality.

[0084] In summary, according to the image processing method of the embodiment of the present invention, first, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, the method uses the deep neural network model to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0085] A further embodiment of the present invention also discloses an image processing device, Figure 3 is a structural block diagram of an image processing device according to an embodiment of the present invention. Figure 3 As shown, the image processing device 100 includes: an acquisition module 101 , a first processing module 102 and a second processing module 103 .

[0086] Specifically, the acquisition module 101 is used to acquire the image to be processed.

[0087] The first processing module 102 is used to input the image to be processed into a preset deep neural network model to output an optimized target jitter matrix.

[0088] The second processing module 103 is used to perform halftone processing on the image to be processed based on the target dither matrix to obtain a target image.

[0089] In one embodiment of the present invention, the first processing module 102 is also used to construct an initial neural network model before inputting the image to be processed into a preset deep neural network model, wherein the initial neural network model includes a convolution layer, a pooling layer and a fully connected layer, and the initial neural network model can process the input image through the convolution layer, the pooling layer, and the fully connected layer in sequence, and output a jitter matrix; the initial neural network model is trained to obtain a deep neural network model.

[0090] In one embodiment of the present invention, the first processing module 102 trains the initial neural network model, including: obtaining a training data set; training the initial neural network model based on the training data set until the training is completed to obtain a deep neural network model.

[0091] In one embodiment of the present invention, during the process of training the initial neural network model based on the training data set, the first processing module 102 determines that the training is completed when the loss function satisfies a preset condition.

[0092] In one embodiment of the present invention, the loss function includes: a mean square error between a first image and a second image, wherein the first image is a halftone image obtained by halftoning any grayscale image based on a dithering matrix output by a currently trained deep neural network model, and the second image is a standard halftone image corresponding to any grayscale image.

[0093] In one embodiment of the present invention, when the mean square error is less than a preset threshold, it is determined that the loss function meets the preset condition.

[0094] In one embodiment of the present invention, the acquisition module 101 acquires the training data set, including: collecting multiple grayscale images and their corresponding standard halftone images; and forming the training data set according to the multiple grayscale images and their corresponding standard halftone images.

[0095] According to the image processing device 100 of the embodiment of the present invention, firstly, an image to be processed is obtained as the basis for halftone processing; then, the image to be processed is input into a preset deep neural network model, and the element values ​​of the dither matrix are dynamically adjusted according to the specific image content by using the deep neural network model, and an optimized target dither matrix is ​​output; finally, the image to be processed is halftone processed according to the target dither matrix to obtain a high-quality halftone image; since the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, the image processing device 100 uses the deep neural network model to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0096] A further embodiment of the present invention also discloses a chip.

[0097] In some embodiments, the chip includes: an image processing device 100 as described in any of the above embodiments of the present invention.

[0098] In other embodiments, the chip includes: a processor, a memory, and an image processing program stored in the memory and executable on the processor, wherein the image processing program, when executed by the processor, implements the image processing method described in any of the above embodiments of the present invention.

[0099] In a specific embodiment, the chip can be applied to the printing field, and specifically can be applied to printing equipment or printing equipment, etc.

[0100] The chip according to the embodiment of the present invention can execute the image processing method of the embodiment of the present invention, first by obtaining the image to be processed as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and output the optimized target dither matrix; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which the dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, when executing the image processing method of the embodiment of the present invention, the chip uses the deep neural network model to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0101] A further embodiment of the present invention also discloses an electronic device, which includes: the chip described in the above embodiment of the present invention.

[0102] In a specific embodiment, the electronic device is, for example, an image processing device, including but not limited to a printing device or a printing device.

[0103] According to the electronic device of the embodiment of the present invention, the image processing method of the embodiment of the present invention can be executed. First, an image to be processed is obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix according to the specific image content, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, when the electronic device executes the image processing method of the embodiment of the present invention, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0104] A further embodiment of the present invention further discloses a computer-readable storage medium, on which an image processing program is stored. When the image processing program is executed by a processor, the image processing method described in any of the above embodiments of the present invention is implemented.

[0105] According to the computer-readable storage medium of an embodiment of the present invention, when the image processing program stored thereon is executed by the processor, the image to be processed is first obtained as the basis for halftone processing; then the image to be processed is input into a preset deep neural network model, and the element values ​​of the dither matrix are dynamically adjusted according to the specific image content by using the deep neural network model, and an optimized target dither matrix is ​​output; finally, according to the target dither matrix, halftone processing is performed on the image to be processed to obtain a high-quality halftone image; because the dither matrix not only determines the order in which the dots become black dots when the brightness or grayscale value decreases, but also determines the quality of the halftone image, therefore, when the image processing program stored thereon is executed by the processor, the deep neural network model is used to dynamically adjust the element values ​​of the dither matrix, thereby avoiding the problem of unsatisfactory halftone effect caused by the inability to perform dynamic optimization according to the specific image content, thereby outputting a high-quality target dither matrix, and then a high-quality halftone image can be obtained according to the target dither matrix.

[0106] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0107] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. An image processing method, characterized in that: include: Get the image to be processed; Inputting the image to be processed into a preset deep neural network model to output an optimized target jitter matrix; The image to be processed is subjected to halftone processing based on the target dither matrix to obtain a target image.

2. The image processing method according to claim 1, characterized in that: Before inputting the image to be processed into a preset deep neural network model, the method further includes: Constructing an initial neural network model, wherein the initial neural network model includes a convolution layer, a pooling layer, and a fully connected layer, and the initial neural network model can process the input image through the convolution layer, the pooling layer, and the fully connected layer in sequence, and output a jitter matrix; The initial neural network model is trained to obtain the deep neural network model.

3. The image processing method according to claim 2, characterized in that: Training the initial neural network model includes: Get the training dataset; The initial neural network model is trained based on the training data set until the training is completed to obtain the deep neural network model.

4. The image processing method according to claim 3, characterized in that: In the process of training the initial neural network model based on the training data set, when the loss function meets a preset condition, it is determined that the training is completed.

5. The image processing method according to claim 4, characterized in that: The loss function includes: the mean square error between the first image and the second image, wherein the first image is a halftone image obtained by halftoning any grayscale image based on the dithering matrix output by the currently trained deep neural network model, and the second image is a standard halftone image corresponding to any grayscale image.

6. The image processing method according to claim 5, characterized in that: When the mean square error is less than a preset threshold, it is determined that the loss function meets a preset condition.

7. The image processing method according to claim 3, characterized in that: The step of obtaining a training data set includes: Collect multiple grayscale images and their corresponding standard halftone images; The training data set is formed according to a plurality of the grayscale images and the corresponding standard halftone images.

8. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be processed; A first processing module, used for inputting the image to be processed into a preset deep neural network model to output an optimized target jitter matrix; The second processing module is used to perform halftone processing on the image to be processed based on the target dither matrix to obtain a target image.

9. A chip, characterized in that: include: The image processing device according to claim 8; or, A processor, a memory, and an image processing program stored in the memory and executable on the processor, wherein the image processing program implements the image processing method according to any one of claims 1 to 7 when executed by the processor.

10. An electronic device, characterized in that: Comprising the chip as claimed in claim 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an image processing program, and when the image processing program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Video recording method and device, electronic equipment and readable storage medium

    CN119653033A