Simulation method, device, equipment and medium for image printing and photographing process

By performing blur processing, color change, noise addition and perspective transformation on the original image, a simulated image is generated, which solves the problems in the existing technology of high image acquisition cost and the inability of synthetic images to truly simulate real scenes, and achieves high-quality simulated image generation. , which improves model training and evaluation effects.

CN118570590BActive Publication Date: 2024-10-29SHENZHEN QIANHAI QUANTUM CLOUD TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411053120.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-10-29
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

Existing technologies in the field of image processing, especially in the field of anti-counterfeiting and identification of printed matter or labels, make it difficult to obtain enough real-life images for model training and evaluation, resulting in limited model performance and generalization capabilities, high cost of real-life image acquisition and synthesis Images cannot truly simulate real-life scenes.

Method used

By blurring, color changing, noise adding and compressing the original image, combined with perspective transformation, a simulated image is generated, and the influencing factors in the printing and photographing process are simulated to generate a high-quality simulated image.

Benefits of technology

Without the need for large-scale actual collection of images, a large number of high-quality simulated images are generated, which reduces the cost and time of data acquisition, improves the model training and evaluation effect, and makes the simulation image realism close to the real scene, overcoming the problem of synthetic images and real images. The question of difference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570590B_ABST
    Figure CN118570590B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for simulating the process of image printing and photographing. The method comprises: blurring an original image to obtain a defocused blurred image; performing color change on the defocused blurred image to obtain a color-changed image; adding noise to the color-changed image and performing compression processing to obtain a noise-compressed image; performing perspective transformation on the noise-compressed image to obtain a printing and photographing simulation image of the original image. The embodiments of the present invention can reduce the image acquisition cost and improve the authenticity of the simulated image.
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, and in particular to a method, device, equipment and medium for simulating image printing and photographing processes. Background Art

[0002] Image processing has been widely used in the fields of medical image analysis, security monitoring, autonomous driving, image recognition, and anti-counterfeiting technology. Image processing requires a large number of images to train and evaluate the model. Once the images are insufficient, the training and evaluation of the model will be greatly affected. Especially in the field of anti-counterfeiting and identification of printed materials or labels, it is necessary to collect real images of printed materials after printing and taking pictures with mobile phones. Due to the high cost of collecting real images, it is often impossible to obtain enough real images to train and evaluate related models.

[0003] There are two main methods for image data collection: one is to actually collect real images, and the other is to generate and use synthetic images.

[0004] The former has problems such as high cost and difficulty in data acquisition; although the latter has lower cost in synthesizing images, it often cannot truly simulate real scenes, resulting in large differences between the synthesized images and the actual images, which affects the performance and generalization ability of the model. Summary of the invention

[0005] The present invention provides a method, device, equipment and medium for simulating the process of image printing and photographing, so as to reduce the image acquisition cost and improve the authenticity of the simulated image.

[0006] According to one aspect of the present invention, there is provided a method for simulating an image printing and photographing process, comprising:

[0007] The original image is blurred to obtain a defocused blurred image;

[0008] Performing a color change on the out-of-focus blurred image to obtain a color-changed image;

[0009] Adding noise to the color change image and performing compression processing to obtain a noise compressed image;

[0010] The noise compression image is perspective transformed to obtain a printed photographic simulation image of the original image.

[0011] According to another aspect of the present invention, there is provided a device for simulating image printing and photographing processes, comprising:

[0012] A blur processing module, used for blurring the original image to obtain a defocused blurred image;

[0013] A color change module, used for changing the color of the out-of-focus blurred image to obtain a color-changed image;

[0014] A noise compression module, used for adding noise to the color change image and performing compression processing to obtain a noise compressed image;

[0015] The perspective transformation module is used to perform perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image.

[0016] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for simulating the image printing and photographing process according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0018] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the simulation method of the image printing and photographing process described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for simulating the image printing and photographing process described in any embodiment of the present invention when executed.

