CN108470366B - Method and apparatus for generating simulated image and computer readable storage medium - Google Patents
Method and apparatus for generating simulated image and computer readable storage medium Download PDFInfo
- Publication number
- CN108470366B CN108470366B CN201810262761.2A CN201810262761A CN108470366B CN 108470366 B CN108470366 B CN 108470366B CN 201810262761 A CN201810262761 A CN 201810262761A CN 108470366 B CN108470366 B CN 108470366B
- Authority
- CN
- China
- Prior art keywords
- image
- simulation
- color
- generating
- analog
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a method and a device for generating a simulation image and a computer readable storage medium, and relates to the field of image processing. The simulated image generation method comprises the following steps: generating an analog number according to a preset number generation rule; generating a number simulation image according to the simulation number and the selected number style; and generating a simulation image according to the synthesis result of the number simulation image and the generated background simulation image. The method of the embodiment of the invention can automatically generate the simulation image, and has small calculation amount and high calculation speed in the generation process, thereby generating a large amount of deep learning training samples in a short time and improving the generation efficiency of the deep learning training samples.
Description
Technical Field
The present invention relates to the field of image processing, and in particular, to a method and an apparatus for generating a simulated image and a computer-readable storage medium.
Background
Currently, in order to improve work efficiency, pattern recognition technology has been widely used in various fields. For example, an automatic identification system for a container number can greatly increase the customs clearance speed of a customs gate, and has been widely used in various container inspection systems in recent years. The study of container number identification began in the last 90 s, after which a large number of researchers have extracted various container number location and identification algorithms.
In recent years, deep learning algorithms have been developed greatly, and have shown excellent performance in many pattern recognition fields, far exceeding the traditional pattern recognition methods. In the training process of the deep learning algorithm, massive and manually labeled data are often needed, and the final performance of the algorithm is influenced to a certain extent by the size of the data. However, manual labeling of mass data is a tedious work with a very large workload, and is time-consuming and labor-consuming. Thus, the generation efficiency of the deep learning training samples is reduced.
Disclosure of Invention
The embodiment of the invention aims to solve the technical problem that: how to improve the generation efficiency of deep learning training samples.
According to a first aspect of some embodiments of the present invention, there is provided a simulated image generation method comprising: generating an analog number according to a preset number generation rule; generating a number simulation image according to the simulation number and the selected number style; and generating a simulation image according to the synthesis result of the number simulation image and the generated background simulation image.
In some embodiments, generating the simulation number according to a preset number generation rule includes: randomly selecting a group of main codes from a main code base, wherein the main code base is obtained by counting the main codes in the real container numbers; randomly generating a number with a preset digit; generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number; an analog number is generated that includes a main code, fixed letters, generated digits, and a check code.
In some embodiments, the number style includes at least one of a number color and a number font.
In some embodiments, generating the number simulation image from the simulation number and the selected number pattern comprises: randomly selecting number fonts from a font library and randomly selecting number colors from a color library; acquiring a character image corresponding to each character in the analog number from a character image library corresponding to the number font selected randomly; setting characters in the character image as number colors, and adding an outer frame for the last character in the analog number, wherein the color of the outer frame is the number color; and splicing the character images to obtain a number simulation image.
In some embodiments, the simulated image generation method further comprises: randomly selecting a background color from a color library, and generating a background simulation image filled with the background color, wherein the color library is obtained by counting the colors of real container bodies.
In some embodiments, generating the simulation image based on a result of synthesizing the number simulation image and the generated background simulation image includes: dividing the synthesized image into a plurality of areas; and adjusting the brightness of at least one of the plurality of regions to generate a simulated image.
In some embodiments, one or more sets of concave-convex effect regions are arranged in the synthesized image at a preset interval, wherein the concave-convex effect regions comprise a light region with a preset first width and a dark region with a preset second width, and the heights of the light region and the dark region are equal to the image height; the brightness of the bright area is increased and the brightness of the dark area is decreased to generate a simulation image.
In some embodiments, generating the simulation image based on a result of synthesizing the number simulation image and the generated background simulation image includes: random noise is added to the synthesized image, and a simulation image is generated.
According to a second aspect of some embodiments of the present invention, there is provided a simulated image generating apparatus comprising: the simulation number generation module is configured to generate a simulation number according to a preset number generation rule; a number simulation image generation module configured to generate a number simulation image according to the simulation number and the selected number style; and the simulation image generation module is configured to generate a simulation image according to a synthesis result of the number simulation image and the generated background simulation image.
In some embodiments, the analog number generation module is further configured to: randomly selecting a group of main codes from a main code base, wherein the main code base is obtained by counting the main codes in the real container numbers; randomly generating a number with a preset digit; generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number; an analog number is generated that includes a main code, fixed letters, generated digits, and a check code.
In some embodiments, the number style includes at least one of a number color and a number font.
In some embodiments, the number simulation image generation module is further configured to: randomly selecting number fonts from a font library and randomly selecting number colors from a color library; acquiring a character image corresponding to each character in the analog number from a character image library corresponding to the number font selected randomly; setting characters in the character image as number colors, and adding an outer frame for the last character in the analog number, wherein the color of the outer frame is the number color; and splicing the character images to obtain a number simulation image.
In some embodiments, the analog image generating apparatus further comprises: and the background simulation image generation module is configured to randomly select a background color from a color library and generate a background simulation image filled with the background color, wherein the color library is obtained by counting the colors of real container bodies.
In some embodiments, the simulated image generation module is further configured to: dividing the synthesized image into a plurality of areas; and adjusting the brightness of at least one of the plurality of regions to generate a simulated image.
In some embodiments, the simulated image generation module is further configured to: setting one or more groups of concave-convex effect areas in the synthesized image at a preset interval, wherein the concave-convex effect areas comprise a bright part area with a preset first width and a dark part area with a preset second width, and the heights of the bright part area and the dark part area are equal to the height of the image; the brightness of the bright area is increased and the brightness of the dark area is decreased to generate a simulation image.
In some embodiments, the simulated image generation module is further configured to add random noise to the synthesized image, generating a simulated image.
According to a third aspect of some embodiments of the present invention, there is provided a simulated image generating apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform any of the foregoing simulated image generation methods based on instructions stored in the memory.
According to a fourth aspect of some embodiments of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any one of the above-mentioned simulated image generation methods.
Some embodiments of the above invention have the following advantages or benefits: the method of the embodiment of the invention can automatically generate the simulation image, and has small calculation amount and high calculation speed in the generation process, thereby generating a large amount of deep learning training samples in a short time and improving the generation efficiency of the deep learning training samples.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is an exemplary flow chart of a simulated image generation method according to some embodiments of the invention.
FIG. 2 is an exemplary flow chart of a method of generating a simulated image according to further embodiments of the present invention.
Fig. 3 is an exemplary container number simulation image generated according to some embodiments of the invention.
FIG. 4 is an exemplary flow chart of a method of generating a simulated image according to still further embodiments of the invention.
Fig. 5A is an exemplary flow chart of a sunlit blocking effect simulation method according to some embodiments of the invention.
FIG. 5B is an exemplary simulated image generated according to some embodiments of the invention.
FIG. 6A is an exemplary flow chart of a method for simulating the effect of a solar-illuminated concave-convex surface according to some embodiments of the invention
FIG. 6B is an exemplary simulated image generated according to other embodiments of the present invention.
FIG. 7 is an exemplary block diagram of a simulated image generation apparatus according to some embodiments of the invention.
FIG. 8 is an exemplary block diagram of an analog image generation device according to further embodiments of the present invention.
FIG. 9 is an exemplary block diagram of a simulated image generation apparatus according to further embodiments of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
FIG. 1 is an exemplary flow chart of a simulated image generation method according to some embodiments of the invention. As shown in fig. 1, the simulated image generating method of this embodiment includes steps S102 to S106.
In step S102, an analog number is generated according to a preset number generation rule.
The simulation number is a number to be recognized in a simulation image to be generated, and may be, for example, a number of a container, a number of a transportation device, or a number of a waiting recognition object. When generating the analog number, the analog number may be generated according to a number generation rule corresponding to the object to be recognized.
The following description will be made by taking a container number as an example. In some embodiments, the container number includes a main code composed of 3-bit letters, 1-bit fixed characters, 6-bit arabic numerals, and 1-bit check code, wherein the check code is generated according to the first ten-bit characters according to a preset rule. Table 1 is an exemplary container number and corresponding container number naming convention.
TABLE 1
In some embodiments, the master code in the actual container number may be counted in advance to generate a master code library. When generating the analog number, a group of main codes can be randomly selected from a main code library at first, and then numbers with preset digits are randomly generated; generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number; finally, an analog number including the main code, the fixed letters, the generated numbers, and the check code may be generated, for example, the main code, the fixed letters, the generated numbers, and the check code may be combined in sequence to obtain the analog number.
In some embodiments, the container number check code generation rule is: and summing equivalent values corresponding to the main code, the fixed letter and the number, performing modulo 11 and then modulo 10 to obtain a numerical value which is the last check code. The equivalent value corresponding to each number is the value of itself, and the equivalent value corresponding to each letter can be shown in table 2.
TABLE 2
Character(s) | A | B | C | D | E | F | G | H | I |
Equivalent value | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
Character(s) | J | K | L | M | N | O | P | Q | R |
Equivalent value | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
Character(s) | S | T | U | V | W | X | Y | Z | |
Equivalent value | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 |
As required, those skilled in the art may also generate the analog number in other manners, which are not described herein.
In step S104, a number simulation image is generated based on the simulation number and the selected number pattern.
After determining the content of the analog number, an image including the analog number may be generated as a foreground image of the analog image in accordance with a selected number pattern, where the number pattern may include, for example, one or both of a number font and a number color. The number patterns may also include, for example, shading, texture, transparency, and the like, as desired. In some embodiments, the number patterns of fonts, colors and the like commonly used by the object to be recognized can be counted in advance, and a number pattern library such as a font library, a color library and the like is generated so as to be selected when the analog image is generated.
In some embodiments, the pictures of all the characters corresponding to each number font in the font library may be generated in advance. For example, pictures with letters A-Z and numbers 0-9 of font 1, pictures with letters A-Z and numbers 0-9 of font 2, respectively, and so forth may be generated. Thus, a library of character images corresponding to each number font can be obtained separately. When generating the number analog image, a plurality of character images corresponding to the analog number may be selected from a character image library corresponding to the selected number font, and the character images may be stitched to obtain the character image.
In some embodiments, it is also possible to count the commonly used container number colors to obtain a color library, and randomly select one color from the color library as the filling color of the character.
In step S106, a simulation image is generated based on the result of combining the number simulation image and the generated background simulation image.
The background analog image is the background of the analog number in the analog image. The background simulation image can be a solid background or a background with texture or pattern, and the specific style of the background simulation image can be determined according to the type of the object to be recognized. For example, the container usually has several fixed colors, so when generating the container number simulation image, the commonly used container colors can be counted to obtain a color library, and one color is randomly selected from the color library to be used as the filling color of the background simulation image.
In some embodiments, a combination of a real foreground number color and a real background color may be counted in advance, and in the process of generating the simulated image, color filling is performed on the simulated number and the simulated background image according to the foreground number color and the background color in the selected combination.
When the number analog image and the background analog image are synthesized, the number analog image may be placed in the center, or may be placed in an arbitrary direction or angle. In some embodiments, random noise may also be added to the synthesized image, generating a simulated image. Alternatively, other post-processing may be performed to simulate a real image acquisition environment.
By the method of the embodiment, the simulation image can be automatically generated, the calculation amount in the generation process is small, and the calculation speed is high, so that a large number of deep learning training samples can be generated in a short time, and the generation efficiency of the deep learning training samples is improved.
An embodiment of the simulation image generation method will be exemplarily described below, taking the generation of the container number simulation image as an example.
FIG. 2 is an exemplary flow chart of a method of generating a simulated image according to further embodiments of the present invention. As shown in fig. 2, the analog image generating method of this embodiment includes steps S202 to S208.
In step S202, an analog number is generated according to a preset number generation rule.
In step S204, a number font is randomly selected from the font library, and a number color is randomly selected from the color library.
In step S206, a character image corresponding to each character in the analog number is acquired from the character image library corresponding to the randomly selected number font.
In some embodiments, each image in the character image library may be a binary image, wherein the white part is a character and the black part is a background, so that the storage space can be saved. The images in the character image library may also be other types of images as needed, and are not described herein again.
In step S208, the characters in the character image are set to the number color, and a frame is added to the last character in the analog number, wherein the color of the frame is the number color.
Typically, the check code for the container number has a bounding box. The last character in the simulated number can be similarly processed, so that the generated simulated image is closer to the real container number style.
In some embodiments, the background portion of the character image other than the character may be set to be transparent, or may be set to the same color or texture as the background analog image.
In step S210, the character images are stitched to obtain a number simulation image.
For example, the character images may be transversely and sequentially spliced to obtain a number simulation image. Certain spacing may also be provided between certain characters, as desired. Taking the container number as an example, a certain interval exists between the fixed character and the 6-digit number of a part of the container number, and a certain interval exists between the 6-digit number and the check code, and an exemplary container number simulation image can be shown in fig. 3.
In step S212, a simulation image is generated based on the result of combining the number simulation image and the generated background simulation image.
By the method of the embodiment, the number simulation image can be generated according to the selected font and color, so that the generated simulation image is closer to a real container number image, and the method is suitable for training a neural network model.
In practical applications, the captured images may have differences due to different external environments or different carriers of numbers. Embodiments of the present invention may also simulate these special cases and further processing may be performed after the number simulation image and the background simulation image are combined. For example, the synthesized image may be divided into a plurality of regions, and the brightness of at least one of the plurality of regions may be adjusted to generate a simulated image, thereby simulating various effects in the case of solar irradiation. An embodiment of the analog image generation method of the present invention is described below with reference to fig. 4.
FIG. 4 is an exemplary flow chart of a method of generating a simulated image according to still further embodiments of the invention. As shown in fig. 4, the analog image generating method of this embodiment includes steps S402 to S422.
In step S402, a number color and a background color are randomly selected from the color library, and a background simulation image is initialized.
In step S404, an analog number is generated according to a preset number generation rule.
In step S406, a number simulation image is generated based on the simulation number and the selected number pattern.
In step S408, the number analog image is added to the background analog image, and a composite image is generated.
In step S410, whether to simulate the sunlight shielding effect is determined according to a preset first probability. If yes, go to step S412; otherwise, step S414 is executed.
In step S412, a sunlit blocking effect is added to the composite image.
Some images taken outdoors are affected by sunlight and other objects, and the brightness of one part of the images is higher than that of the other part, so that the situation can be simulated.
In step S414, whether to simulate the surface irregularity effect is determined based on a preset second probability. If yes, go to step S416; otherwise, step S418 is performed.
In step S416, a surface irregularity effect is added to the composite image.
In some cases, the characters to be recognized are printed on a surface having irregularities, so that when sunlight strikes the surface, the surface has an alternating light and dark effect, i.e. the relief transition surface facing the sunlight has a higher brightness, the relief transition surface facing away from the sunlight has a lower brightness, and the brightness of the planar portion is between the brightness of the two transition surfaces.
In step S418, random noise is generated and added to the synthesized image.
In step S420, the generated simulation image is saved.
In step S422, it is determined whether the number of generated simulation images reaches a preset number. If yes, ending the process; if not, go back to step S402.
By the method of the embodiment, the generated image is closer to the image shot in the practical application environment, so that the depth model trained by adopting the simulated image can have a higher recognition rate.
Exemplary simulation methods of the solar radiation blocking effect and the surface irregularity effect are described below, respectively.
Fig. 5A is an exemplary flow chart of a sunlit blocking effect simulation method according to some embodiments of the invention. As shown in fig. 5A, the sunlight-blocking effect simulation method of this embodiment includes steps S502 to S504.
In step S502, the synthesized image is randomly divided into two parts.
In some embodiments, a line may be generated according to the randomly generated direction and the randomly designated point in the image, and the generated line may be used to divide the synthesized image into two parts. Other types of dividing lines may be used for dividing according to needs, such as curves, broken lines, and the like, which are not described herein again.
In step S504, the brightness of at least one of the two portions is adjusted so that the two portions have different brightness, and a simulated image is generated.
Therefore, the effect that half of the character to be recognized is shielded and half of the character to be recognized is exposed to the sun can be simulated. An exemplary simulated image generated by this embodiment may be referred to in FIG. 5B. In fig. 5B, the luminance of the diagonal filled portion is lower than that of the blank portion.
Fig. 6A is an exemplary flow chart of a method for simulating the effect of sunlight on a concave-convex surface, according to some embodiments of the present invention, which simulate the effect of vertical bar-shaped concave-convex like a container surface. As shown in fig. 6A, the simulation method of the sunlight irradiation uneven surface effect of the embodiment includes steps S602 to S604.
In step S602, one or more sets of concave-convex effect regions are set in the synthesized image at a preset pitch. The concave-convex effect area comprises a bright part area with a preset first width and a dark part area with a preset second width, and the heights of the bright part area and the dark part area are equal to the image height. There may be a certain interval between the light area and the dark area.
In some embodiments, a range of pitches may be preset, and a value is randomly selected from the range of pitches as the concave-convex pitch in the analog image each time the analog image is generated.
In step S604, the brightness of the bright area is increased and the brightness of the dark area is decreased, thereby generating a simulation image.
The brightness of the area outside the bright area and the dark area is between the brightness of the bright area and the dark area, so that the generated simulation image can simulate the effect of surface unevenness under the condition of irradiation of sunlight. An exemplary simulated image generated by this embodiment may be referred to in fig. 6B. In fig. 6B, the diagonally filled portion is a dark portion region, the blank portion is a light portion region, and the dot-filled portion is a region other than the light portion region and the dark portion region.
An embodiment of the analog image generating apparatus of the present invention is described below with reference to fig. 7.
FIG. 7 is an exemplary block diagram of a simulated image generation apparatus according to some embodiments of the invention. As shown in fig. 7, the analog image generating apparatus 70 of this embodiment includes: an analog number generation module 710 configured to generate an analog number according to a preset number generation rule; a number simulation image generation module 720 configured to generate a number simulation image according to the simulation number and the selected number style; and a simulation image generating module 730 configured to generate a simulation image according to a synthesis result of the number simulation image and the generated background simulation image.
In some embodiments, the analog number generation module 710 may be further configured to: randomly selecting a group of main codes from a main code base, wherein the main code base is obtained by counting the main codes in the real container numbers; randomly generating a number with a preset digit; generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number; an analog number is generated that includes a main code, fixed letters, generated digits, and a check code.
In some embodiments, the number style may include at least one of a number color and a number font.
In some embodiments, the number simulation image generation module 720 may be further configured to: randomly selecting number fonts from a font library and randomly selecting number colors from a color library; acquiring a character image corresponding to each character in the analog number from a character image library corresponding to the number font selected randomly; setting characters in the character image as number colors, and adding an outer frame for the last character in the analog number, wherein the color of the outer frame is the number color; and splicing the character images to obtain a number simulation image.
In some embodiments, the analog image generating device 70 may further include: and a background simulation image generation module 740 configured to randomly select a background color from a color library, and generate a background simulation image filled with the background color, wherein the color library is obtained by counting the colors of real container bodies.
In some embodiments, the simulated image generation module 730 may be further configured to: dividing the synthesized image into a plurality of areas; and adjusting the brightness of at least one of the plurality of regions to generate a simulated image.
In some embodiments, the simulated image generation module 730 may be further configured to: setting one or more groups of concave-convex effect areas in the synthesized image at a preset interval, wherein the concave-convex effect areas comprise a bright part area with a preset first width and a dark part area with a preset second width, and the heights of the bright part area and the dark part area are equal to the height of the image; the brightness of the bright area is increased and the brightness of the dark area is decreased to generate a simulation image.
In some embodiments, the simulated image generation module 730 may be further configured to add random noise to the synthesized image, generating a simulated image.
FIG. 8 is an exemplary block diagram of an analog image generation device according to further embodiments of the present invention. As shown in fig. 8, the analog image generating apparatus 800 of this embodiment includes: a memory 810 and a processor 820 coupled to the memory 810, the processor 820 being configured to execute the simulated image generation method of any of the preceding embodiments based on instructions stored in the memory 810.
FIG. 9 is an exemplary block diagram of a simulated image generation apparatus according to further embodiments of the invention. As shown in fig. 9, the analog image generating apparatus 900 of this embodiment includes: the memory 910 and the processor 920 may further include an input/output interface 930, a network interface 940, a storage interface 950, and the like. These interfaces 930, 940, 950 and the memory 910 and the processor 920 may be connected, for example, by a bus 960. The input/output interface 930 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 940 provides a connection interface for various networking devices. The storage interface 950 provides a connection interface for external storage devices such as an SD card and a usb disk.
An embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, wherein the program is configured to implement any one of the above-mentioned simulated image generation methods when executed by a processor.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (14)
1. A simulated image generation method comprising:
generating an analog number according to a preset number generation rule;
generating a number simulation image according to the simulation number and the selected number style;
generating a simulation image according to a synthesis result of the number simulation image and the generated background simulation image, wherein the simulation image comprises: setting one or more groups of concave-convex effect areas in the synthesized image at a preset interval, wherein the concave-convex effect areas comprise a bright part area with a preset first width and a dark part area with a preset second width, and the heights of the bright part area and the dark part area are equal to the height of the image; the brightness of the bright area is increased and the brightness of the dark area is decreased to generate a simulation image.
2. The simulated image generation method according to claim 1, wherein said generating a simulated number according to a preset number generation rule comprises:
randomly selecting a group of main codes from a main code base, wherein the main code base is obtained by counting the main codes in real container numbers;
randomly generating a number with a preset digit;
generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number;
an analog number is generated that includes a main code, fixed letters, generated digits, and a check code.
3. The analog image generation method according to claim 1 or 2, wherein the number pattern includes at least one of a number color and a number font.
4. The simulated image generation method according to claim 1 or 2, wherein said generating a number simulated image from said simulated number and said selected number pattern comprises:
randomly selecting number fonts from a font library and randomly selecting number colors from a color library;
acquiring a character image corresponding to each character in the analog number from a character image library corresponding to a randomly selected number font;
setting characters in a character image as the number color, and adding an outer frame for the last character in the analog number, wherein the color of the outer frame is the number color;
and splicing the character images to obtain a number simulation image.
5. The simulated image generation method of claim 1, further comprising:
randomly selecting a background color from a color library, and generating a background simulation image filled with the background color, wherein the color library is obtained by counting the colors of real container bodies.
6. The analog image generation method according to claim 1, wherein the generating of the analog image from a result of synthesizing the number analog image and the generated background analog image includes:
random noise is added to the synthesized image, and a simulation image is generated.
7. A simulated image generation apparatus comprising:
the simulation number generation module is configured to generate a simulation number according to a preset number generation rule;
a number simulation image generation module configured to generate a number simulation image according to the simulation number and the selected number style;
a simulation image generation module configured to generate a simulation image according to a synthesis result of the number simulation image and the generated background simulation image, including: setting one or more groups of concave-convex effect areas in the synthesized image at a preset interval, wherein the concave-convex effect areas comprise a bright part area with a preset first width and a dark part area with a preset second width, and the heights of the bright part area and the dark part area are equal to the height of the image; the brightness of the bright area is increased and the brightness of the dark area is decreased to generate a simulation image.
8. The simulated image generation apparatus of claim 7, wherein the simulated number generation module is further configured to: randomly selecting a group of main codes from a main code base, wherein the main code base is obtained by counting the main codes in real container numbers; randomly generating a number with a preset digit; generating a check code according to the main code, the fixed letter, the generated number and the check rule of the container number; an analog number is generated that includes a main code, fixed letters, generated digits, and a check code.
9. The analog image generating device according to claim 7 or 8, wherein the number pattern includes at least one of a number color and a number font.
10. The analog image generation device of claim 7 or 8, wherein the number analog image generation module is further configured to: randomly selecting number fonts from a font library and randomly selecting number colors from a color library; acquiring a character image corresponding to each character in the analog number from a character image library corresponding to a randomly selected number font; setting characters in a character image as the number color, and adding an outer frame for the last character in the analog number, wherein the color of the outer frame is the number color; and splicing the character images to obtain a number simulation image.
11. The simulated image generation apparatus as claimed in claim 7, further comprising:
and the background simulation image generation module is configured to randomly select a background color from a color library and generate a background simulation image filled with the background color, wherein the color library is obtained by counting the colors of real container bodies.
12. The simulated image generation apparatus of claim 7 wherein the simulated image generation module is further configured to add random noise to the synthesized image to generate the simulated image.
13. A simulated image generation apparatus comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the simulated image generation method of any of claims 1-6 based on instructions stored in the memory.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the simulated image generation method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810262761.2A CN108470366B (en) | 2018-03-28 | 2018-03-28 | Method and apparatus for generating simulated image and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810262761.2A CN108470366B (en) | 2018-03-28 | 2018-03-28 | Method and apparatus for generating simulated image and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108470366A CN108470366A (en) | 2018-08-31 |
CN108470366B true CN108470366B (en) | 2020-10-16 |
Family
ID=63264845
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810262761.2A Active CN108470366B (en) | 2018-03-28 | 2018-03-28 | Method and apparatus for generating simulated image and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108470366B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110246197B (en) * | 2019-05-21 | 2023-12-26 | 北京奇艺世纪科技有限公司 | Verification codeword generation method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101923702A (en) * | 2010-08-25 | 2010-12-22 | 郝红卫 | Image valid code generating method |
CN103679208A (en) * | 2013-11-27 | 2014-03-26 | 北京中科模识科技有限公司 | Broadcast and television caption recognition based automatic training data generation and deep learning method |
CN104899571A (en) * | 2015-06-12 | 2015-09-09 | 成都数联铭品科技有限公司 | Random sample generation method for recognition of complex character |
CN106548184A (en) * | 2016-11-07 | 2017-03-29 | 乐视控股(北京)有限公司 | A kind of method and apparatus of adjustment illumination balance |
CN107423732A (en) * | 2017-07-26 | 2017-12-01 | 大连交通大学 | Vehicle VIN recognition methods based on Android platform |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6324020B1 (en) * | 1999-08-04 | 2001-11-27 | Secugen Corporation | Method and apparatus for reduction of trapezoidal distortion and improvement of image sharpness in an optical image capturing system |
JP4750444B2 (en) * | 2005-03-24 | 2011-08-17 | 株式会社日立ハイテクノロジーズ | Appearance inspection method and apparatus |
EP2262224B1 (en) * | 2009-06-05 | 2012-08-22 | Canon Kabushiki Kaisha | Recording-medium imaging device and image forming apparatus |
CN102024144A (en) * | 2010-11-23 | 2011-04-20 | 上海海事大学 | Container number identification method |
CN106681850B (en) * | 2016-12-06 | 2019-11-26 | 北京中交兴路信息科技有限公司 | A kind of vehicle model method of calibration and device |
CN107832767A (en) * | 2017-11-14 | 2018-03-23 | 深圳码隆科技有限公司 | Container number identification method, device and electronic equipment |
-
2018
- 2018-03-28 CN CN201810262761.2A patent/CN108470366B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101923702A (en) * | 2010-08-25 | 2010-12-22 | 郝红卫 | Image valid code generating method |
CN103679208A (en) * | 2013-11-27 | 2014-03-26 | 北京中科模识科技有限公司 | Broadcast and television caption recognition based automatic training data generation and deep learning method |
CN104899571A (en) * | 2015-06-12 | 2015-09-09 | 成都数联铭品科技有限公司 | Random sample generation method for recognition of complex character |
CN106548184A (en) * | 2016-11-07 | 2017-03-29 | 乐视控股(北京)有限公司 | A kind of method and apparatus of adjustment illumination balance |
CN107423732A (en) * | 2017-07-26 | 2017-12-01 | 大连交通大学 | Vehicle VIN recognition methods based on Android platform |
Also Published As
Publication number | Publication date |
---|---|
CN108470366A (en) | 2018-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105488515B (en) | The image processing method and image processing apparatus that a kind of pair of image is classified | |
JP6483221B2 (en) | 3D code generation method | |
CN108921152B (en) | English character segmentation method and device based on object detection network | |
CN108108751A (en) | A kind of scene recognition method based on convolution multiple features and depth random forest | |
CN108230243B (en) | Background blurring method based on salient region detection model | |
CN106874818B (en) | A kind of Digital Object Unique Identifier DOI recognition methods and device | |
CN106202086A (en) | A kind of picture processing, acquisition methods, Apparatus and system | |
CN112926565B (en) | Picture text recognition method, system, equipment and storage medium | |
US20230033319A1 (en) | Method, apparatus and device for processing shadow texture, computer-readable storage medium, and program product | |
CN103235947A (en) | Handwriting digital recognition method and device | |
CN108470366B (en) | Method and apparatus for generating simulated image and computer readable storage medium | |
CN113012068A (en) | Image denoising method and device, electronic equipment and computer readable storage medium | |
Han et al. | An enhanced image binarization method incorporating with Monte-Carlo simulation | |
Wong et al. | Thinning algorithms based on quadtree and octree representations | |
CN102073871A (en) | Off-line Chinese character identification method on basis of non-negative matrix factorization | |
CN112883102B (en) | Method and device for visual display of data, electronic equipment and storage medium | |
CN114359269A (en) | Virtual food box defect generation method and system based on neural network | |
CN114201161A (en) | Module division method for graphical programming | |
CN116822548B (en) | Method for generating high recognition rate AI two-dimensional code and computer readable storage medium | |
CN111597845A (en) | Two-dimensional code detection method, device and equipment and readable storage medium | |
US11568586B2 (en) | System and method for tracing polygons in design files | |
CN111476524B (en) | Goods picking method, system, device and readable storage medium for finished product delivery based on artificial intelligence | |
CN108073964B (en) | Perspective two-dimensional code generation method and device | |
CN115345895B (en) | Image segmentation method and device for visual detection, computer equipment and medium | |
CN111508045B (en) | Picture synthesis method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |