WO2023001112A1 - Text beautification method and apparatus, and readable storage medium and electronic device - Google Patents
Text beautification method and apparatus, and readable storage medium and electronic device Download PDFInfo
- Publication number
- WO2023001112A1 WO2023001112A1 PCT/CN2022/106276 CN2022106276W WO2023001112A1 WO 2023001112 A1 WO2023001112 A1 WO 2023001112A1 CN 2022106276 W CN2022106276 W CN 2022106276W WO 2023001112 A1 WO2023001112 A1 WO 2023001112A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- character
- images
- word
- beautification
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000012545 processing Methods 0.000 claims abstract description 135
- 238000004891 communication Methods 0.000 claims abstract description 9
- 230000002194 synthesizing effect Effects 0.000 claims abstract 2
- 238000003062 neural network model Methods 0.000 claims description 24
- 230000015572 biosynthetic process Effects 0.000 claims description 21
- 238000003786 synthesis reaction Methods 0.000 claims description 21
- 238000012549 training Methods 0.000 claims description 18
- 238000010606 normalization Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims 2
- 239000002131 composite material Substances 0.000 claims 1
- 230000000694 effects Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 238000013527 convolutional neural network Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241000699670 Mus sp. Species 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000003205 fragrance Substances 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
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
Definitions
- the present application belongs to the technical field of communication, and in particular relates to a text beautification method, device, readable storage medium and electronic equipment.
- electronic devices can process text in images (specifically, text in image format, hereinafter referred to as text images) through word processing tools. Specifically, the electronic device can adjust the size of the text image and the position of the text image in the image through a word processing tool.
- the electronic device processes the text in the image by adjusting the size and/or position of the text image, the effect of processing the text image in the image is poor.
- the purpose of the embodiments of the present application is to provide a text beautification method, device, readable storage medium and electronic equipment, which can solve the problem of poor processing effect on text images in images.
- the embodiment of the present application provides a text beautification method, the method includes: performing text recognition on the first image, determining M image areas, each of which includes a character; according to the M image areas, Carry out image processing to the first image, obtain M first single-character images, each first single-character image corresponds to an image area; perform font beautification processing on the M first single-character images, obtain M second single-character images, font beautification
- the processing includes at least one of the following: font frame structure processing, font style processing; combining the M second word images with the original background image of the first image to obtain a second image.
- the embodiment of the present application provides a text beautification device, which may include: a recognition module, a processing module, and a synthesis module; a recognition module, used to perform text recognition on the first image; a processing module, used to Determine M image regions in the first image according to the recognition result of the recognition module, and each image region includes a character; the processing module is also used to perform image processing on the first image according to the M image regions to obtain M The first single-character image, each first single-character image corresponds to an image area; the processing module is also used to perform font beautification processing on the M first single-character images to obtain M second single-character images, and the font beautification processing includes at least one of the following Item: font frame structure processing, font style processing; synthesis module, used to synthesize the M second word images processed by the processing module with the original background image of the first image to obtain the second image.
- a recognition module used to perform text recognition on the first image
- a processing module used to Determine M image regions in the first image according to the recognition result
- the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is executed by the processor to realize As the steps of the method of the first aspect.
- an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method in the first aspect are implemented.
- the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method in the first aspect.
- text recognition can be performed on the first image, and M image regions are determined, and each image region includes a character; according to the M image regions, image processing is performed on the first image to obtain M first A single character image, each first single character image corresponds to an image area; font beautification processing is performed on the M first single character images to obtain M second single character images, and the font beautification processing includes at least one of the following: frame structure processing between fonts, Font style processing: combining the M second word images with the original background image of the first image to obtain a second image.
- the font beautification process (specifically at least one of font frame structure processing and font style processing) can be carried out to the single-character image in an image (such as the first image), it can ensure that the handwriting of the adjusted single-character image It is more aesthetically pleasing, thus improving the effect of beautifying the text images in the image.
- FIG. 1 is a schematic diagram of a text beautification method provided in an embodiment of the present application
- Fig. 2 is one of the schematic flow charts of processing single-character images using the text beautification method provided by the embodiment of the present application;
- FIG. 3 is the second schematic flow diagram of processing single-character images using the text beautification method provided by the embodiment of the present application.
- FIG. 4 is a schematic diagram of obtaining an original background image by processing a reference image in an embodiment of the present application
- Fig. 5 is a schematic diagram of determining a fitted straight line in units of text lines
- FIG. 6 is a schematic diagram of the effect of processing single-character images using the text beautification method provided in the embodiment of the present application.
- FIG. 7 is the third schematic flow diagram of processing single-character images using the text beautification method provided by the embodiment of the present application.
- FIG. 8 is a schematic diagram of a text beautification device provided in an embodiment of the present application.
- FIG. 9 is a schematic diagram of an electronic device provided by an embodiment of the present application.
- FIG. 10 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.
- the text beautification method provided in the embodiment of the present application can be applied to the scene of beautifying handwritten text.
- text recognition can be performed on the first image, M image areas are determined, and each image area includes a character; image processing is performed on the first image according to the M image areas , obtain M first word images, and each first word image corresponds to an image area; carry out font beautification processing to the M first word images, obtain M second word images, and font beautification processing includes at least one of the following: Font frame structure processing and font style processing; combining the M second word images with the original background image of the first image to obtain a second image.
- the font beautification process (specifically at least one of font frame structure processing and font style processing) can be carried out to the single-character image in an image (such as the first image), it can ensure that the handwriting of the adjusted single-character image It is more aesthetically pleasing, thus improving the effect of beautifying the text images in the image.
- FIG. 1 shows a flow chart of the font beautification method provided in the embodiment of the present application.
- the text beautification method provided by the embodiment of the present application may include the following steps 101 to 104 .
- the following takes an electronic device executing the method as an example for illustration.
- Step 101 the electronic device performs text recognition on the first image, and determines M image areas in the first image.
- each of the above M image areas includes a character.
- the characters can be Chinese characters, letters or symbols.
- the characters may be handwritten characters or printed characters, which may be determined according to actual usage requirements, and are not limited in this embodiment of the application.
- the electronic device may perform text recognition on the first image based on a text recognition technology, so as to determine the M image regions in the first image.
- the electronic device may first perform text detection on the first image to determine the first image The positions (or position information, such as coordinate information) of the M image regions in .
- the electronic device may first use the text line detection technology to detect character lines in the M image regions in the first image (for example, the character lines shown in (b) in FIG. 2 Row 20); then adopt the single word detection technology to detect the area of each character in each line area (the area 21 where the word "wine” is located as shown in (c) in Figure 2).
- Step 102 The electronic device performs image processing on the first image according to the M image regions to obtain M first single-character images.
- each first word image in the M first word images corresponds to one image area in the M image areas. That is, there is a one-to-one correspondence between the M image regions and the M first word images.
- the electronic device may crop the first image according to M image regions, so as to obtain M first word images.
- the electronic device may copy a first image as a reference image.
- Step 103 the electronic device performs font beautification processing on the M first word images to obtain M second word images.
- the aforementioned font beautification may include at least one of the following: (1), font frame structure processing, (2), font style processing.
- step 103 may specifically be implemented through the following step 103a.
- Step 103a Based on the font beautification parameters, the electronic device performs font beautification processing on each of the M first individual character images to obtain a second individual character image corresponding to each first individual character image.
- the above-mentioned font beautification parameters are parameters obtained by training a neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
- the stroke structure of the beautified word image is more compact and coordinated than the stroke structure of the word image to be beautified.
- the above font beautification parameters may be parameters of a font beautification model.
- the font beautification model is obtained by training the convolutional neural network model by using the above-mentioned large number of single-character image pairs; the font beautification model can be used to beautify at least one of the stroke structure and font style of the single-character image.
- each single-character image pair includes a single-character image to be beautified, and a single-character image after adjusting the stroke structure and/or font style of the single-character image (ie, the beautified single-character image). And the beautified word image in each word image pair is used as the label of the word image pair.
- each layer parameter (weight value and bias) of neural network model is carried out random initialization; And to the individual word image pair in training set, each batch comprises N individual word image pair, and N is a positive integer.
- the neural network model after initializing the input of the first batch of single character images in the training set.
- the N single-character images to be beautified in the first batch of single-character image pairs are respectively weighted with the weights of the first layer, and the bias term is added
- use the ReLu function to activate to obtain N first result images use the N first result images as the input of the second layer of the neural network model, and compare the N first result images with the weights of the second layer respectively Weighting operation, and adding bias items and using the ReLu function to activate to obtain N second result images; then use N second result images as the input of the third layer of the neural network model, and repeat this until the obtained neural network model
- the N jth result images processed by the last layer of , j (indicating that the neural network model includes j layers) is a positive integer.
- the neural network model that has completed the above training is the font beautification model in the present application.
- the font beautification parameters mentioned above are the parameters of each layer in the trained neural network model.
- the above neural network model may be a convolutional neural network model, or any other neural network model with learning capability, which may be determined according to actual usage requirements, and is not limited in the embodiment of the present application.
- the word images to be beautified in the above training set may be manually handwritten, or the word images to be beautified in the training set may be randomly perturbed by an electronic device to a beautified word image (that is, " uglify”) get.
- the electronic device performs font beautification processing on the i-th first word image among the M first word images based on the font beautification parameters, and obtains the i-th word image corresponding to the i-th first word image.
- the electronic device can perform font beautification processing on the i+1 first word image in the M first word images based on the font beautification parameter, and obtain the first word image corresponding to the i+1 first word image
- the corresponding i+1th second word image and so on, after the electronic device performs font beautification processing on the M first word image in the M first word images based on the font beautification parameters, it can be obtained.
- the Mth second word image corresponding to the first word image. That is, after the electronic device executes the above step 103a M times, M second single-character images can be obtained.
- the electronic device performs font beautification processing on each of the M first word images based on the font beautification parameters, and obtains a second word image corresponding to each first word image, specifically It may be: each first individual character image is sequentially input into the font beautification model for processing, and a second individual character image corresponding to each first individual character image is obtained.
- the electronic device may input a first character image (for example, the character image 30 in FIG. 3 ) into the font beautification model, and
- the first word image and the weights and bias values (i.e. font beautification parameters) of each layer of the font beautification model (such as the font beautification model 22 in Fig. 3) are calculated, and the activation calculation is performed, and then the font beautification model can output the same
- the font beautification image corresponding to the first word image is the second word image corresponding to the first word image (such as the word image 31 in FIG. 3 ).
- inputting a single-character image into the font beautification model for processing is essentially processing the single-character image by using the network parameters (ie, font beautification parameters) of each layer of the font beautification model.
- the font beautification process can be performed on the first single-character image based on the font beautification parameters obtained by training the neural network model through a large number of single-character image pairs, the author's original writing can be preserved while the handwriting beautification is realized. style and personality.
- the stroke structure and/or font style of a single character image i.e. the first single-character image
- Step 104 the electronic device synthesizes the M second word images and the original background image of the first image to obtain a second image.
- the electronic device can erase the characters in the above-mentioned reference image 40 through text erasing technology to obtain the original background as shown in FIG. 4 Image 41.
- the electronic device may use images other than the M image areas in the first image as the original background image, which may be determined according to actual usage requirements, and is not limited in this embodiment of the present application.
- the combined positions of the M second word images in the background image are determined according to the positions of the M image regions in the first image.
- step 104 may be specifically implemented through the following steps 104a and 104b.
- Step 104a the electronic device determines the second position information according to the first position information of the M image areas in the first image, and the second position information is used to indicate the composition position of the M second word images in the original background image.
- step 104b the electronic device synthesizes the M second word images and the background image according to the second location information to obtain a third image.
- the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold
- the first arrangement is the arrangement of M second single-character images in the third image
- the second arrangement is the arrangement of the M image regions in the first image.
- the first position information is used to indicate the positions of the M image regions in the first image.
- the first image and the original background image are in the same coordinate system, and the position information (such as coordinate information) of the first image and the original background image in the coordinate system is the same, for example, assuming that the first image
- the coordinate information is: (x1, y1), (x2, y2), (x3, y3), (x4, y4), and the coordinate information of the original background image is also: (x1, y1), (x2, y2), ( x3, y3), (x4, y4); then:
- the electronic device may use the first position information as the second position information.
- the combined positions of the M second word images in the original background image and the positions of the M image areas in the first image area are the same, that is, the positions of the characters in the image remain unchanged before and after the beautification process.
- the electronic device may divide the M image regions into at least one unit according to the distribution of the M image regions in the first image during synthesis, and each unit It is a character row or a character column, and the position information (ie, the first position information) of the M image areas is fine-tuned in units of units, and the fine-tuned position information is used as the second position information, so that it can be compared with a single
- the synthesis positions of the second word images corresponding to the image area groups in the original background image are arranged on a straight line as much as possible.
- the method for fine-tuning the position information of M image regions by an electronic device is exemplarily described below by taking a unit as an example of a character line.
- the electronic device calculates the location information of the central points of the M image areas in the first image (the location information 50 shown in FIG. 5 ), and obtains M pieces of location information (ie, the first location information).
- the electronic device divides the M image areas into at least one character line according to the distribution of the M image areas in the first image, and fits the position information of the image area in each character line into A straight line (the straight line 51 shown in FIG. 5). It should be noted that, in the embodiment of the present application, the number of straight lines determined by the electronic device is the same as the number of character lines.
- a character row (hereinafter referred to as character row o) includes u (u is an integer greater than 1) image areas (that is, u characters), and according to the position information of the u characters
- the determined straight line is the first straight line
- the electronic device can use the projection position of the center point of the leftmost image area of the character row o on the first straight line as the starting point of the composition; it will be located at the rightmost of the character row o
- the position information of the composition position of the u second word images in the original background image includes: the position information of the composition start point, the position information of the composition end point, and the position information between the composition start point and the composition end point with an interval of d Location information of u - 2 locations. It should be noted that, in the embodiment of the present application, the electronic device may obtain the second position information after performing the above step iii on the image area in each character row.
- the row coordinate (ie, the X-axis coordinate) and the column coordinate (ie, the Y-axis coordinate) of the position information of the image area in each character row are fine-tuned as follows:
- An example is used for illustrative purposes. In actual implementation, at least one of the row coordinates and the column coordinates of the position information of the image area may be adjusted.
- the electronic device may use the original position of the leftmost image area in a character line in the first image as the compositing starting point, Paste the second single-character image corresponding to the image area in the character row to the second image in order from left to right, and these single-character images maintain the same gap in the horizontal direction (ie, the average pasting gap d). i.e. only the row coordinates are adjusted.
- the embodiment of the present application provides users with a method for beautifying the handwriting (font frame structure and font style) of the characters in the image.
- Using the text beautification method provided in the embodiment of the present application can not only beautify the handwriting in the image , and can standardize the typesetting effect of the text in the image, which can improve the look and feel of the (handwritten) text in the image.
- the electronic device since the electronic device can fine-tune the typesetting of the M second single-character images, it can ensure that the typesetting of the M second single-character images in the second image is more neat and beautiful.
- the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
- the electronic device may adjust the size of the M second single-character images to reduce the size difference between characters, so that the M The typesetting of the second word image is visually more neat.
- the font beautification method provided in the embodiment of the present application further includes the following steps 105 and 106.
- Step 105 the electronic device divides the M second single-character images into at least one image group according to the distribution of the M image areas in the first image.
- each image group in the at least one image group includes at least one second single-character image.
- the M image areas in the first image, the M first word images, and the M second word images correspond one-to-one, it can be determined according to the area where the M image areas are located in the first image , grouping the M second single-character images to obtain H groups, where H is a positive integer.
- H is a positive integer.
- grouping can also be performed according to the size of the second individual character images, for example, if the size of 2 second individual character images in the M second individual character images is greater than 2 square centimeters, among the M second individual character images The size of the three second single-character images is less than or equal to 2 square centimeters, then: the two second single-character images form one group, and the three second single-character images form another group.
- Step 106 the electronic device performs size normalization processing on the second single-character images in at least one image group by taking the image group as a unit, and obtains M second single-character images after normalization processing.
- the foregoing step 106 may specifically be implemented through the following steps 106a and 106b, or may be implemented through the following steps 106a and 106c.
- Step 106a for each of the M second single-character images, determine a first difference between the size of a second single-character image and the target size.
- the target size may be the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which the above-mentioned second single-character image belongs.
- the electronic device can calculate the median of the width values of the second word images in the first image group (hereinafter referred to as the width median), and calculate the height of all the second word images in a group The median of the values (hereafter referred to as the median height), and use the median width and median height as the target size.
- the electronic device may first determine the first difference between the size of the second single-character image and the target size; if the first difference is less than or is equal to the preset difference, then the electronic device may execute step 106b below, and if the first difference is greater than the preset difference, then the electronic device may execute step 106c below. It should be noted that, in the embodiment of the present application, after the electronic device executes the process M times, the normalized M second single-character images can be obtained.
- Step 106b the electronic device adjusts the size of a second word image to the first size.
- the difference between the first size and the target size is smaller than the first difference, for example, the second difference may be 0.
- Step 106c the electronic device keeps the size of a second single character image unchanged.
- the first size: width*height a1*b1
- the second size: width*height a2*b2
- a2 (1 ⁇ k)*a1
- b2 (1 ⁇ w)*b1
- a1, a2, b1, b2 are numbers greater than 0
- k is greater than 0 and less than the median width
- w is greater than 0 and less than or equal to the median height.
- the median width can be 0.2
- the median height can be 0.2.
- the first preset value and the second preset value can also be different.
- the electronic device can adjust the size of the second single-character image from the first size to the second size, so that the size of the second single-character image is closer to the target size move closer. If the difference between the first size and the target size (i.e. the first difference) is greater than the target preset value, the electronic device keeps the size of the second single-character image unchanged to keep the size characteristics of the second single-character image .
- the size of the M second single-character images can be moved closer to the target size, the size difference between different second single-character images can be reduced, so that the typesetting of the M second single-character images can be visually more tidy.
- the M first The size of the word image is adjusted.
- the font beautification method provided in the embodiment of the present application may further include the following step 107.
- Step 107 the electronic device performs normalization processing on the M first word images.
- the size of each first word image after normalization processing is within a preset size range.
- the preset size range is in line with the image processing size requirements
- the size of a single-character image may be the side length and/or area of the single-character image.
- the size of a single-character image if the size of a single-character image is within the preset size range, it means that the size of the single-character image meets the image processing size requirements; if the size of a single-character image is outside the preset size range, it means that the size of the single-character image Does not meet image processing size requirements.
- the electronic device normalizes the individual character images detected from the character row one by one (for example, in the order from “small” to "diameter”) to a preset size range , and then input it into the font beautification model for processing to obtain the processed "Small Garden Fragrant Path Lonely Wandering".
- the success rate of processing the word image to be beautified can be ensured.
- the embodiment of the present application provides a text beautification device 80
- the text beautification device 80 may include: a recognition module 81, a processing module 82 and a synthesis module 83;
- the recognition module 81 is used to perform text processing on the first image Recognition;
- the processing module 82 is used to determine M image regions in the first image according to the recognition result of the recognition module 81, and each image region includes a character;
- the processing module 82 is also used to determine the M image regions according to the M image regions Perform image processing on an image to obtain M first word images, and each first word image corresponds to an image area;
- the processing module 82 is also used to perform font beautification processing on the M first word images to obtain M second word images
- the font beautification process includes at least one of the following: frame structure processing between fonts, font style processing; synthesis module 83, used to synthesize M second word images obtained by processing module 82 with the original background image of the first image, to obtain second image.
- the above-mentioned processing module 82 is specifically configured to perform font beautification processing on each first individual character image based on font beautification parameters, to obtain a second individual character image corresponding to each first individual character image.
- the font beautification parameters are parameters obtained by training the neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
- the above-mentioned processing module 82 is also used to synthesize the M second word images with the original background image of the first image in the synthesis module 83 to obtain the second image, according to the M image regions at the first According to the distribution situation in an image, the M second single-character images are divided into at least one image group; and taking the image group as a unit, the second single-character images in at least one image group are subjected to size normalization processing to obtain normalization The processed M second word images.
- the above-mentioned processing module 82 is specifically configured to, for each second single-character image in the M second single-character images, when the first difference between the size of a second single-character image and the target size is less than or When it is equal to the preset difference, the size of a second single character image is adjusted to the first size, and the difference between the first size and the target size is less than the first difference; or, the processing module 82 is specifically used for M For each second single-character image in the second single-character image, when the first difference between the size of the second single-character image and the target size is greater than the preset difference, the size of the second single-character image remains unchanged.
- the target size is the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which a second single-character image belongs.
- the synthesis module 83 includes a determination sub-module and a synthesis sub-module; the determination sub-module is configured to determine the second position information according to the first position information of the M image regions in the first image, the second The second position information is used to indicate the synthesis position of the M second single-character images in the original background image; the synthesis submodule is used to synthesize the M second single-character images and the background image according to the second position information determined by the determination sub-module, Get the third image.
- the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold
- the first arrangement is the arrangement of M second single-character images in the third image
- the second arrangement is the arrangement of the M image regions in the first image.
- the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
- the text beautification in this embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal.
- the device may be a mobile electronic device or a non-mobile electronic device.
- the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
- non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
- Network Attached Storage NAS
- personal computer personal computer, PC
- television television
- teller machine or self-service machine etc.
- the text beautifying device in the embodiment of the present application may be a device with an operating system.
- the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
- the text beautifying device provided in the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 6 , and details are not repeated here to avoid repetition.
- the embodiment of the present application also provides an electronic device 200, including a processor 202, a memory 201, a program or instruction stored in the memory 201 and operable on the processor 202, the program or instruction is processed When executed by the device 202, each process of the above text beautification method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
- the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
- FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
- the electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010, etc. part.
- the electronic device 1000 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1010 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
- a power supply such as a battery
- the structure of the electronic device shown in FIG. 10 does not constitute a limitation to the electronic device.
- the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
- the processor 1010 is configured to perform text recognition on the first image; and determine M image areas in the first image, each image area includes a character; and perform image processing on the first image to obtain M number A single-character image, each first single-character image corresponds to an image area; and performing font beautification processing on M first single-character images to obtain M second single-character images, font beautification processing includes at least one of the following: frame structure processing between fonts, Font style processing; the processor 1010 is configured to combine the M second word images obtained by the processor 1010 with the original background image of the first image to obtain a second image.
- the above-mentioned processor 1010 is specifically configured to perform font beautification processing on each first individual character image based on font beautification parameters, to obtain a second individual character image corresponding to each first individual character image.
- the font beautification parameters are parameters obtained by training the neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
- the above-mentioned processor 1010 is further configured to combine the M second word images with the original background image of the first image to obtain the second image, according to the M image regions in the first image
- the distribution of the M second single-character images is divided into at least one image group; and taking the image group as a unit, the size normalization process is carried out to the second single-character images in at least one image group to obtain the normalized M second word images.
- the above-mentioned processor 1010 is specifically configured to, for each second single-character image in the M second single-character images, when the first difference between the size of a second single-character image and the target size is less than or When it is equal to the preset difference, adjust the size of a second single-character image to the first size, and the difference between the first size and the target size is less than the first difference; or, the processor 1010 is specifically used for M For each second single-character image in the second single-character image, when the first difference between the size of the second single-character image and the target size is greater than the preset difference, the size of the second single-character image remains unchanged.
- the target size is the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which a second single-character image belongs.
- the processor 1010 is configured to determine the second position information according to the first position information of the M image regions in the first image, and the second position information is used to indicate that the M second word images are in Compositing positions in the original background image; and according to the determined second position information, compositing M second word images with the background image to obtain a third image.
- the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold
- the first arrangement is the arrangement of M second single-character images in the third image
- the second arrangement is the arrangement of the M image regions in the first image.
- the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
- the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
- the display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
- the user input unit 1007 includes a touch panel 10071 and other input devices 10072 .
- the touch panel 10071 is also called a touch screen.
- the touch panel 10071 may include two parts, a touch detection device and a touch controller.
- Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
- the memory 1009 can be used to store software programs as well as various data, including but not limited to application programs and operating systems.
- the processor 1010 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1010 .
- the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of the above text beautification method embodiment can be achieved, and the same Technical effects, in order to avoid repetition, will not be repeated here.
- the above-mentioned processor is the processor in the electronic device in the above-mentioned embodiment.
- the above-mentioned readable storage medium includes a computer readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
- the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to realize the various processes of the above text beautification method embodiments, and can achieve the same To avoid repetition, the technical effects will not be repeated here.
- chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
- the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
- the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The present application belongs to the technical field of communications. Disclosed are a text beautification method and apparatus, and a readable storage medium and an electronic device. The method comprises: performing text recognition on a first image, so as to determine M image regions in the first image, wherein each image region comprises one character; according to the M image regions, performing image processing on the first image, so as to obtain M first single-character images, wherein each first single-character image corresponds to one image region; performing font beautification processing on the M first single-character images, so as to obtain M second single-character images, wherein the font beautification processing comprises at least one of the following: font frame structure processing and font style processing; and synthesizing the M second single-character images with an original background image of the first image, so as to obtain a second image.
Description
相关申请的交叉引用Cross References to Related Applications
本申请主张在2021年07月19日在中国提交的中国专利申请号202110815639.5的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202110815639.5 filed in China on July 19, 2021, the entire contents of which are hereby incorporated by reference.
本申请属于通信技术领域,具体涉及一种文字美化方法、装置、可读存储介质和电子设备。The present application belongs to the technical field of communication, and in particular relates to a text beautification method, device, readable storage medium and electronic equipment.
随着电子设备的发展,电子设备的功能越来越丰富,例如电子设备可以通过文字处理工具对图像中的文字(具体为图像格式的文字,以下称为文字图像)进行处理。具体的,电子设备可以通过文字处理工具调整文字图像的尺寸、文字图像在图像中的位置。With the development of electronic devices, the functions of electronic devices are becoming more and more abundant. For example, electronic devices can process text in images (specifically, text in image format, hereinafter referred to as text images) through word processing tools. Specifically, the electronic device can adjust the size of the text image and the position of the text image in the image through a word processing tool.
然而,由于电子设备是通过调整文字图像的尺寸和/或位置的方式对图像中的文字进行处理的,因此导致对图像中的文字图像的处理效果较差。However, since the electronic device processes the text in the image by adjusting the size and/or position of the text image, the effect of processing the text image in the image is poor.
发明内容Contents of the invention
本申请实施例的目的是提供一种文字美化方法、装置、可读存储介质和电子设备,能够解决对图像中的文字图像的处理效果较差的问题。The purpose of the embodiments of the present application is to provide a text beautification method, device, readable storage medium and electronic equipment, which can solve the problem of poor processing effect on text images in images.
第一方面,本申请实施例提供了一种文字美化方法,该方法包括:对第一图像进行文本识别,确定M个图像区域,每个图像区域中包括一个字符;根据该M个图像区域,对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;对该M个第一单字图像进行字体美化处理,得到M个第二单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;将该M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。In the first aspect, the embodiment of the present application provides a text beautification method, the method includes: performing text recognition on the first image, determining M image areas, each of which includes a character; according to the M image areas, Carry out image processing to the first image, obtain M first single-character images, each first single-character image corresponds to an image area; perform font beautification processing on the M first single-character images, obtain M second single-character images, font beautification The processing includes at least one of the following: font frame structure processing, font style processing; combining the M second word images with the original background image of the first image to obtain a second image.
第二方面,本申请实施例提供了一种文字美化装置,该文字美化装置可以包括:识别模块、处理模块和合成模块;识别模块,用于对第一图像进行文本识别;处理模块,用于根据识别模块的识别结果确定第一图像中的M个图像区域,每个图像区域中包括一个字符;处理模块,还用于根据该M个图像区域,对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;处理模块,还用于对该M个第一单字图像进行字体美化处理,得到M个第二单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;合成模块,用于将处理模块处理得到的该M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。In the second aspect, the embodiment of the present application provides a text beautification device, which may include: a recognition module, a processing module, and a synthesis module; a recognition module, used to perform text recognition on the first image; a processing module, used to Determine M image regions in the first image according to the recognition result of the recognition module, and each image region includes a character; the processing module is also used to perform image processing on the first image according to the M image regions to obtain M The first single-character image, each first single-character image corresponds to an image area; the processing module is also used to perform font beautification processing on the M first single-character images to obtain M second single-character images, and the font beautification processing includes at least one of the following Item: font frame structure processing, font style processing; synthesis module, used to synthesize the M second word images processed by the processing module with the original background image of the first image to obtain the second image.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器 及存储在存储器上并可在处理器上运行的程序或指令,该程序或指令被处理器执行时实现如第一方面的方法的步骤。In the third aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is executed by the processor to realize As the steps of the method of the first aspect.
第四方面,本申请实施例提供了一种可读存储介质,该可读存储介质上存储程序或指令,该程序或指令被处理器执行时实现如第一方面的方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method in the first aspect are implemented.
第五方面,本申请实施例提供了一种芯片,该芯片包括处理器和通信接口,该通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面的方法。In the fifth aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method in the first aspect.
在本申请实施例中,可以对第一图像进行文本识别,确定M个图像区域,每个图像区域中包括一个字符;根据该M个图像区域,对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;对该M个第一单字图像进行字体美化处理,得到M个第二单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;将该M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。通过该方案,由于可以对一个图像(例如第一图像)中的单字图像进行字体美化处理(具体为字体间架结构处理和字体风格处理中至少一项),因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的美化处理效果。In the embodiment of the present application, text recognition can be performed on the first image, and M image regions are determined, and each image region includes a character; according to the M image regions, image processing is performed on the first image to obtain M first A single character image, each first single character image corresponds to an image area; font beautification processing is performed on the M first single character images to obtain M second single character images, and the font beautification processing includes at least one of the following: frame structure processing between fonts, Font style processing: combining the M second word images with the original background image of the first image to obtain a second image. Through this scheme, since the font beautification process (specifically at least one of font frame structure processing and font style processing) can be carried out to the single-character image in an image (such as the first image), it can ensure that the handwriting of the adjusted single-character image It is more aesthetically pleasing, thus improving the effect of beautifying the text images in the image.
图1为本申请实施例提供文字美化方法的示意图;FIG. 1 is a schematic diagram of a text beautification method provided in an embodiment of the present application;
图2为采用本申请实施例提供的文字美化方法处理单字图像的流程示意图之一;Fig. 2 is one of the schematic flow charts of processing single-character images using the text beautification method provided by the embodiment of the present application;
图3为采用本申请实施例提供的文字美化方法处理单字图像的流程示意图之二;FIG. 3 is the second schematic flow diagram of processing single-character images using the text beautification method provided by the embodiment of the present application;
图4为本申请实施例中对参考图像处理得到原始背景图像的示意图;FIG. 4 is a schematic diagram of obtaining an original background image by processing a reference image in an embodiment of the present application;
图5为以文本行为单位,确定拟合直线的示意图;Fig. 5 is a schematic diagram of determining a fitted straight line in units of text lines;
图6为采用本申请实施例提供的文字美化方法处理单字图像的效果示意图;FIG. 6 is a schematic diagram of the effect of processing single-character images using the text beautification method provided in the embodiment of the present application;
图7为采用本申请实施例提供的文字美化方法处理单字图像的流程示意图之三;FIG. 7 is the third schematic flow diagram of processing single-character images using the text beautification method provided by the embodiment of the present application;
图8为本申请实施例提供的文字美化装置的示意图;FIG. 8 is a schematic diagram of a text beautification device provided in an embodiment of the present application;
图9为本申请实施例提供的电子设备的示意图;FIG. 9 is a schematic diagram of an electronic device provided by an embodiment of the present application;
图10为本申请实施例提供的电子设备的硬件示意图。FIG. 10 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”, 一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein. In addition, "and/or" in the description and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.
下面首先对本申请的权利要求书和说明书中涉及的一些名词或者术语进行解释说明。Firstly, some nouns or terms involved in the claims and description of the present application will be explained below.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的文字美化方法、装置和电子设备进行详细地说明。The text beautification method, device and electronic equipment provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.
本申请实施例提供的文字美化方法可以应用于对手写文字进行美化的场景中。The text beautification method provided in the embodiment of the present application can be applied to the scene of beautifying handwritten text.
随着计算机视觉技术的发展,图片格式的文档由于具有便于携带、复制、传输、管理、查看等特点,因而得到广泛使用,同时大量图像处理工具相继被推出,为用户提供很多便捷有效的图片编辑工具,例如可以对图像格式的文字进行处理的文字处理工具。具体的,可以通过文字处理工具在图像中添加文字、或涂抹掉图像中的文字。如此,由于目前的文字处理工具无法对图像中的文字进行字迹美化,因此导致对图像中的文字的处理效果较差。With the development of computer vision technology, documents in picture format are widely used due to their characteristics of portability, copying, transmission, management, and viewing. At the same time, a large number of image processing tools have been launched one after another, providing users with many convenient and effective picture editing Tools, such as word processing tools that can process text in image format. Specifically, words can be added to the image or erased by word processing tools. In this way, because the current word processing tools cannot perform handwriting beautification on the words in the image, the processing effect on the words in the image is poor.
在本申请实施例提供的文字美化方法中,可以对第一图像进行文本识别,确定M个图像区域,每个图像区域中包括一个字符;根据该M个图像区域,对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;对该M个第一单字图像进行字体美化处理,得到M个第二单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;将该M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。通过该方案,由于可以对一个图像(例如第一图像)中的单字图像进行字体美化处理(具体为字体间架结构处理和字体风格处理中至少一项),因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的美化处理效果。In the text beautification method provided in the embodiment of the present application, text recognition can be performed on the first image, M image areas are determined, and each image area includes a character; image processing is performed on the first image according to the M image areas , obtain M first word images, and each first word image corresponds to an image area; carry out font beautification processing to the M first word images, obtain M second word images, and font beautification processing includes at least one of the following: Font frame structure processing and font style processing; combining the M second word images with the original background image of the first image to obtain a second image. Through this scheme, since the font beautification process (specifically at least one of font frame structure processing and font style processing) can be carried out to the single-character image in an image (such as the first image), it can ensure that the handwriting of the adjusted single-character image It is more aesthetically pleasing, thus improving the effect of beautifying the text images in the image.
本申请实施例提供了一种文字美化方法,图1示出了本申请实施例提供的字体美化方法的流程图。如图1所示,本申请实施例提供的文字美化方法可以包括下述的步骤101至步骤104。下面以电子设备执行该方法为例进行示例性说明。The embodiment of the present application provides a text beautification method, and FIG. 1 shows a flow chart of the font beautification method provided in the embodiment of the present application. As shown in FIG. 1 , the text beautification method provided by the embodiment of the present application may include the following steps 101 to 104 . The following takes an electronic device executing the method as an example for illustration.
步骤101、电子设备对第一图像进行文本识别,确定第一图像中的M个图像区域。 Step 101, the electronic device performs text recognition on the first image, and determines M image areas in the first image.
其中,上述M个图像区域中的每个图像区域中包括一个字符。该字符可以为汉字、字母或符号。Wherein, each of the above M image areas includes a character. The characters can be Chinese characters, letters or symbols.
可选地,本申请实施例中,字符可以为手写字符,也可以印刷字符,具体可以根据实际使用需求确定,本申请实施例不作限定。Optionally, in this embodiment of the application, the characters may be handwritten characters or printed characters, which may be determined according to actual usage requirements, and are not limited in this embodiment of the application.
可选地,本申请实施例中,电子设备可以基于文本识别技术,对第一图像进行文本识别,以确定第一图像中的M个图像区域。Optionally, in this embodiment of the present application, the electronic device may perform text recognition on the first image based on a text recognition technology, so as to determine the M image regions in the first image.
可选地,本申请实施例中,电子设备在导入第一图像(如图2中的(a)所示的图像)之后,电子设备可以先对第一图像进行文字检测,以确定第一图像中M个图像区域的位置(或为位置信息,例如坐标信息)。Optionally, in the embodiment of the present application, after the electronic device imports the first image (such as the image shown in (a) in FIG. 2 ), the electronic device may first perform text detection on the first image to determine the first image The positions (or position information, such as coordinate information) of the M image regions in .
示例性地,如图2中的(b)所示,电子设备可以先采用文本行检测技术,检测第 一图像中M个图像区域的字符行(例如图2中的(b)所示的字符行20);然后再采用单字检测技术,检测出每个行区域中的各个字符的区域(如图2中的(c)所示的“酒”字所在区域21)。Exemplarily, as shown in (b) in FIG. 2, the electronic device may first use the text line detection technology to detect character lines in the M image regions in the first image (for example, the character lines shown in (b) in FIG. 2 Row 20); then adopt the single word detection technology to detect the area of each character in each line area (the area 21 where the word "wine" is located as shown in (c) in Figure 2).
步骤102、电子设备根据M个图像区域,对第一图像进行图像处理,得到M个第一单字图像。Step 102: The electronic device performs image processing on the first image according to the M image regions to obtain M first single-character images.
其中,上述M个第一单字图像中的每个第一单字图像对应上述M个图像区域中的一个图像区域。即M个图像区域与M个第一单字图像一一对应。Wherein, each first word image in the M first word images corresponds to one image area in the M image areas. That is, there is a one-to-one correspondence between the M image regions and the M first word images.
本申请实施例中,电子设备可以按照M个图像区域裁剪第一图像,以得到M个第一单字图像。In the embodiment of the present application, the electronic device may crop the first image according to M image regions, so as to obtain M first word images.
可选地,本申请实施例中,电子设备在裁切第一图像之前,可以复制一个第一图像作为参考图像。Optionally, in this embodiment of the present application, before cropping the first image, the electronic device may copy a first image as a reference image.
步骤103、电子设备对M个第一单字图像进行字体美化处理,得到M个第二单字图像。 Step 103, the electronic device performs font beautification processing on the M first word images to obtain M second word images.
其中,上述字体美化处可以包括以下至少一项:(一),字体间架结构处理、(二),字体风格处理。Wherein, the aforementioned font beautification may include at least one of the following: (1), font frame structure processing, (2), font style processing.
可选地,本申请实施例中,上述步骤103具体可以通过下述的步骤103a实现。Optionally, in the embodiment of the present application, the foregoing step 103 may specifically be implemented through the following step 103a.
步骤103a、电子设备基于字体美化参数,对M个第一单字图像中的每个第一单字图像进行字体美化处理,得到与每个第一单字图像对应的一个第二单字图像。Step 103a. Based on the font beautification parameters, the electronic device performs font beautification processing on each of the M first individual character images to obtain a second individual character image corresponding to each first individual character image.
其中,上述字体美化参数为采用大量单字图像对神经网络模型训练得到的参数,每个单字图像对中包括一个待美化的单字图像和一个美化后的单字图像。Wherein, the above-mentioned font beautification parameters are parameters obtained by training a neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
可以理解,本申请实施例中,上述一个待美化的单字图像和上述一个美化后的单字图像的字体风格和/或笔画结构存在差异。It can be understood that, in the embodiment of the present application, there are differences in font style and/or stroke structure between the above-mentioned single-character image to be beautified and the above-mentioned one beautified single-character image.
例如,以待美化的单字图像和美化后的单字图像的笔画结构存在差异为例,美化后的单字图像的笔画结构相比于待美化的单字图像的笔画结构更紧凑、协调。For example, taking the difference between the stroke structure of the word image to be beautified and the beautified word image as an example, the stroke structure of the beautified word image is more compact and coordinated than the stroke structure of the word image to be beautified.
可选地,本申请实施例中,上述字体美化参数可以为字体美化模型的参数。该字体美化模型为采用上述大量单字图像对,对卷积神经网络模型训练得到的;该字体美化模型可以用于对单字图像笔画结构和字体风格中的至少一项进行美化处理。Optionally, in the embodiment of the present application, the above font beautification parameters may be parameters of a font beautification model. The font beautification model is obtained by training the convolutional neural network model by using the above-mentioned large number of single-character image pairs; the font beautification model can be used to beautify at least one of the stroke structure and font style of the single-character image.
为了更清楚地解释本申请实施例提供的字体美化方法,下面先对通过上述大量图像对训练神经网络模型的方法进行示例性地说明。In order to explain the font beautification method provided by the embodiment of the present application more clearly, the method for training the neural network model by using the above-mentioned large number of image pairs will be exemplarily described below.
1)准备训练集:1) Prepare the training set:
采集大量单字图像对,作为训练数据集。其中,每个单字图像对中包括一个待美化的单字图像、一个对该单字图像的笔画结构和/或字体风格进行调整后的单字图像(即美化后的单字图像)。并将每个单字图像对中的美化后的单字图像作为该单字图像对的标签。A large number of word image pairs are collected as a training data set. Wherein, each single-character image pair includes a single-character image to be beautified, and a single-character image after adjusting the stroke structure and/or font style of the single-character image (ie, the beautified single-character image). And the beautified word image in each word image pair is used as the label of the word image pair.
2)字体美化模型训练:2) Font beautification model training:
i)、对神经网络模型的各层参数(权值和偏置)进行随机初始化;并对训练集中的单字图像对分批,每批包括N个单字图像对,N为正整数。i), each layer parameter (weight value and bias) of neural network model is carried out random initialization; And to the individual word image pair in training set, each batch comprises N individual word image pair, and N is a positive integer.
ii)、将训练集中的第一批单字图像对输入初始化后的神经网络模型。ii), the neural network model after initializing the input of the first batch of single character images in the training set.
在将第一批单字图像对输入神经网络模型的第一层后,将第一批单字图像对中N个待美化的单字图像分别与第一层的权值进行加权运算,且加偏置项并采用ReLu函数激活,得到N个第一结果图像;将N个第一结果图像作为神经网络模型的第二层的输入,并将该N个第一结果图像分别与第二层的权值进行加权运算,且加偏置项并采用ReLu函数激活,得到N个第二结果图像;然后将N个第二结果图像作为神经网络模型的第三层的输入,如此重复,直至得到经过神经网络模型的最后一层处理后的N个第j结果图像,j(表示神经网络模型包括j层)为正整数。After inputting the first batch of single-character image pairs into the first layer of the neural network model, the N single-character images to be beautified in the first batch of single-character image pairs are respectively weighted with the weights of the first layer, and the bias term is added And use the ReLu function to activate to obtain N first result images; use the N first result images as the input of the second layer of the neural network model, and compare the N first result images with the weights of the second layer respectively Weighting operation, and adding bias items and using the ReLu function to activate to obtain N second result images; then use N second result images as the input of the third layer of the neural network model, and repeat this until the obtained neural network model The N jth result images processed by the last layer of , j (indicating that the neural network model includes j layers) is a positive integer.
iii)、N个第j结果图像与对应标签图像(对应的美化后单字图像)之间的欧氏距离,得到N个欧式距离,然后将该N个欧式距离的平均值作为误差,计算该误差对神经网络模型中的每个网络参数的梯度;然后采用随机梯度下降算法来更新神经网络模型的网络参数。如此完成对神经网络模型的一次训练。iii), the Euclidean distance between the N jth result image and the corresponding label image (the corresponding beautified word image), to obtain N Euclidean distances, and then use the average value of the N Euclidean distances as an error to calculate the error The gradient of each network parameter in the neural network model; then the stochastic gradient descent algorithm is used to update the network parameters of the neural network model. In this way, a training of the neural network model is completed.
然后将第二批单字图像对输入神经网络模型,以对神经网络模型进行第二次训练。如此重复,直至误差下降到合适范围且趋于稳定,即可完成对神经网络模型的全部训练。本申请实施例中,完成上述训练的神经网络模型即为本申请中的字体美化模型。上述字体美化参数为完成训练的神经网络模型中的各层参数。Then the second batch of single-word image pairs are input into the neural network model to train the neural network model for the second time. Repeat this until the error drops to an appropriate range and tends to be stable, then all the training of the neural network model can be completed. In the embodiment of the present application, the neural network model that has completed the above training is the font beautification model in the present application. The font beautification parameters mentioned above are the parameters of each layer in the trained neural network model.
可选地,本申请实施例中,上述神经网络模型可以为卷积神经网络模型,也可以为其他任何具有学习能力的神经网络模型,具体可以根据实际使用需求确定,本申请实施例不作限定。Optionally, in the embodiment of the present application, the above neural network model may be a convolutional neural network model, or any other neural network model with learning capability, which may be determined according to actual usage requirements, and is not limited in the embodiment of the present application.
可选地,本申请实施例中,上述训练集中待美化的单字图像可以为人工手写的,或者述训练集中待美化的单字图像可以为电子设备对一个美化后的单字图像进行随机扰动(即“丑化”)得到的。Optionally, in the embodiment of the present application, the word images to be beautified in the above training set may be manually handwritten, or the word images to be beautified in the training set may be randomly perturbed by an electronic device to a beautified word image (that is, " uglify") get.
需要说明的是,实际实现中,电子设备基于字体美化参数对M个第一单字图像中的第i个第一单字图像进行字体美化处理,得到与该第i个第一单字图像对应的第i个第二单字图像,然后,电子设备可以基于字体美化参数对M个第一单字图像中的第i+1个第一单字图像进行字体美化处理,得到与该第i+1个第一单字图像对应的第i+1个第二单字图像,以此类推,电子设备基于字体美化参数对M个第一单字图像中的第M个第一单字图像进行字体美化处理后,可以得到与该第M个第一单字图像对应的第M个第二单字图像。即电子设备执行M次上述步骤103a之后,可以得到M个第二单字图像。It should be noted that, in actual implementation, the electronic device performs font beautification processing on the i-th first word image among the M first word images based on the font beautification parameters, and obtains the i-th word image corresponding to the i-th first word image. second word image, and then, the electronic device can perform font beautification processing on the i+1 first word image in the M first word images based on the font beautification parameter, and obtain the first word image corresponding to the i+1 first word image The corresponding i+1th second word image, and so on, after the electronic device performs font beautification processing on the M first word image in the M first word images based on the font beautification parameters, it can be obtained. The Mth second word image corresponding to the first word image. That is, after the electronic device executes the above step 103a M times, M second single-character images can be obtained.
本申请实施例中,电子设备基于字体美化参数,对M个第一单字图像中的每个第一单字图像进行字体美化处理,得到与每个第一单字图像对应的一个第二单字图像,具体可以为:每个第一单字图像依次输入字体美化模型中处理,得到与每个第一单字 图像对应的一个第二单字图像。In the embodiment of the present application, the electronic device performs font beautification processing on each of the M first word images based on the font beautification parameters, and obtains a second word image corresponding to each first word image, specifically It may be: each first individual character image is sequentially input into the font beautification model for processing, and a second individual character image corresponding to each first individual character image is obtained.
示例性地,以通过字体美化模型美化M个第一单字图像中的一个单字图像为例,电子设备可以将一个第一单字图像(例如图3中的单字图像30)输入字体美化模型,并将第一单字图像与字体美化模型(例如图3中的字体美化模型22)的每层的权值和偏置值(即字体美化参数)进行计算,并进行激活计算,然后字体美化模型可以输出与该第一单字图像对应的字体美化图像,即与该第一单字图像对应的第二单字图像(如图3中的单字图像31)。可以理解,本申请实施例中,将一个单字图像输入至字体美化模型中处理实质上为采用字体美化模型的各层的网络参数(即字体美化参数)对该单字图像进行处理。Exemplarily, taking the example of beautifying one of the M first character images through the font beautification model, the electronic device may input a first character image (for example, the character image 30 in FIG. 3 ) into the font beautification model, and The first word image and the weights and bias values (i.e. font beautification parameters) of each layer of the font beautification model (such as the font beautification model 22 in Fig. 3) are calculated, and the activation calculation is performed, and then the font beautification model can output the same The font beautification image corresponding to the first word image is the second word image corresponding to the first word image (such as the word image 31 in FIG. 3 ). It can be understood that in the embodiment of the present application, inputting a single-character image into the font beautification model for processing is essentially processing the single-character image by using the network parameters (ie, font beautification parameters) of each layer of the font beautification model.
本申请实施例中,由于可以基于经过大量单字图像对对神经网络模型训练得到的字体美化参数,对第一单字图像进行字体美化处理,因此可以在实现字迹美化的同时又可以保留作者的原始书写风格和个人特色。In the embodiment of the present application, since the font beautification process can be performed on the first single-character image based on the font beautification parameters obtained by training the neural network model through a large number of single-character image pairs, the author's original writing can be preserved while the handwriting beautification is realized. style and personality.
进一步地,由于可以对单个字符图像(即第一单字图像)的笔画结构和/或字体风格进行调整,因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的处理效果。Further, since the stroke structure and/or font style of a single character image (i.e. the first single-character image) can be adjusted, it can be ensured that the handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the understanding of the character image in the image. processing effect.
步骤104、电子设备将M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。 Step 104, the electronic device synthesizes the M second word images and the original background image of the first image to obtain a second image.
可选地,本申请实施例中,本申请实施例中,如图4所示,电子设备可以通过文字擦除技术擦除上述参考图像40中的字符,以得到如图4所示的原始背景图像41。或者,电子设备可以将第一图像中除M个图像区域之外的图像作为原始背景图像,具体可以根据实际使用需求确定,本申请实施例不作限定。Optionally, in the embodiment of the present application, as shown in FIG. 4 , the electronic device can erase the characters in the above-mentioned reference image 40 through text erasing technology to obtain the original background as shown in FIG. 4 Image 41. Alternatively, the electronic device may use images other than the M image areas in the first image as the original background image, which may be determined according to actual usage requirements, and is not limited in this embodiment of the present application.
本申请实施例中,M个第二单字图像在背景图像中的合成位置根据M图像区域在第一图像中的位置确定。In the embodiment of the present application, the combined positions of the M second word images in the background image are determined according to the positions of the M image regions in the first image.
可选地,本申请实施例中,上述步骤104具体可以通过下述的步骤104a和步骤104b实现。Optionally, in this embodiment of the present application, the foregoing step 104 may be specifically implemented through the following steps 104a and 104b.
步骤104a、电子设备根据M个图像区域在第一图像中的第一位置信息,确定第二位置信息,第二位置信息用于指示M个第二单字图像在原始背景图像中的合成位置。Step 104a, the electronic device determines the second position information according to the first position information of the M image areas in the first image, and the second position information is used to indicate the composition position of the M second word images in the original background image.
步骤104b、电子设备按照第二位置信息,将M个第二单字图像与背景图像合成,得到第三图像。In step 104b, the electronic device synthesizes the M second word images and the background image according to the second location information to obtain a third image.
其中,第一排布方式与第二排布方式的相似度大于或等于预设阈值,第一排布方式为M个第二单字图像在第三图像中的排布方式,第二排布方式为M个图像区域在第一图像中的排布方式。Wherein, the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold, the first arrangement is the arrangement of M second single-character images in the third image, and the second arrangement is the arrangement of the M image regions in the first image.
本申请实施例中,第一位置信息用于指示M个图像区域在第一图像中的位置。In the embodiment of the present application, the first position information is used to indicate the positions of the M image regions in the first image.
本申请实施例中,假设第一图像和原始背景图像处于相同坐标系中,且第一图像与原始背景图像在该坐标系中的位置信息(例如坐标信息)相同,例如,假设第一图 像的坐标信息为:(x1,y1)、(x2,y2)、(x3,y3)、(x4,y4),原始背景图像的坐标信息也为:(x1,y1)、(x2,y2)、(x3,y3)、(x4,y4);那么:In the embodiment of the present application, it is assumed that the first image and the original background image are in the same coordinate system, and the position information (such as coordinate information) of the first image and the original background image in the coordinate system is the same, for example, assuming that the first image The coordinate information is: (x1, y1), (x2, y2), (x3, y3), (x4, y4), and the coordinate information of the original background image is also: (x1, y1), (x2, y2), ( x3, y3), (x4, y4); then:
一种方式中,电子设备可以将第一位置信息作为第二位置信息,这种情况下,M个第二单字图像在原始背景图像中的合成位置与M个图像区域在第一图像区域中的位置相同,也即在进行美化处理前后,字符在图像中所处的位置均保持不变。In one manner, the electronic device may use the first position information as the second position information. In this case, the combined positions of the M second word images in the original background image and the positions of the M image areas in the first image area The positions are the same, that is, the positions of the characters in the image remain unchanged before and after the beautification process.
另一种方式中,为了达到排版工整的效果,合成时电子设备可以电子设备可以以根据M个图像区域在第一图像中的分布情况,将M个图像区域分为至少一个单元,每个单元为一个字符行或字符列,并以单元为单位,对M个图像区域的位置信息(即第一位置信息)进行微调,并将微调后的位置信息作为第二位置信息,如此可以使得与单个图像区域组对应的第二单字图像在原始背景图像中的合成位置尽可能的排在一条直线上。In another way, in order to achieve the effect of neat typesetting, the electronic device may divide the M image regions into at least one unit according to the distribution of the M image regions in the first image during synthesis, and each unit It is a character row or a character column, and the position information (ie, the first position information) of the M image areas is fine-tuned in units of units, and the fine-tuned position information is used as the second position information, so that it can be compared with a single The synthesis positions of the second word images corresponding to the image area groups in the original background image are arranged on a straight line as much as possible.
下面以单元为字符行为例,对电子设备对M个图像区域的位置信息进行微调的方法进行示例性地说明。The method for fine-tuning the position information of M image regions by an electronic device is exemplarily described below by taking a unit as an example of a character line.
i)电子设备计算第一图像中的M个图像区域的中心点的位置信息(如图5所示的位置信息50),得到M个位置信息(即第一位置信息)。i) The electronic device calculates the location information of the central points of the M image areas in the first image (the location information 50 shown in FIG. 5 ), and obtains M pieces of location information (ie, the first location information).
ii)电子设备根据M个图像区域在第一图像中的分布情况,将M个图像区域分为至少一个字符行,并字符行为单位,将每个字符行中的图像区域的位置信息拟合成一条直线(如图5所示的直线51)。需要说明的是,本申请实施例中,电子设备确定的直线的数量与字符行的数量相同。ii) The electronic device divides the M image areas into at least one character line according to the distribution of the M image areas in the first image, and fits the position information of the image area in each character line into A straight line (the straight line 51 shown in FIG. 5). It should be noted that, in the embodiment of the present application, the number of straight lines determined by the electronic device is the same as the number of character lines.
iii)对于每个字符行,假设一个字符行(以下称为字符行o)中包括u(u为大于1的整数)个图像区域(即u个字符),且根据该u个字符的位置信息确定的直线为第一直线,那么:电子设备可以将字符行o的最左侧的图像区域的中心点在第一直线上的投影位置,作为合成起点;将位于字符行o的最右侧的图像区域的中心点在第一直线上的投影位置,作为合成终点;且根据合成起点和合成终点之间的距离L、与该u个图像区域对应的u个第二单字图像的宽度值w1、w2、w3…wu,计算相邻两个第二单字图像之间的间隙d,具体的,间隙d可以通过下述的公式1计算,公式1:d=[L-(w1+w2+w3…+wu-w1*0.5-wu*0.5)]÷(u-1)。可以理解,该u个第二单字图像在原始背景图像中的合成位置的位置信息包括:合成起点的位置信息、合成终点的位置信息,以及位于合成起点与合成终点之间,且间隔为d的u-2个位置的位置信息。需要说明的是,本申请实施例中,电子设备在对每个字符行中图像区域执行上述步骤iii之后可以得到第二位置信息。iii) For each character row, it is assumed that a character row (hereinafter referred to as character row o) includes u (u is an integer greater than 1) image areas (that is, u characters), and according to the position information of the u characters The determined straight line is the first straight line, then: the electronic device can use the projection position of the center point of the leftmost image area of the character row o on the first straight line as the starting point of the composition; it will be located at the rightmost of the character row o The projection position of the center point of the image area on the side on the first straight line is used as the synthesis end point; and according to the distance L between the synthesis start point and the synthesis end point, the width of u second word images corresponding to the u image areas Values w1, w2, w3...wu, calculate the gap d between two adjacent second word images, specifically, the gap d can be calculated by the following formula 1, formula 1: d=[L-(w1+w2 +w3…+wu-w1*0.5-wu*0.5)]÷(u-1). It can be understood that the position information of the composition position of the u second word images in the original background image includes: the position information of the composition start point, the position information of the composition end point, and the position information between the composition start point and the composition end point with an interval of d Location information of u - 2 locations. It should be noted that, in the embodiment of the present application, the electronic device may obtain the second position information after performing the above step iii on the image area in each character row.
对于以字符列为单位,确定第二位置信息的描述,具体可以参见以字符行为单位确定第二位置信息的相关描述,为了避免重复,此处不再赘述。For the description of determining the second location information in units of character columns, please refer to the related description of determining the second location information in units of character rows. To avoid repetition, details are not repeated here.
可以理解,本申请实施例中,上述i~iii中是以对每个字符行中的图像区域的位置信息的行坐标(即X轴坐标)和列坐标均(即Y轴坐标)进行微调为例进行示意的, 实际实现中,可以调整图像区域的位置信息的行坐标和列坐标中的至少一项。It can be understood that in the embodiment of the present application, in the above i~iii, the row coordinate (ie, the X-axis coordinate) and the column coordinate (ie, the Y-axis coordinate) of the position information of the image area in each character row are fine-tuned as follows: An example is used for illustrative purposes. In actual implementation, at least one of the row coordinates and the column coordinates of the position information of the image area may be adjusted.
示例性地,以单元为字符行为例,假设第一图像与原始背景图像完全重合,那么:电子设备可以以第一图像中的一个字符行中的最左侧图像区域的原始位置作为合成起点,将与该字符行中的图像区域对应的第二单字图像,按照从左往右的顺序依次粘贴至第二图像,且这些单字图像在水平方向保持相同的间隙(即平均粘贴间隙d)。即仅调整行坐标。Illustratively, taking a unit as a character line as an example, assuming that the first image completely overlaps with the original background image, then: the electronic device may use the original position of the leftmost image area in a character line in the first image as the compositing starting point, Paste the second single-character image corresponding to the image area in the character row to the second image in order from left to right, and these single-character images maintain the same gap in the horizontal direction (ie, the average pasting gap d). i.e. only the row coordinates are adjusted.
又示例性地,结合图5,如图6所示,以采用字符行为单位为例,若M个图像区域中的一个图像区域的位置信息与拟合直线的距离小于或等于第一阈值,例如图5中的(“小”、“园”、“香”、“径”、“独”、“徘”、“徊”),则电子设备将与该图像区域对应的第二单字图像的列坐标(Y轴坐标)垂直移动到拟合直线上;若第一图像中的一个图像区域的位置信息与拟合直线的距离大于第一阈值,例如图5中的“。”;则电子设备保持与该图像区域对应的第二单字图像的列坐标与该图像区域的列坐标相同。如图6所示,图6为第二图像的示意图,第二单字图像“小”、“园”、“香”、“径”、“独”、“徘”以及“徊”的列坐标被垂直调整至拟合直线上,而第二单字图像“。”的行坐标则未移动。Also as an example, in conjunction with FIG. 5, as shown in FIG. 6, taking the character line unit as an example, if the distance between the position information of one of the M image areas and the fitted straight line is less than or equal to the first threshold, for example ("small", "garden", "fragrance", "path", "independence", "lingering", "lingering") among Fig. 5, then electronic device will be with the column of the second word image corresponding to this image area The coordinates (Y-axis coordinates) move vertically to the fitting line; if the distance between the position information of an image area in the first image and the fitting line is greater than the first threshold, such as "." in Figure 5; then the electronic device keeps The column coordinates of the second word image corresponding to the image area are the same as the column coordinates of the image area. As shown in Figure 6, Figure 6 is a schematic diagram of the second image, and the column coordinates of the second individual character images "small", "garden", "fragrant", "path", "du", "linger" and "lingering" are Adjust vertically to the fitting straight line, while the row coordinates of the second word image "." are not moved.
本申请实施例为用户提供了一种对图像中字符的笔迹(字体间架结构和字体风格)进行美化的方法,采用本申请实施例提供的文字美化方法不但可以实现对图像中的手写笔迹进行美化,而且可以规范图像中的文字的排版的效果,如此可以提高图像中(手写)文字观感。The embodiment of the present application provides users with a method for beautifying the handwriting (font frame structure and font style) of the characters in the image. Using the text beautification method provided in the embodiment of the present application can not only beautify the handwriting in the image , and can standardize the typesetting effect of the text in the image, which can improve the look and feel of the (handwritten) text in the image.
本申请实施例中,由于电子设备可以对M个第二单字图像的排版进行微调,如此可以确保M个第二单字图像在第二图像中的排版更加工整、美观。In the embodiment of the present application, since the electronic device can fine-tune the typesetting of the M second single-character images, it can ensure that the typesetting of the M second single-character images in the second image is more neat and beautiful.
本申请实施例提供的字体美化方法中,由于可以对一个图像(例如第一图像)中的单字图像进行字体美化处理(具体为字体间架结构处理和字体风格处理中至少一项),因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的美化处理效果。In the font beautification method provided in the embodiment of the present application, because the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
可选地,本申请实施例中,电子设备在得到M个第二单字图像后,可以对M个第二单字图像的尺寸进行调整,以降低字与字之间的大小差异,如此使得该M个第二单字图像的排版在视觉上更为整齐。Optionally, in the embodiment of the present application, after obtaining the M second single-character images, the electronic device may adjust the size of the M second single-character images to reduce the size difference between characters, so that the M The typesetting of the second word image is visually more neat.
可选地,本申请实施例中,在上述步骤104之前,本申请实施例提供的字体美化方法还包括下述的步骤105和步骤106。Optionally, in the embodiment of the present application, before the above step 104, the font beautification method provided in the embodiment of the present application further includes the following steps 105 and 106.
步骤105、电子设备根据M个图像区域在第一图像中的分布情况,将M个第二单字图像分为至少一个图像组。Step 105, the electronic device divides the M second single-character images into at least one image group according to the distribution of the M image areas in the first image.
本申请实施例中,上述至少一个图像组中的每个图像组中包括至少一个第二单字图像。In the embodiment of the present application, each image group in the at least one image group includes at least one second single-character image.
本申请实施例中,由于第一图像中的M个图像区域、M个第一单字图像、M个 第二单字图像一一对应,因此可以按照M个图像区域在第一图像中所处的区域,对M个第二单字图像分组,得到H个组,H为正整数。具体的,假设M个图像区域中的Q个单字图像处于第一图像中的区域1,M个图像区域中的K个图像处于第一图像中的区域2,且区域1与区域2不同,Q与K之和等于M,Q和K均为正整数;那么:与该Q个单字图像对应的Q第二单字图像为一组,与该K个单字图像对应的K个第二单字图像为另一组。In the embodiment of the present application, since the M image areas in the first image, the M first word images, and the M second word images correspond one-to-one, it can be determined according to the area where the M image areas are located in the first image , grouping the M second single-character images to obtain H groups, where H is a positive integer. Specifically, assuming that Q word images in M image areas are in area 1 in the first image, K images in M image areas are in area 2 in the first image, and area 1 is different from area 2, Q The sum of K is equal to M, and Q and K are all positive integers; then: the Q second word images corresponding to these Q word images are one group, and the K second word images corresponding to these K word images are another group. A group.
可以理解,实际实现中,还可以按照第二单字图像的尺寸进行分组,例如,若M个第二单字图像中的2个第二单字图像的尺寸大于2平方厘米,M个第二单字图像中的3个第二单字图像的尺寸小于或等于2平方厘米,那么:该2个第二单字图像为一组,该3个第二单字图像为另一组。It can be understood that in actual implementation, grouping can also be performed according to the size of the second individual character images, for example, if the size of 2 second individual character images in the M second individual character images is greater than 2 square centimeters, among the M second individual character images The size of the three second single-character images is less than or equal to 2 square centimeters, then: the two second single-character images form one group, and the three second single-character images form another group.
步骤106、电子设备以图像组为单位,对至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像。Step 106 , the electronic device performs size normalization processing on the second single-character images in at least one image group by taking the image group as a unit, and obtains M second single-character images after normalization processing.
可选地,本申请实施例中,上述步骤106具体可以通过下述的步骤106a和步骤106b实现,或者,通过下述的步骤106a和步骤106c实现。Optionally, in the embodiment of the present application, the foregoing step 106 may specifically be implemented through the following steps 106a and 106b, or may be implemented through the following steps 106a and 106c.
步骤106a、针对M个第二单字图像中的每个第二单字图像,确定一个第二单字图像的尺寸与目标尺寸的第一差值。Step 106a, for each of the M second single-character images, determine a first difference between the size of a second single-character image and the target size.
其中,目标尺寸可以为第一图像组中的全部第二单字图像的尺寸的中值,第一图像组为上述一个第二单字图像所属的图像组。Wherein, the target size may be the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which the above-mentioned second single-character image belongs.
本申请实施例中,电子设备可以计算第一图像组中的第二单字图像的宽度值的中位数(以下称为宽度中位数),并计算一个组中的全部第二单字图像的高度值的中位数(以下称为高度中位数),并将该宽度中位数和高度中位数作为目标尺寸。In the embodiment of the present application, the electronic device can calculate the median of the width values of the second word images in the first image group (hereinafter referred to as the width median), and calculate the height of all the second word images in a group The median of the values (hereafter referred to as the median height), and use the median width and median height as the target size.
本申请实施例中,针对M个第二单字图像中的每个第二单字图像,电子设备可以先确定一个第二单字图像的尺寸与目标尺寸的第一差值;如果第一差值小于或等于预设差值,那么电子设备可以执行下述的步骤106b,如果第一差值大于预设差值,那么电子设备可以执行下述的步骤106c。需要说明的是,本申请实施例中,电子设备在执行M次该过程之后,即可得到归一化处理后的M个第二单字图像。In the embodiment of the present application, for each second single-character image in the M second single-character images, the electronic device may first determine the first difference between the size of the second single-character image and the target size; if the first difference is less than or is equal to the preset difference, then the electronic device may execute step 106b below, and if the first difference is greater than the preset difference, then the electronic device may execute step 106c below. It should be noted that, in the embodiment of the present application, after the electronic device executes the process M times, the normalized M second single-character images can be obtained.
步骤106b、电子设备将一个第二单字图像的尺寸调整为第一尺寸。Step 106b, the electronic device adjusts the size of a second word image to the first size.
其中,上述第一尺寸与目标尺寸的差值小于上述第一差值,例如,第二差值可以为0。Wherein, the difference between the first size and the target size is smaller than the first difference, for example, the second difference may be 0.
步骤106c、电子设备保持一个第二单字图像的尺寸不变。Step 106c, the electronic device keeps the size of a second single character image unchanged.
可选地,本申请实施例中,假设第一尺寸:宽*高=a1*b1,第二尺寸:宽*高=a2*b2,那么a2=(1±k)*a1,b2=(1±w)*b1,其中,a1、a2、b1、b2为大于0的数,k为大于0且小于宽度中位数,w为大于0且小于或等于高度中位数。例如宽度中位数可以为0.2,高度中位数可以为0.2,当然第一预设值和第二预设值也可以不同。Optionally, in this embodiment of the application, it is assumed that the first size: width*height=a1*b1, and the second size: width*height=a2*b2, then a2=(1±k)*a1, b2=(1 ±w)*b1, where a1, a2, b1, b2 are numbers greater than 0, k is greater than 0 and less than the median width, w is greater than 0 and less than or equal to the median height. For example, the median width can be 0.2, and the median height can be 0.2. Of course, the first preset value and the second preset value can also be different.
可以理解,本申请实施例中,对于M个第二单字图像中的每个单字图像,假设一 个第二单字图像的尺寸为第一尺寸,那么:若第一尺寸与目标尺寸的差值(即上述第一差值)小于或等于目标预设值,则电子设备可以将该一个第二单字图像的尺寸从第一尺寸调整为第二尺寸,以使该一个第二单字图像的尺寸向目标尺寸靠拢。若第一尺寸与目标尺寸的差值(即上述第一差值)大于目标预设值,则电子设备保持该一个第二单字图像的尺寸不变,以保持该一个第二单字图像的尺寸特色。It can be understood that, in the embodiment of the present application, for each individual character image in the M second individual character images, assuming that the size of a second individual character image is the first size, then: if the difference between the first size and the target size (i.e. The above-mentioned first difference) is less than or equal to the target preset value, then the electronic device can adjust the size of the second single-character image from the first size to the second size, so that the size of the second single-character image is closer to the target size move closer. If the difference between the first size and the target size (i.e. the first difference) is greater than the target preset value, the electronic device keeps the size of the second single-character image unchanged to keep the size characteristics of the second single-character image .
本申请实施例中,由于可以将M个第二单字图像的尺寸向目标尺寸靠拢,因此可以减小不同第二单字图像之间的尺寸差异,如此可以使得M个第二单字向的排版在视觉上更为整齐。In the embodiment of the present application, since the size of the M second single-character images can be moved closer to the target size, the size difference between different second single-character images can be reduced, so that the typesetting of the M second single-character images can be visually more tidy.
可选地,本申请实施例中,为了确保M个第一单字图像的尺寸能够符合图像处理的尺寸需求,在对上述M个第一单字图像进行字体美化处理之前,可以先对M个第一单字图像的尺寸进行调整。Optionally, in this embodiment of the application, in order to ensure that the size of the M first single-character images can meet the size requirements of image processing, before performing font beautification processing on the above M first single-character images, the M first The size of the word image is adjusted.
可选地,本申请实施例中,在上述步骤103之前,本申请实施例提供的字体美化方法还可以包括下述的步骤107。Optionally, in the embodiment of the present application, before the above step 103, the font beautification method provided in the embodiment of the present application may further include the following step 107.
步骤107、电子设备对M个第一单字图像进行归一化处理。Step 107, the electronic device performs normalization processing on the M first word images.
其中,归一化处理后的每个第一单字图像的尺寸处于预设尺寸范围内。预设尺寸范围为符合图像处理尺寸需求Wherein, the size of each first word image after normalization processing is within a preset size range. The preset size range is in line with the image processing size requirements
可选地,本申请实施例中,一个单字图像的尺寸可以为该单字图像的边长和/或面积。Optionally, in this embodiment of the present application, the size of a single-character image may be the side length and/or area of the single-character image.
本申请实施例中,若一个单字图像的尺寸处于预设尺寸范围内,则表示该单字图像的尺寸符合图像处理尺寸需求;若一个单字图像的尺寸处于预设尺寸范围外,则表示该的尺寸不符合图像处理尺寸需求。In the embodiment of the present application, if the size of a single-character image is within the preset size range, it means that the size of the single-character image meets the image processing size requirements; if the size of a single-character image is outside the preset size range, it means that the size of the single-character image Does not meet image processing size requirements.
可以理解,本申请实施例中,如图7所示,电子设备将从字符行中检测出的单字图像,逐个(例如从“小”至“径”的顺序)归一化到预设尺寸范围内,然后再输入至字体美化模型中处理,以得到处理后的“小园香径独徘徊”。It can be understood that in the embodiment of the present application, as shown in FIG. 7 , the electronic device normalizes the individual character images detected from the character row one by one (for example, in the order from "small" to "diameter") to a preset size range , and then input it into the font beautification model for processing to obtain the processed "Small Garden Fragrant Path Lonely Wandering".
需要说明的是,本申请实施例中,为了使排版较为工整,在将归一化处理后的在对上述M个第一单字图像进行字体美化处理,得到M个第二单字图像之后,可以将该M个第二单字图像的尺寸恢复至原始尺寸。It should be noted that, in the embodiment of the present application, in order to make the typesetting relatively neat, after performing font beautification processing on the above-mentioned M first word images after normalization processing to obtain M second word images, the The size of the M second word images is restored to the original size.
本申请实施例中,由于可以在处理待美化的单字图像之前,先对待美化的单字图像的尺寸进行归一化处理,因此可以确保对待美化的单字图像处理的成功率。In the embodiment of the present application, since the size of the word image to be beautified can be normalized before processing the word image to be beautified, the success rate of processing the word image to be beautified can be ensured.
结合图8所示,本申请实施例提供一种文字美化装置80,该文字美化装置80可以包括:识别模块81、处理模块82和合成模块83;识别模块81,用于对第一图像进行文本识别;处理模块82,用于根据识别模块81的识别结果确定第一图像中的M个图像区域,每个图像区域中包括一个字符;处理模块82,还用于根据M个图像区域,对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;处理模块82,还用于对M个第一单字图像进行字体美化处理,得到M个第二 单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;合成模块83,用于将处理模块82处理得到的M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。8, the embodiment of the present application provides a text beautification device 80, the text beautification device 80 may include: a recognition module 81, a processing module 82 and a synthesis module 83; the recognition module 81 is used to perform text processing on the first image Recognition; the processing module 82 is used to determine M image regions in the first image according to the recognition result of the recognition module 81, and each image region includes a character; the processing module 82 is also used to determine the M image regions according to the M image regions Perform image processing on an image to obtain M first word images, and each first word image corresponds to an image area; the processing module 82 is also used to perform font beautification processing on the M first word images to obtain M second word images Image, the font beautification process includes at least one of the following: frame structure processing between fonts, font style processing; synthesis module 83, used to synthesize M second word images obtained by processing module 82 with the original background image of the first image, to obtain second image.
一种可能的实现方式中,上述处理模块82,具体用于基于字体美化参数,对每个第一单字图像进行字体美化处理,得到与每个第一单字图像对应的一个第二单字图像。In a possible implementation manner, the above-mentioned processing module 82 is specifically configured to perform font beautification processing on each first individual character image based on font beautification parameters, to obtain a second individual character image corresponding to each first individual character image.
其中,字体美化参数为采用大量单字图像对神经网络模型训练得到的参数,每个单字图像对中包括一个待美化的单字图像和一个美化后的单字图像。Wherein, the font beautification parameters are parameters obtained by training the neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
一种可能的实现方式中,上述处理模块82,还用于在合成模块83将M个第二单字图像与第一图像的原始背景图像合成,得到第二图像之前,根据M个图像区域在第一图像中的分布情况,将M个第二单字图像分为至少一个图像组;并以图像组为单位,对至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像。In a possible implementation, the above-mentioned processing module 82 is also used to synthesize the M second word images with the original background image of the first image in the synthesis module 83 to obtain the second image, according to the M image regions at the first According to the distribution situation in an image, the M second single-character images are divided into at least one image group; and taking the image group as a unit, the second single-character images in at least one image group are subjected to size normalization processing to obtain normalization The processed M second word images.
一种可能的实现方式中,上述处理模块82,具体用于针对M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值小于或等于预设差值的情况下,将一个第二单字图像的尺寸调整为第一尺寸,第一尺寸与目标尺寸的差值小于第一差值;或者,处理模块82,具体用于针对M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值大于预设差值的情况下,保持一个第二单字图像的尺寸不变。其中,目标尺寸为第一图像组中的全部第二单字图像的尺寸的中值,第一图像组为一个第二单字图像所属的图像组。In a possible implementation manner, the above-mentioned processing module 82 is specifically configured to, for each second single-character image in the M second single-character images, when the first difference between the size of a second single-character image and the target size is less than or When it is equal to the preset difference, the size of a second single character image is adjusted to the first size, and the difference between the first size and the target size is less than the first difference; or, the processing module 82 is specifically used for M For each second single-character image in the second single-character image, when the first difference between the size of the second single-character image and the target size is greater than the preset difference, the size of the second single-character image remains unchanged. Wherein, the target size is the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which a second single-character image belongs.
一种可能的实现方式中,上述合成模块83包括确定子模块和合成子模块;确定子模块,用于根据M个图像区域在第一图像中的第一位置信息,确定第二位置信息,第二位置信息用于指示M个第二单字图像在原始背景图像中的合成位置;合成子模块,用于按照确定子模块确定的第二位置信息,将M个第二单字图像与背景图像合成,得到第三图像。其中,第一排布方式与第二排布方式的相似度大于或等于预设阈值,第一排布方式为M个第二单字图像在第三图像中的排布方式,第二排布方式为M个图像区域在第一图像中的排布方式。In a possible implementation, the synthesis module 83 includes a determination sub-module and a synthesis sub-module; the determination sub-module is configured to determine the second position information according to the first position information of the M image regions in the first image, the second The second position information is used to indicate the synthesis position of the M second single-character images in the original background image; the synthesis submodule is used to synthesize the M second single-character images and the background image according to the second position information determined by the determination sub-module, Get the third image. Wherein, the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold, the first arrangement is the arrangement of M second single-character images in the third image, and the second arrangement is the arrangement of the M image regions in the first image.
本申请实施例提供的文字美化装置中,由于可以对一个图像(例如第一图像)中的单字图像进行字体美化处理(具体为字体间架结构处理和字体风格处理中至少一项),因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的美化处理效果。In the text beautification device provided in the embodiment of the present application, since the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。For the beneficial effects of the various implementations in this embodiment, refer to the beneficial effects of the corresponding implementations in the foregoing method embodiments. To avoid repetition, details are not repeated here.
本申请实施例中的文字美化可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、 超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The text beautification in this embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的文字美化装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The text beautifying device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
本申请实施例提供的文字美化装置能够实现图1至图6的方法实施例实现的各个过程,为避免重复,这里不再赘述。The text beautifying device provided in the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 6 , and details are not repeated here to avoid repetition.
如图9所示,本申请实施例还提供一种电子设备200,包括处理器202,存储器201,存储在存储器201上并可在处理器202上运行的程序或指令,该程序或指令被处理器202执行时实现上述文字美化方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。As shown in Figure 9, the embodiment of the present application also provides an electronic device 200, including a processor 202, a memory 201, a program or instruction stored in the memory 201 and operable on the processor 202, the program or instruction is processed When executed by the device 202, each process of the above text beautification method embodiment can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
需要注意的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图10为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010, etc. part.
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1000 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1010 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 10 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
其中,处理器1010,用于对第一图像进行文本识别;且确定第一图像中的M个图像区域,每个图像区域中包括一个字符;并对第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;以及对M个第一单字图像进行字体美化处理,得到M个第二单字图像,字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;处理器1010,用于将处理器1010处理得到的M个第二单字图像与第一图像的原始背景图像合成,得到第二图像。Wherein, the processor 1010 is configured to perform text recognition on the first image; and determine M image areas in the first image, each image area includes a character; and perform image processing on the first image to obtain M number A single-character image, each first single-character image corresponds to an image area; and performing font beautification processing on M first single-character images to obtain M second single-character images, font beautification processing includes at least one of the following: frame structure processing between fonts, Font style processing; the processor 1010 is configured to combine the M second word images obtained by the processor 1010 with the original background image of the first image to obtain a second image.
一种可能的实现方式中,上述处理器1010,具体用于基于字体美化参数,对每个第一单字图像进行字体美化处理,得到与每个第一单字图像对应的一个第二单字图像。In a possible implementation manner, the above-mentioned processor 1010 is specifically configured to perform font beautification processing on each first individual character image based on font beautification parameters, to obtain a second individual character image corresponding to each first individual character image.
其中,字体美化参数为采用大量单字图像对神经网络模型训练得到的参数,每个单字图像对中包括一个待美化的单字图像和一个美化后的单字图像。Wherein, the font beautification parameters are parameters obtained by training the neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
一种可能的实现方式中,上述处理器1010,还用于在将M个第二单字图像与第一 图像的原始背景图像合成,得到第二图像之前,根据M个图像区域在第一图像中的分布情况,将M个第二单字图像分为至少一个图像组;并以图像组为单位,对至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像。In a possible implementation manner, the above-mentioned processor 1010 is further configured to combine the M second word images with the original background image of the first image to obtain the second image, according to the M image regions in the first image The distribution of the M second single-character images is divided into at least one image group; and taking the image group as a unit, the size normalization process is carried out to the second single-character images in at least one image group to obtain the normalized M second word images.
一种可能的实现方式中,上述处理器1010,具体用于针对M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值小于或等于预设差值的情况下,将一个第二单字图像的尺寸调整为第一尺寸,第一尺寸与目标尺寸的差值小于第一差值;或者,处理器1010,具体用于针对M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值大于预设差值的情况下,保持一个第二单字图像的尺寸不变。In a possible implementation manner, the above-mentioned processor 1010 is specifically configured to, for each second single-character image in the M second single-character images, when the first difference between the size of a second single-character image and the target size is less than or When it is equal to the preset difference, adjust the size of a second single-character image to the first size, and the difference between the first size and the target size is less than the first difference; or, the processor 1010 is specifically used for M For each second single-character image in the second single-character image, when the first difference between the size of the second single-character image and the target size is greater than the preset difference, the size of the second single-character image remains unchanged.
其中,目标尺寸为第一图像组中的全部第二单字图像的尺寸的中值,第一图像组为一个第二单字图像所属的图像组。Wherein, the target size is the median of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which a second single-character image belongs.
一种可能的实现方式中,处理器1010,用于根据M个图像区域在第一图像中的第一位置信息,确定第二位置信息,第二位置信息用于指示M个第二单字图像在原始背景图像中的合成位置;且按照确定的第二位置信息,将M个第二单字图像与背景图像合成,得到第三图像。In a possible implementation manner, the processor 1010 is configured to determine the second position information according to the first position information of the M image regions in the first image, and the second position information is used to indicate that the M second word images are in Compositing positions in the original background image; and according to the determined second position information, compositing M second word images with the background image to obtain a third image.
其中,第一排布方式与第二排布方式的相似度大于或等于预设阈值,第一排布方式为M个第二单字图像在第三图像中的排布方式,第二排布方式为M个图像区域在第一图像中的排布方式。Wherein, the similarity between the first arrangement and the second arrangement is greater than or equal to the preset threshold, the first arrangement is the arrangement of M second single-character images in the third image, and the second arrangement is the arrangement of the M image regions in the first image.
本申请实施例提供的文字美化装置中,由于可以对一个图像(例如第一图像)中的单字图像进行字体美化处理(具体为字体间架结构处理和字体风格处理中至少一项),因此可以确保调整后的单字图像的笔迹更具美感,如此提高了对图像中的文字图像的美化处理效果。In the text beautification device provided in the embodiment of the present application, since the font beautification processing (specifically at least one of font frame structure processing and font style processing) can be performed on a single-character image in an image (for example, the first image), it can ensure that The handwriting of the adjusted single-character image is more aesthetically pleasing, thus improving the effect of beautifying the character image in the image.
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。For the beneficial effects of the various implementations in this embodiment, refer to the beneficial effects of the corresponding implementations in the foregoing method embodiments. To avoid repetition, details are not repeated here.
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1009可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1010可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界 面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。It should be understood that, in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 is used for the image capture device ( Such as the image data of the still picture or video obtained by the camera) for processing. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and other input devices 10072 . The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here. The memory 1009 can be used to store software programs as well as various data, including but not limited to application programs and operating systems. The processor 1010 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1010 .
本申请实施例还提供一种可读存储介质,该可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述文字美化方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, each process of the above text beautification method embodiment can be achieved, and the same Technical effects, in order to avoid repetition, will not be repeated here.
其中,上述处理器为上述实施例中的电子设备中的处理器。上述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。本申请实施例另提供了一种芯片,该芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述文字美化方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Wherein, the above-mentioned processor is the processor in the electronic device in the above-mentioned embodiment. The above-mentioned readable storage medium includes a computer readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like. The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to realize the various processes of the above text beautification method embodiments, and can achieve the same To avoid repetition, the technical effects will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.
Claims (15)
- 一种文字美化方法,所述方法包括:A text beautification method, said method comprising:对第一图像进行文本识别,确定所述第一图像中的M个图像区域,每个图像区域中包括一个字符;performing text recognition on the first image, determining M image areas in the first image, each image area including a character;根据所述M个图像区域,对所述第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;Perform image processing on the first image according to the M image areas to obtain M first word images, each of the first word images corresponds to an image area;对所述M个第一单字图像进行字体美化处理,得到M个第二单字图像,所述字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;Perform font beautification processing on the M first single-character images to obtain M second single-character images, and the font beautification processing includes at least one of the following: font frame structure processing, font style processing;将所述M个第二单字图像与所述第一图像的原始背景图像合成,得到第二图像。Combining the M second word images with the original background image of the first image to obtain a second image.
- 根据权利要求1所述的方法,其中,所述对所述M个第一单字图像进行字体美化处理,得到M个第二单字图像,包括:The method according to claim 1, wherein said performing font beautification processing on said M first single-character images to obtain M second single-character images comprises:基于字体美化参数,对所述每个第一单字图像进行字体美化处理,得到与所述每个第一单字图像对应的一个第二单字图像;Based on font beautification parameters, performing font beautification processing on each of the first individual character images to obtain a second individual character image corresponding to each of the first individual character images;其中,所述字体美化参数为采用大量单字图像对神经网络模型训练得到的参数,每个单字图像对中包括一个待美化的单字图像和一个美化后的单字图像。Wherein, the font beautification parameters are parameters obtained by training a neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
- 根据权利要求1或2所述的方法,其中,所述将所述M个第二单字图像与所述第一图像的原始背景图像合成,得到第二图像之前,所述方法还包括:The method according to claim 1 or 2, wherein said synthesis of said M second word images and the original background image of said first image, before obtaining the second image, said method also includes:根据所述M个图像区域在所述第一图像中的分布情况,将所述M个第二单字图像分为至少一个图像组;Divide the M second word images into at least one image group according to the distribution of the M image areas in the first image;以图像组为单位,对所述至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像。Taking an image group as a unit, performing size normalization processing on the second single-character images in the at least one image group to obtain M second single-character images after normalization processing.
- 根据权利要求3所述的方法,其中,所述以图像组为单位,对所述至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像,包括:The method according to claim 3, wherein the size normalization process is performed on the second single-character images in the at least one image group in units of image groups, and M second word images after normalization processing are obtained. Word images, including:针对所述M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值小于或等于预设差值的情况下,将所述一个第二单字图像的尺寸调整为第一尺寸,所述第一尺寸与目标尺寸的差值小于所述第一差值;或者,For each second single-character image in the M second single-character images, if the first difference between the size of one second single-character image and the target size is less than or equal to the preset difference, the one second single-character image The size of the two single-character images is adjusted to a first size, and the difference between the first size and the target size is smaller than the first difference; or,在一个第二单字图像的尺寸与目标尺寸的第一差值大于预设差值的情况下,保持所述一个第二单字图像的尺寸不变;In the case where the first difference between the size of a second single-character image and the target size is greater than a preset difference, keep the size of the second single-character image unchanged;其中,所述目标尺寸为第一图像组中的全部第二单字图像的尺寸的中值,所述第一图像组为所述一个第二单字图像所属的图像组。Wherein, the target size is the median value of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which the one second single-character image belongs.
- 根据权利要求1所述的方法,其中,所述将所述M个第二单字图像与所述第一图像的原始背景图像合成,得到第二图像,包括:The method according to claim 1, wherein said synthesis of said M second word images and the original background image of said first image to obtain a second image comprises:根据所述M个图像区域在所述第一图像中的第一位置信息,确定第二位置信息,所述第二位置信息用于指示所述M个第二单字图像在所述原始背景图像中的合成位 置;According to the first position information of the M image areas in the first image, determine second position information, the second position information is used to indicate that the M second word images are in the original background image synthetic position;按照所述第二位置信息,将所述M个第二单字图像与所述背景图像合成,得到所述第三图像;According to the second position information, combining the M second word images with the background image to obtain the third image;其中,第一排布方式与第二排布方式的相似度大于或等于预设阈值,所述第一排布方式为所述M个第二单字图像在所述第三图像中的排布方式,所述第二排布方式为所述M个图像区域在所述第一图像中的排布方式。Wherein, the similarity between the first arrangement and the second arrangement is greater than or equal to a preset threshold, and the first arrangement is the arrangement of the M second single-character images in the third image , the second arrangement is the arrangement of the M image regions in the first image.
- 一种文字美化装置,所述装置包括:识别模块、处理模块和合成模块;A text beautification device, said device comprising: a recognition module, a processing module and a synthesis module;所述识别模块,用于对第一图像进行文本识别;The recognition module is configured to perform text recognition on the first image;所述处理模块,用于根据所述识别模块的识别结果确定所述第一图像中的M个图像区域,每个图像区域中包括一个字符;The processing module is configured to determine M image regions in the first image according to the recognition result of the recognition module, and each image region includes a character;所述处理模块,还用于根据所述M个图像区域,对所述第一图像进行图像处理,得到M个第一单字图像,每个第一单字图像对应一个图像区域;The processing module is further configured to perform image processing on the first image according to the M image regions to obtain M first word images, and each first word image corresponds to an image region;所述处理模块,还用于对所述M个第一单字图像进行字体美化处理,得到M个第二单字图像,所述字体美化处理包括以下至少一项:字体间架结构处理、字体风格处理;The processing module is further configured to perform font beautification processing on the M first single-character images to obtain M second single-character images, and the font beautification processing includes at least one of the following: font frame structure processing and font style processing;所述合成模块,用于将所述处理模块处理得到的所述M个第二单字图像与所述第一图像的原始背景图像合成,得到第二图像。The synthesizing module is configured to synthesize the M second word images processed by the processing module with the original background image of the first image to obtain a second image.
- 根据权利要求6所述的装置,其中,The apparatus of claim 6, wherein,所述处理模块,具体用于基于字体美化参数,对所述每个第一单字图像进行字体美化处理,得到与所述每个第一单字图像对应的一个第二单字图像;The processing module is specifically configured to perform font beautification processing on each of the first individual character images based on font beautification parameters, to obtain a second individual character image corresponding to each of the first individual character images;其中,所述字体美化参数为采用大量单字图像对神经网络模型训练得到的参数,每个单字图像对中包括一个待美化的单字图像和一个美化后的单字图像。Wherein, the font beautification parameters are parameters obtained by training a neural network model using a large number of word image pairs, and each word image pair includes a word image to be beautified and a word image after beautification.
- 根据权利要求6或7所述的装置,其中,Apparatus according to claim 6 or 7, wherein,所述处理模块,还用于在所述合成模块将所述M个第二单字图像与所述第一图像的原始背景图像合成,得到所述第二图像之前,根据所述M个图像区域在所述第一图像中的分布情况,将所述M个第二单字图像分为至少一个图像组;并以图像组为单位,对所述至少一个图像组中的第二单字图像进行尺寸归一化处理,得到归一化处理后的M个第二单字图像。The processing module is further configured to combine the M second word images with the original background image of the first image by the synthesis module to obtain the second image, according to the M image regions in the For the distribution in the first image, divide the M second single-character images into at least one image group; and use the image group as a unit to normalize the size of the second single-character images in the at least one image group normalized processing to obtain M second single-character images after normalized processing.
- 根据权利要求8所述的装置,其中,The apparatus of claim 8, wherein,所述处理模块,具体用于针对所述M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值小于或等于预设差值的情况下,将所述一个第二单字图像的尺寸调整为第一尺寸,所述第一尺寸与目标尺寸的差值小于所述第一差值;或者,The processing module is specifically configured to, for each second single-character image in the M second single-character images, when the first difference between the size of a second single-character image and the target size is less than or equal to the preset difference In this case, the size of the second single-character image is adjusted to a first size, and the difference between the first size and the target size is smaller than the first difference; or,所述处理模块,具体用于针对所述M个第二单字图像中的每个第二单字图像,在一个第二单字图像的尺寸与目标尺寸的第一差值大于预设差值的情况下,保持所述一 个第二单字图像的尺寸不变;The processing module is specifically configured to, for each of the M second single-character images, when the first difference between the size of a second single-character image and the target size is greater than a preset difference , keeping the size of the second word image unchanged;其中,所述目标尺寸为第一图像组中的全部第二单字图像的尺寸的中值,所述第一图像组为所述一个第二单字图像所属的图像组。Wherein, the target size is the median value of the sizes of all the second single-character images in the first image group, and the first image group is the image group to which the one second single-character image belongs.
- 根据权利要求6所述的装置,其中,所述合成模块包括确定子模块和合成子模块;The device according to claim 6, wherein the synthesis module comprises a determination sub-module and a synthesis sub-module;所述确定子模块,用于根据所述M个图像区域在所述第一图像中的第一位置信息,确定第二位置信息,所述第二位置信息用于指示所述M个第二单字图像在所述原始背景图像中的合成位置;The determination submodule is configured to determine second position information according to the first position information of the M image regions in the first image, and the second position information is used to indicate the M second words the composite position of the image within said original background image;所述合成子模块,用于按照所述确定子模块确定的所述第二位置信息,将所述M个第二单字图像与所述背景图像合成,得到所述第三图像;The synthesis submodule is configured to synthesize the M second word images and the background image according to the second position information determined by the determination submodule to obtain the third image;其中,第一排布方式与第二排布方式的相似度大于或等于预设阈值,所述第一排布方式为所述M个第二单字图像在所述第三图像中的排布方式,所述第二排布方式为所述M个图像区域在所述第一图像中的排布方式。Wherein, the similarity between the first arrangement and the second arrangement is greater than or equal to a preset threshold, and the first arrangement is the arrangement of the M second single-character images in the third image , the second arrangement is the arrangement of the M image regions in the first image.
- 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至5中任一项所述的文字美化方法的步骤。An electronic device, comprising a processor, a memory, and a program or instruction stored on the memory and operable on the processor, when the program or instruction is executed by the processor, claims 1 to 5 are realized The steps of the text beautification method described in any one.
- 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至5中任一项所述的文字美化方法的步骤。A readable storage medium, storing programs or instructions on the readable storage medium, and implementing the steps of the text beautification method according to any one of claims 1 to 5 when the programs or instructions are executed by a processor.
- 一种计算机程序产品,所述计算机程序产品被至少一个处理器执行以实现如权利要求1至5中任一项所述的文字美化方法。A computer program product, the computer program product is executed by at least one processor to implement the text beautification method according to any one of claims 1 to 5.
- 一种电子设备,所述电子设备被配置成用于执行如权利要求1至5中任一项所述的文字美化方法。An electronic device configured to execute the text beautification method according to any one of claims 1 to 5.
- 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如1至5中任一项所述的文字美化方法。A chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the text beautification method described in any one of 1 to 5 .
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110815639.5 | 2021-07-19 | ||
CN202110815639.5A CN113689525B (en) | 2021-07-19 | 2021-07-19 | Word beautifying method and device, readable storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023001112A1 true WO2023001112A1 (en) | 2023-01-26 |
Family
ID=78577436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/106276 WO2023001112A1 (en) | 2021-07-19 | 2022-07-18 | Text beautification method and apparatus, and readable storage medium and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113689525B (en) |
WO (1) | WO2023001112A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113689525B (en) * | 2021-07-19 | 2024-09-20 | 维沃移动通信有限公司 | Word beautifying method and device, readable storage medium and electronic equipment |
CN116543076B (en) * | 2023-07-06 | 2024-04-05 | 腾讯科技(深圳)有限公司 | Image processing method, device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145885A (en) * | 2017-05-03 | 2017-09-08 | 金蝶软件(中国)有限公司 | A kind of individual character figure character recognition method and device based on convolutional neural networks |
CN109829453A (en) * | 2018-12-29 | 2019-05-31 | 天津车之家数据信息技术有限公司 | It is a kind of to block the recognition methods of text in card, device and calculate equipment |
CN110321788A (en) * | 2019-05-17 | 2019-10-11 | 平安科技(深圳)有限公司 | Training data processing method, device, equipment and computer readable storage medium |
WO2019232843A1 (en) * | 2018-06-04 | 2019-12-12 | 平安科技(深圳)有限公司 | Handwritten model training method and apparatus, handwritten image recognition method and apparatus, and device and medium |
CN112801923A (en) * | 2021-04-14 | 2021-05-14 | 江西博微新技术有限公司 | Word processing method, system, readable storage medium and computer equipment |
CN113689525A (en) * | 2021-07-19 | 2021-11-23 | 维沃移动通信有限公司 | Character beautifying method and device, readable storage medium and electronic equipment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105335198B (en) * | 2015-11-13 | 2018-12-11 | 小米科技有限责任公司 | Font adding method and device |
CN110111243B (en) * | 2019-04-30 | 2023-05-12 | 山东浪潮科学研究院有限公司 | Method and device for beautifying handwriting fonts by using AI technology |
CN111783508A (en) * | 2019-08-28 | 2020-10-16 | 北京京东尚科信息技术有限公司 | Method and apparatus for processing image |
CN113128442B (en) * | 2021-04-28 | 2023-09-26 | 华南师范大学 | Chinese character handwriting style identification method and scoring method based on convolutional neural network |
-
2021
- 2021-07-19 CN CN202110815639.5A patent/CN113689525B/en active Active
-
2022
- 2022-07-18 WO PCT/CN2022/106276 patent/WO2023001112A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145885A (en) * | 2017-05-03 | 2017-09-08 | 金蝶软件(中国)有限公司 | A kind of individual character figure character recognition method and device based on convolutional neural networks |
WO2019232843A1 (en) * | 2018-06-04 | 2019-12-12 | 平安科技(深圳)有限公司 | Handwritten model training method and apparatus, handwritten image recognition method and apparatus, and device and medium |
CN109829453A (en) * | 2018-12-29 | 2019-05-31 | 天津车之家数据信息技术有限公司 | It is a kind of to block the recognition methods of text in card, device and calculate equipment |
CN110321788A (en) * | 2019-05-17 | 2019-10-11 | 平安科技(深圳)有限公司 | Training data processing method, device, equipment and computer readable storage medium |
CN112801923A (en) * | 2021-04-14 | 2021-05-14 | 江西博微新技术有限公司 | Word processing method, system, readable storage medium and computer equipment |
CN113689525A (en) * | 2021-07-19 | 2021-11-23 | 维沃移动通信有限公司 | Character beautifying method and device, readable storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113689525B (en) | 2024-09-20 |
CN113689525A (en) | 2021-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023001112A1 (en) | Text beautification method and apparatus, and readable storage medium and electronic device | |
WO2022012657A1 (en) | Image editing method and apparatus, and electronic device | |
US11488383B2 (en) | Video processing method, video processing device, and storage medium | |
WO2022143387A1 (en) | Display control method and apparatus, electronic device, and medium | |
WO2023103949A1 (en) | Video processing method and apparatus, electronic device and medium | |
WO2023001272A1 (en) | Candidate character display method and apparatus, and an electronic device | |
CN112464833A (en) | Dynamic gesture recognition method, device, equipment and storage medium based on optical flow | |
WO2023284632A1 (en) | Image display method and apparatus, and electronic device | |
CN116126183A (en) | Interface display state adjusting method and device, equipment and storage medium | |
CN108536653B (en) | Input method, input device and input device | |
CN114063845A (en) | Display method, display device and electronic equipment | |
WO2023160453A1 (en) | Display control method and apparatus, electronic device and storage medium | |
WO2023045976A1 (en) | Object switching method and apparatus, electronic device, and readable storage medium | |
CN113610864B (en) | Image processing method, device, electronic equipment and computer readable storage medium | |
CN115529405A (en) | Image display method and device of front camera | |
CN115037874A (en) | Photographing method and device and electronic equipment | |
CN114125149A (en) | Video playing method, device, system, electronic equipment and storage medium | |
CN112698734A (en) | Candidate word display method and device and electronic equipment | |
CN112150486A (en) | Image processing method and device | |
CN112866475A (en) | Image sending method and device and electronic equipment | |
CN114237785A (en) | Image generation method and device | |
CN115454263A (en) | Character input method and device, electronic equipment and storage medium | |
CN118379397A (en) | Image processing method and device and electronic equipment | |
CN115993892A (en) | Information input method and device and electronic equipment | |
CN118708106A (en) | Touch track generation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22845277 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22845277 Country of ref document: EP Kind code of ref document: A1 |