[0020] The embodiment of the present invention can obtain a large number of high-quality simulated images without the need for large-scale actual image collection by simulating the process of printing and photographing images, thereby greatly saving time and resources and improving the efficiency and feasibility of data acquisition. Moreover, compared with synthetic images, simulated images truly reproduce various influencing factors that may occur in the printing and photographing process, such as color differences, resolution changes, color depth changes, texture and surface effects, shape and size changes, and are closer to real scenes, overcoming the problem of large differences between later images and real images, thereby improving the training and evaluation effects of subsequent models.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1A is a flow chart of a method for simulating an image printing and photographing process provided according to an embodiment of the present invention;

[0024] Figure 1B is a schematic diagram of an image processing flow provided according to an embodiment of the present invention;

[0025] Figure 2 is a flow chart of a method for simulating an image printing and photographing process according to another embodiment of the present invention;

[0026] Figure 3 is a structural schematic diagram of a method for simulating image printing and photographing processes provided according to another embodiment of the present invention;

[0027] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Figure 1AThis is a flowchart of a method for simulating the image printing and photographing process provided by an embodiment of the present invention. This embodiment is applicable to the case where a large number of simulated images are generated based on original images, and the generated simulated images are used as sample images to train and test the model. The method can be executed by a simulation device for the image printing and photographing process, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device with corresponding data processing capabilities. Figure 1A As shown, the method includes:

[0031] S110, blurring the original image to obtain a defocused blurred image.

[0032] Specifically, the problems that may occur during the printing and collection process include: color changes, resolution changes, color depth changes, texture and surface effects, shape and size changes. In general, the difference between the image after printing and recollection and the original image depends on various factors involved in the printing and collection process, and these differences may affect the visual effect and quality of the printed product.

[0033] Assuming that the camera device (such as a mobile phone) is a pinhole camera model, any two images in the same plane can be related by homography. Generate a random homography to simulate this effect, and randomly and uniformly perturb the four corners of the original image to simulate this situation. After that, considering that camera motion and inaccurate focus may cause blur, a linear blur kernel with a certain range of width is generated for random angles. In order to simulate out-of-focus blur, a Gaussian blur kernel with a standard deviation between pixels within a certain range is used to blur the original image to obtain an out-of-focus blurred image.

[0034] S120: Performing a color change on the out-of-focus blurred image to obtain a color-changed image.

[0035] Among them, color changes can be divided into changes in three dimensions, namely, hue changes, saturation changes, and brightness contrast changes.

[0036] Specifically, the color gamut of a printer is limited, and a camera uses exposure settings, white balance, and a color correction matrix to modify the color output, so the color of the original image will change when it is printed on paper and when the paper image is photographed. In order to simulate the color changes in reality, the out-of-focus blurred image is also color-changed to simulate the color distortion during printing and photographing, and a color-changed image is obtained.

[0037] S130: adding noise to the color-changing image and performing compression processing to obtain a noise-compressed image.

[0038] Among them, camera images are usually stored in a lossy compression format, so parameters are needed to control the quality of JPEG compression.

[0039] Specifically, the noise in the imaging process is simulated by a Gaussian noise model, and the noise is added to the color change image. Considering that the image obtained by taking a photo is usually stored in a lossy compression format, after adding the noise, the image quality of the color change image is deliberately reduced by lossy compression and specific compression parameters to simulate the compressed storage of the image after taking a photo, thereby obtaining a noise compressed image.

[0040] Exemplarily, a feasible lossy compression process is as follows:

[0041] 1. Divide the uncompressed image into blocks of N*N pixels.

[0042] 2. Perform DCT cosine transform on each small block to extract the frequency information of the image.

[0043] 3. Quantize and encode these frequency information to reduce the amount of data and obtain a compressed image.

[0044] In addition, if the image is in color before compression, a color space conversion (RGB->YCrCb) is required before the first step.

[0045] S140: Perform perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image.

[0046] Among them, perspective transformation is a nonlinear transformation that can adjust the size and position relationship of objects in the image to make it look more in line with the visual perception of the human eye. Printing and photographing simulation images are images obtained by simulating the original image being printed first and then photographed.

[0047] Specifically, when a person holds a camera device to take a photo, it is usually impossible to completely align the object being photographed, and there will always be a certain offset. Considering this situation, a random perspective transformation is performed on the noise compression image to simulate the situation that the camera device is not completely aligned with the object being photographed when taking a photo, and a printed photographic simulation image of the original image is obtained.

[0048] After obtaining the printed photographic simulation image, the printed photographic simulation image is used as the sample image of the model. Various data enhancements (such as rotation, flipping, scaling, cropping and translation) can also be performed on it, and the printed photographic simulation image after data enhancement is also used as the sample image to further enrich the diversity and quantity of the image sample set, improve the generalization ability and robustness of the deep learning model, and overcome the problem of insufficient data sets in the existing technology.

[0049] For example, Figure 1BAs shown, the original image is blurred, saturation changed, noised, compressed, and perspective changed to obtain a printed photographic simulation image. After testing, the simulated image obtained by the method of the present invention can effectively improve the training effect of the anti-copying detection model compared with the common printed photographic composite image. The test results are shown in Table 1 below.

[0050] Table 1 Test results

[0051] Total number of samples: 1000 The accuracy of the model output Use simulated images as sample images for training 93.2% Use synthetic images as sample images for training 96.3%

[0052] The embodiment of the present invention can obtain a large number of high-quality simulated images without the need for large-scale actual image collection by simulating the process of printing and photographing images, thereby greatly saving time and resources and improving the efficiency and feasibility of data acquisition. Moreover, compared with synthetic images, simulated images truly reproduce various influencing factors that may occur in the printing and photographing process, such as color differences, resolution changes, color depth changes, texture and surface effects, shape and size changes, and are closer to real scenes, overcoming the problem of large differences between later images and real images, thereby improving the training and evaluation effects of subsequent models.

[0053] Figure 2 This is a flowchart of a method for simulating the image printing and photographing process provided by another embodiment of the present invention. This embodiment is optimized and improved on the basis of the above embodiment. Figure 2 As shown, the method includes:

[0054] S210, blurring the original image to obtain a defocused blurred image.

[0055] S220. Determine the degree of change in hue and saturation of the out-of-focus blurred image according to the current number of training times of the model; perform hue shift on the out-of-focus blurred image according to the degree of hue change to obtain a hue-changed image.

[0056] S230, changing the saturation of the hue-changed image according to the degree of saturation change to obtain a saturation-changed image;

[0057] S240: Perform brightness and contrast changes on the saturation-changed image to obtain a color-changed image.

[0058] Among them, the degree of saturation change is proportional to the current number of training times before reaching the maximum degree, and the degree of hue change is proportional to the current number of training times before reaching the maximum degree.

[0059] Specifically, the out-of-focus blurred image is subjected to hue change, saturation change, and brightness contrast change in sequence to obtain a color change image. During the color change process, the degree of saturation change and the degree of saturation change retention will increase with the increase in the current number of training times until the upper limit of both is reached and no longer increases. By dynamically controlling the degree of saturation change and hue change according to the current number of training times, the diversity of subsequent printed and photographed simulated images is improved to ensure that the model has sufficient recognition and processing capabilities for different degrees of color changes in real situations.

[0060] Optionally, performing hue shift on the out-of-focus blurred image according to the hue change degree to obtain a hue-changed image includes:

[0061] Convert the color change simulation image into an HSV model image;

[0062] Hue adjustment is performed on the hue channel of the HSV model image according to the degree of hue change, and after the adjustment, the HSV model image is converted back to an RGB model image to obtain a hue shift simulation image.

[0063] Among them, each color in the HSV model is represented by hue (Hue, H), saturation (Saturation, S) and value (Value, V).

[0064] Specifically, compared with the RGB model, the HSV model is more convenient and accurate in adjusting the hue. When changing the hue, the color change simulation image of the RGB model is converted into the HSV model image, and the hue change is simulated according to the degree of color change on the HSV hue channel. After the hue adjustment is completed, the HSV model image is converted back to the HSV model image to obtain a hue shift simulation image.

[0065] Optionally, performing brightness contrast change on the saturation change image to obtain a color change image includes:

[0066] For each pixel of the saturation change image, determining the product of the pixel value of the pixel and a preset contrast adjustment factor;

[0067] The sum of the product and the preset brightness adjustment value is determined as the new pixel value of the pixel point to obtain a color-changed image.

[0068] Specifically, when the brightness contrast changes, for any pixel in the image, the pixel value of the pixel is multiplied by the preset contrast adjustment factor, and the product is summed with the preset brightness adjustment value. The sum is the new pixel value of the point. After the adjustment of the new pixel values ​​of all pixels is completed, a color-changed image is obtained. The specific calculation formula is as follows:

[0069] g(i,j) = alpha*f(i,j) + beta.

[0070] Among them, g(i,j) is the new pixel value after pixel adjustment, f(i,j) is the pixel value before pixel adjustment, i and j are the horizontal and vertical coordinates of the pixel in the image, alpha is the preset contrast adjustment factor, and the value range is [0.5, 1.5], and beta is the preset brightness adjustment value, and the value range is [-30, 30].

[0071] S250: adding noise to the color-changing image and performing compression processing to obtain a noise-compressed image.

[0072] S260, determining the perspective transformation degree of the noise compression image according to the current training times of the model; performing perspective transformation on the noise compression image according to the perspective transformation degree to obtain a printing photography simulation image.

[0073] Specifically, similar to color changes, the degree of perspective transformation will also increase with the increase of the current number of training times until the upper limit of the degree of perspective transformation is reached. By dynamically controlling the degree of perspective transformation according to the current number of training times, the diversity of subsequent printing and photographing simulation images is improved, ensuring that the model has sufficient recognition and processing capabilities for different degrees of perspective transformation in real situations.

[0074] S270: Determine label information of the printed photographic simulation image according to the label information of the original image.

[0075] Specifically, for image classification models, the label information of the original image can be directly set to the label information of the printed photographic simulation image. For models such as image segmentation and target detection, the label information of the original image can also be directly set to the label information of the printed photographic simulation image, but the bbox and segmentation mask can be transformed accordingly according to the geometric transformation. Generate corresponding label information for each enhanced image. These label information include the category, position and posture of the image, etc., to ensure the integrity and high quality of the data set. Compared with the traditional manual labeling method, the present invention also improves the data processing efficiency and the accuracy of the label.

[0076] The embodiment of the present invention ensures the diversity of the generated simulated images by controlling the degree of color change and perspective change according to the number of training times. It can also effectively train the model and test and evaluate it in different application scenarios to ensure the reliability and performance of the model in practical applications.

[0077] Figure 3 A schematic diagram of a device for simulating image printing and photographing process provided by another embodiment of the present invention. Figure 3 As shown, the device comprises:

[0078] A blur processing module 310 is used to perform blur processing on the original image to obtain a defocused blurred image;

[0079] A color change module 320, configured to change the color of the out-of-focus blurred image to obtain a color-changed image;

[0080] A noise compression module 330, configured to add noise to the color change image and perform compression processing to obtain a noise compressed image;

[0081] The perspective transformation module 340 is used to perform perspective transformation on the noise compression image to obtain a printing and photographing simulation image of the original image.

[0082] The image printing and photographing process simulation device provided in the embodiment of the present invention can execute the image printing and photographing process simulation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0083] Optionally, the color change module 320 includes:

[0084] A change degree determination unit, used to determine the degree of change of the hue and the degree of change of the saturation of the out-of-focus blurred image according to the current number of training times of the model;

[0085] a hue changing unit, configured to perform hue shift on the out-of-focus blurred image according to the hue change degree to obtain a hue changed image;

[0086] a saturation changing unit, configured to change the saturation of the hue changing image according to the saturation changing degree, so as to obtain a saturation changing image;

[0087] The color change unit is used to change the brightness and contrast of the saturation change image to obtain a color change image.

[0088] Optionally, the hue change unit is specifically used to: convert the color change simulation image into an HSV model image; perform hue adjustment on the hue channel of the HSV model image according to the degree of hue change, and convert the HSV model image back to an RGB model image after adjustment to obtain a hue shift simulation image.

[0089] Optionally, the color change unit is specifically used to: determine the perspective transformation degree of the noise compression image according to the current training times of the model; perform perspective transformation on the noise compression image according to the perspective transformation degree to obtain a printed photography simulation image.

[0090] Optionally, the device further comprises:

[0091] The label determination module is used to determine the label information of the printed photographic simulation image according to the label information of the original image.

[0092] Optionally, the perspective transformation module 340 is specifically used to: determine the perspective transformation degree of the noise compression image according to the current training times of the model; perform perspective transformation on the noise compression image according to the perspective transformation degree to obtain a printed photography simulation image.

[0093] The image printing and photographing process simulation device further described can also execute the image printing and photographing process simulation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0094] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0095] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0096] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as the simulation method of the image printing and photographing process.

[0098] In some embodiments, the simulation method of the image printing and photographing process can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the simulation method of the image printing and photographing process described above can be performed. Alternatively, in other embodiments, the processor 41 can be configured to perform the simulation method of the image printing and photographing process in any other appropriate manner (for example, by means of firmware).

[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0101] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for simulating image printing and photographing process, characterized in that: The method comprises: The original image is blurred to obtain a defocused blurred image; Performing a color change on the out-of-focus blurred image to obtain a color-changed image, so as to simulate the color distortion of the original image during printing and photographing; Adding noise to the color change image and performing compression processing to obtain a noise compressed image; Performing perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image; The step of changing the color of the out-of-focus blurred image to obtain a color-changed image comprises: Determining a degree of change in hue and saturation of the out-of-focus blurred image according to a current number of training times of the model; Performing a hue shift on the out-of-focus blurred image according to the degree of hue change to obtain a hue-changed image; Performing saturation changes on the hue-changed image according to the degree of saturation change to obtain a saturation-changed image; Performing brightness and contrast changes on the saturation-changed image to obtain a color-changed image; Among them, the degree of saturation change is proportional to the current number of training times before reaching the maximum degree, and the degree of hue change is proportional to the current number of training times before reaching the maximum degree.

2. The method according to claim 1, characterized in that The step of performing hue shift on the out-of-focus blurred image according to the hue change degree to obtain the hue-changed image comprises: Convert the out-of-focus blurred image into an HSV model image; Hue adjustment is performed on the hue channel of the HSV model image according to the degree of hue change, and after the adjustment, the HSV model image is converted back to an RGB model image to obtain a hue change image.

3. The method according to claim 1, characterized in that The step of performing brightness and contrast changes on the saturation-changed image to obtain a color-changed image comprises: For each pixel of the saturation change image, determining the product of the pixel value of the pixel and a preset contrast adjustment factor; The sum of the product and the preset brightness adjustment value is determined as the new pixel value of the pixel point to obtain a color-changed image.

4. The method according to claim 1, characterized in that: The performing perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image comprises: Determining a degree of perspective transformation of the noise compressed image according to a current number of training times of the model; The noise compression image is perspective transformed according to the perspective transformation degree to obtain a printing and photographing simulation image.

5. The method according to claim 1, characterized in that After performing perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image, the method further includes: The label information of the printed photographic simulation image is determined according to the label information of the original image.

6. A device for simulating the process of image printing and photographing, characterized in that: The device comprises: A blur processing module, used for blurring the original image to obtain a defocused blurred image; A color change module, used for changing the color of the out-of-focus blurred image to obtain a color-changed image, so as to simulate the color distortion of the original image during printing and photographing; A noise compression module, used for adding noise to the color change image and performing compression processing to obtain a noise compressed image; A perspective transformation module, used for performing perspective transformation on the noise compressed image to obtain a printed photographic simulation image of the original image; Wherein, it is characterized in that the color change module includes: A change degree determination unit, used to determine the degree of change of the hue and the degree of change of the saturation of the out-of-focus blurred image according to the current number of training times of the model; a hue changing unit, configured to perform hue shift on the out-of-focus blurred image according to the hue change degree to obtain a hue changed image; a saturation changing unit, configured to change the saturation of the hue changing image according to the saturation changing degree, so as to obtain a saturation changing image; A color change unit, used for changing the brightness and contrast of the saturation change image to obtain a color change image; Among them, the degree of saturation change is proportional to the current number of training times before reaching the maximum degree, and the degree of hue change is proportional to the current number of training times before reaching the maximum degree.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for simulating the image printing and photographing process according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for simulating the image printing and photographing process according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Training method of neural network model for presswork image sharpening

    CN116843009A