Method and device for optimizing handwriting, electronic equipment and storage medium
By identifying and splicing images of users' handwriting to form coherent artistic words, it solves the problem that existing technology cannot accurately imitate handwriting styles, and achieves personalized and natural artistic word conversion effects.
Patent Information
- Application Number
- CN202410542919.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2024-10-11
AI Technical Summary
Existing handwriting font conversion tools cannot accurately imitate the user's personalized handwriting style, resulting in the converted word art appearing stiff and unnatural, and losing the coherence of handwritten text.
By obtaining the handwriting image input by the user, it performs text recognition, matches and splices the text graphics, and determines the connection points according to the font structure for splicing to form a coherent artistic word that imitates the user's handwriting style.
It has realized the optimization of artistic words to ensure that the recognized handwriting is both artistic and can truly reflect the user's coherent handwriting style, providing users with a personalized and natural artistic word conversion experience.
Smart Images

Figure CN118762371A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text recognition, for example, to a method and device, electronic device, and storage medium for optimizing handwriting. Background Art
[0002] With the advent of the digital age, handwriting recognition technology has made significant progress and has been widely used in many fields. For example, recognizing and converting user handwriting into artistic characters is of great significance for improving user experience and enriching the expression of digital content. However, the handwriting style of different users is unique, including personalized stroke order, pen pressure changes, speed control, font characteristics, and writing continuity.
[0003] At present, there are some handwriting font conversion tools on the market, but most of them can only provide fixed artistic font styles and cannot accurately imitate the user's personalized handwriting style. Even if there are some tools that can recognize handwriting, when converting it into artistic words, the coherence and personalized characteristics of handwriting are often lost, making the converted artistic words appear stiff and unnatural.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The embodiments of the present disclosure provide a method and device, an electronic device, and a storage medium for optimizing handwriting to form artistic characters that can imitate the user's continuous handwriting.
[0007] In some embodiments, the method for optimizing handwriting includes: obtaining a handwriting image input by a user, wherein the handwriting image is an image containing at least two handwritings; performing text recognition on the handwriting image to obtain text information, wherein the text information is used to represent the text in the handwriting image; obtaining text graphics corresponding to each of the text information; and splicing the text graphics to obtain a text image in which the text graphics are connected as one.
[0008] In some embodiments, obtaining the text graphics corresponding to each of the text information includes: matching the text graphics corresponding to each of the text information in a preset text graphic library; the text graphic library stores the correspondence between text information, text graphics, and text information and text graphics.
[0009] In some embodiments, the text graphics are spliced together to obtain a text image in which the text graphics are connected as one, including: obtaining a font structure corresponding to each text information; and splicing the text graphics according to the font structure to obtain a text image in which the text graphics are connected as one.
[0010] In some embodiments, the text graphics are spliced according to the font structure, including: determining at least two candidate connection points on each text graphic according to the font structure of each text graphic; and splicing each text graphic according to the candidate connection points.
[0011] In some embodiments, each text graphic is spliced according to alternative connection points, including: selecting at least one alternative connection point for each text graphic to perform overlapping processing, wherein each alternative connection point is overlapped at most once; the overlapping processing is to overlap two text graphics, and the overlapping area is an alternative connection point in each of the two text graphics; the two text graphics overlap each other at most once.
[0012] In some embodiments, each text graphic is spliced according to alternative connection points, including: selecting at least one alternative connection point for each text graphic for connection processing, wherein each alternative connection point is connected at most once; the connection processing is to connect two text graphics, and the connection area is an alternative connection point in each of the two text graphics; the two text graphics are connected to each other at most once.
[0013] In some embodiments, the device for optimizing handwriting includes: a handwriting image acquisition module, configured to acquire a handwriting image input by a user, wherein the handwriting image is an image containing at least two handwritings; a recognition module, configured to perform text recognition on the handwriting image to obtain text information, wherein the text information is used to represent the text in the handwriting image; a text graphic acquisition module, configured to acquire text graphics corresponding to each of the text information; and a splicing module, configured to splice each text graphic to obtain a text image in which each text graphic is connected as a whole.
[0014] In some embodiments, the device for optimizing handwriting includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for optimizing handwriting when executing the program instructions.
[0015] In some embodiments, the electronic device includes the above-mentioned device for optimizing handwriting.
[0016] In some embodiments, the storage medium stores program instructions, and when the program instructions are run, the above-mentioned method for optimizing handwriting is executed.
[0017] The method and device, electronic device, and storage medium for optimizing handwriting provided by the embodiments of the present disclosure can achieve the following technical effects: it is possible to identify text information from the handwriting image input by the user, and to splice the text graphics corresponding to each text information to obtain a text image in which each text graphics is connected as one. In this way, by connecting the text graphics corresponding to the text input by the user as one, a text image connected as one is obtained, thereby obtaining artistic characters with coherence. In turn, artistic characters that can imitate the user's coherent handwriting are formed. The optimization of artistic character recognition is achieved. The handwriting after recognition is made both artistic and can truly reflect the style of the user's coherent handwriting. It provides users with a more personalized and natural artistic character conversion experience.
[0018] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0020] Figure 1 It is a schematic diagram of an application environment;
[0021] Figure 2 is a schematic diagram of a method for optimizing handwriting provided by an embodiment of the present disclosure;
[0022] Figure 3 It is a schematic diagram of a text graphic;
[0023] Figure 4 It is a schematic diagram of a text image;
[0024] Figure 5 is a schematic diagram of a device for optimizing handwriting provided by an embodiment of the present disclosure;
[0025] Figure 6 is a schematic diagram of another device for optimizing handwriting provided by an embodiment of the present disclosure;
[0026] Figure 7 It is a structural schematic diagram of a smart refrigerator provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0028] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0029] Unless otherwise stated, the term "plurality" means two or more.
[0030] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0031] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0032] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0033] The handwriting optimization method provided by the embodiment of the present disclosure is applied to electronic devices, including servers, smart phones, tablet computers, or smart home appliances with touch screens.
[0034] In the embodiments of the present disclosure, smart home appliances refer to home appliances that are formed by introducing microprocessors, sensor technology, and network communication technology into home appliances. They have the characteristics of intelligent control, intelligent perception, and intelligent application. The operation process of smart home appliances often relies on the application and processing of modern technologies such as the Internet of Things, the Internet, and electronic chips. For example, smart home appliances can be connected to terminal devices to enable users to remotely control and manage the smart home appliances.
[0035] In the disclosed embodiments, the terminal device has a wireless connection function, and the terminal device can communicate with the above-mentioned smart home appliances by connecting to the Internet, or can communicate with the above-mentioned smart home appliances directly through Bluetooth, WiFi, etc. In some embodiments, the terminal device is, for example, a mobile device, a computer, or a vehicle-mounted device built into a hover car, or any combination thereof. Mobile devices may include, for example, mobile phones, smart home devices, wearable devices, smart mobile devices, virtual reality devices, etc., or any combination thereof, wherein wearable devices include, for example: smart watches, smart bracelets, pedometers, etc.
[0036] In some embodiments, the electronic device is a server. Figure 1 As shown, the server 101 is connected to the smart refrigerator 100 by connecting to the Internet. The smart refrigerator 100 is provided with a touch display screen 102. The server 101 obtains the handwriting image input by the user through the smart refrigerator 100.
[0037] Combination Figure 2 As shown, the present disclosure provides a method for optimizing handwriting, comprising:
[0038] Step S201: the electronic device obtains a handwriting image input by a user, where the handwriting image is an image containing at least two handwritings.
[0039] Step S202: the electronic device performs text recognition on the handwriting image to obtain a plurality of text information, where the text information is used to represent the text in the handwriting image.
[0040] Step S203: the electronic device obtains the text graphics corresponding to each piece of text information.
[0041] Step S204: the electronic device splices the text graphics together to obtain a text image in which the text graphics are connected together.
[0042] By using the method for optimizing handwriting provided by the embodiment of the present disclosure, it is possible to identify text information from the handwriting image input by the user, and to splice the text graphics corresponding to each text information to obtain a text image in which each text graphics is connected as one. In this way, by connecting the text graphics corresponding to the text input by the user as one, a text image is obtained that is connected as one, thereby obtaining artistic characters with coherence. In turn, artistic characters that can imitate the user's coherent handwriting are formed. The optimization of artistic character recognition is achieved. The handwriting after recognition is made both artistic and can truly reflect the style of the user's coherent handwriting. A more personalized and natural artistic character conversion experience is provided to users.
[0043] In some embodiments, the electronic device is a smart refrigerator equipped with a touch screen. The user directly uses a finger or a dedicated stylus to perform handwritten input on the touch screen, that is, write text in the blank area of the touch screen. The induction system built into the touch screen captures the trajectory information of the user's handwritten in real time, including the starting point, ending point,划过位置, and possible pressure changes of the stroke, etc. The electronic device generates a corresponding image from the collected handwritten trajectory data, thereby obtaining a handwritten image.
[0044] Optionally, perform optical character recognition on the handwritten image to obtain multiple text information, including: using OCR (Optical Character Recognition) technology to perform optical character recognition on each handwritten image to obtain multiple text information. Because the obtained handwritten image of the user input contains images of at least two handwritings, after performing optical character recognition on each handwritten image, multiple text information can be obtained.
[0045] Optionally, perform optical character recognition on the handwritten image to obtain multiple text information, including: using a preset feature extraction algorithm to extract the shape features and structural features of the text in each handwritten image, and using the corresponding shape features and structural features of each handwritten image to perform a look-up operation in a preset character feature data table to find the text information corresponding to the common shape features and structural features. The preset character feature data table stores the corresponding relationship between the common shape features and structural features and the text information. Among them, the feature extraction algorithm includes HOG (Histogram of Oriented Gradients), SIFT (Scale-Invariant Feature Transform), etc.
[0046] Optionally, obtain the text graphics corresponding to each text information, including: matching the text graphics corresponding to each text information in a preset text graphics library. The text graphics library stores the corresponding relationship between text information, text graphics, text information, and text graphics.
[0047] The text graphics stored in the text graphics library are the graphics of artistic characters. In this way, the artistic characters corresponding to the text information can be found through the text graphics library. And the graphics of the artistic characters are connected together. It is possible to form artistic characters that can imitate the user's coherent handwriting. The optimization of the recognition of artistic characters is realized. The recognized handwriting is both artistic and can truly reflect the style of the user's coherent handwriting. It provides a more personalized and natural artistic character conversion experience for the user.
[0048] In some embodiments, as shown in Figure 3 Combined Figure 3 In 301, the character "博" is the handwritten image input by the user. Perform optical character recognition on this handwritten image to obtain text information. By matching the text graphics corresponding to this text information in the text graphics library, such as the character "博" in 302, it is the matched text graphics.
[0049] Optionally, splice each text graphic to obtain a text image in which the text graphics are connected together, including: obtaining the font structure corresponding to each text information. Splice each text graphic according to the font structure to obtain a text image in which the text graphics are connected together.
[0050] Further, obtaining the font structure corresponding to each text information includes: performing a look-up operation on each text information in a preset font structure data table. Find out the font structures respectively corresponding to each text information. The font structure data table stores the corresponding relationship between text information and font structure. In some embodiments, the font structure includes a single structure, an upper-lower structure, a left-right structure, a full-surround structure, a semi-surround structure, an interpenetrating structure, and a triangular structure, etc. For example, the text information is "Bo", and the corresponding font structure is a left-right structure.
[0051] Optionally, splicing each text graphic according to the font structure includes: respectively determining at least two alternative connection points on each text graphic according to the font structure of each text graphic. Splice each text graphic according to the alternative connection points. In this way, each text graphic is spliced through the alternative connection points to form a whole text image. A coherent artistic word is formed. The recognition of the artistic word is optimized. The recognized handwriting is both artistic and can truly reflect the user's coherent handwriting style.
[0052] In some embodiments, the alternative connection point is a pixel point. In the case where the font structure is an upper-lower structure, select a pixel point from the upper part structure and the lower part structure of the corresponding text graphic as the alternative connection point respectively. For example, randomly select a pixel point from the pixels in the top row of the upper part structure as the alternative connection point. Randomly select a pixel point from the pixels in the bottom row of the lower part structure as the alternative connection point.
[0053] In the case where the font structure is a left-right structure, select a pixel point from the left part structure and the right part structure of the corresponding text graphic as the alternative connection point respectively. For example, randomly select a pixel point from the pixels in the leftmost row of the left part structure as the alternative connection point. Randomly select a pixel point from the pixels in the rightmost row of the right part structure as the alternative connection point.
[0054] In the case where the font structure is a single structure, a full-surround structure, a semi-surround structure, an interpenetrating structure, and a triangular structure, in the corresponding text graphic, select a pixel point from the pixels in the leftmost row and the rightmost row respectively as the alternative connection point.
[0055] Optionally, the text graphics are spliced according to the candidate connection points, including: splicing the text graphics through the candidate connection points in the order of the handwriting input by the user. In this way, the text image finally obtained is in the order of the user's writing, which can more truly reflect the user's coherent handwriting style.
[0056] Optionally, the text graphics are spliced according to the candidate connection points, including: selecting at least one candidate connection point for each text graphic to perform overlapping processing, wherein each candidate connection point is overlapped at most once; the overlapping processing is to overlap two text graphics, and the overlapping area is one candidate connection point in each of the two text graphics. The two text graphics overlap each other at most once.
[0057] In this way, the candidate connection point of one text graphic overlaps with the candidate connection point of another text graphic, so that one text graphic can be connected to another text graphic. At the same time, since each candidate connection point is overlapped at most once, it can be ensured that there are at most two candidate connection points overlapping at the same pixel position. In this way, it is ensured that no more than three text graphics will be connected together through the same pixel position. In addition, two text graphics overlap each other at most once, that is, the two text graphics overlap at only one candidate connection point. In this way, it is ensured that the two text graphics are spliced through only one candidate connection point, avoiding the splicing through multiple candidate connection points, resulting in a large overlap of the two text graphics and unclear.
[0058] In some embodiments, according to the order of the user's handwriting, a candidate connection point is selected from the first text graphic to overlap with one of the candidate connection points of the second text graphic, another candidate connection point of the second text graphic overlaps with one of the candidate connection points of the third text graphic, another candidate connection point of the third text graphic overlaps with one of the candidate connection points of the next text graphic, and in this way, one candidate connection point of a text graphic overlaps with one candidate connection point of the next text graphic, until one candidate connection point of the n-1th text graphic overlaps with one candidate connection point of the nth text graphic. In this way, the text graphics are spliced to obtain a text image connected as a whole. Where n≥2, and n is an integer.
[0059] A candidate connection point of one character graphic overlaps with a candidate connection point of the next character graphic, that is, the two candidate connection points overlap.
[0060] Optionally, each text graphic is spliced according to alternative connection points, including: selecting at least one alternative connection point for each text graphic for connection processing, wherein each alternative connection point is connected at most once; the connection processing is to connect two text graphics, and the connection area is an alternative connection point in each of the two text graphics; the two text graphics are connected to each other at most once.
[0061] In this way, the alternative connection point of one text graphic is connected to the alternative connection point of another text graphic, so that one text graphic can be connected to another text graphic. At the same time, since each alternative connection point is connected at most once, it can be ensured that there are at most two alternative connection points at the same connection point. In this way, it is ensured that no more than three text graphics will be spliced together through the same connection point. In addition, two text graphics are connected to each other at most once, that is, the two text graphics are connected at only this one alternative connection point. In this way, it is ensured that the two text graphics are connected through only one alternative connection point, avoiding the connection through multiple alternative connection points, which causes the two text graphics to overlap in a large area and become unclear.
[0062] In some embodiments, according to the order of the user's handwriting, a candidate connection point is selected from the first text graphic to connect with one of the candidate connection points of the second text graphic, another candidate connection point of the second text graphic is connected with one of the candidate connection points of the third text graphic, another candidate connection point of the third text graphic is connected with one of the candidate connection points of the next text graphic, and in this way, one candidate connection point of a text graphic is connected with one candidate connection point of the next text graphic, until one candidate connection point of the n-1th text graphic is connected with one candidate connection point of the nth text graphic. In this way, the text graphics are spliced to obtain a text image that is connected as a whole.
[0063] A candidate connection point of one character graphic is connected to a candidate connection point of the next character graphic, that is, the two candidate connection points are adjacent.
[0064] Optionally, splicing the text graphics according to the font structure to obtain a text image in which the text graphics are connected as one, includes: determining at least two candidate connection points on each text graphic according to the font structure of each text graphic; splicing the text graphics according to the candidate connection points to obtain a plurality of candidate images. Obtaining a text image in which the text graphics are connected as one according to the candidate images. The text graphics in each candidate image are all connected as one.
[0065] Optionally, obtaining a text image in which all text graphics are connected as one according to the candidate images includes: randomly selecting an image from the candidate images to be determined as the text image.
[0066] Optionally, obtaining a text image in which all text graphics are connected as one according to the candidate images includes: selecting an image whose size meets a preset condition from the candidate images and determining it as the text image. The preset condition is that the height of the candidate image is within a first preset range and the width is within a second preset range. When there are multiple candidate images whose sizes meet the preset adjustment, randomly select one from the candidate images that meet the preset condition and determine it as the text image.
[0067] The first preset range is determined according to the height of the touch screen of the electronic device. The second preset range is determined according to the width of the touch screen. In this way, the candidate images that meet the preset conditions can be displayed through the touch screen, ensuring the display effect.
[0068] Because each text graphic has two candidate connection points, and at least one candidate connection point is selected for splicing. Through different permutations and combinations, there will be multiple connection methods. The image formed in each case is determined as an alternative image. The image that meets the preset conditions is selected from the alternative images to be determined as the text image, ensuring the display effect.
[0069] Each text graphic is spliced according to the candidate connection points to obtain the candidate image corresponding to each text graphic. In the candidate image, any candidate connection point is spliced with one candidate connection point of another text graphic only once. In this way, it is ensured that no more than three text graphics are spliced together in the candidate image, and it is also ensured that no two text graphics overlap in a large area.
[0070] The method for optimizing handwriting provided by the embodiment of the present disclosure includes: obtaining a handwriting image input by a user, the handwriting image being an image containing at least two handwritings; performing text recognition on the handwriting image to obtain text information, the text information being used to represent the text in the handwriting image; obtaining text graphics corresponding to each piece of text information; and splicing each text graphics to obtain a text image in which each text graphics is connected as a whole.
[0071] Optionally, after the text graphics are spliced to obtain a text image in which the text graphics are connected together, the method further includes: displaying the text image, for example, displaying the text image through a touch screen of an electronic device.
[0072] Optionally, before obtaining the handwriting image input by the user, the method further includes: obtaining the handwriting image input by the user when it is detected that the user stays on the touch display screen for a time greater than or equal to a preset time length.
[0073] The method for optimizing handwriting provided by the embodiment of the present disclosure is applied to a smart refrigerator, which is provided with a touch display screen. The smart refrigerator obtains handwriting images of at least two handwritings input by the user through the touch display screen. Perform text recognition on each handwriting image to obtain multiple text information. And obtain the text graphics corresponding to each text information. Obtain the font structure corresponding to each text information, determine at least two alternative connection points on each text graphic according to the font structure of each text graphic, select at least one alternative connection point for each text graphic for splicing, and obtain multiple alternative images. Select an image whose size meets the preset conditions from each alternative image and determine it as a text image. And display the text image through the touch display screen. Since the alternative images that meet the preset conditions can be displayed through the touch display screen, it is ensured that the final output text image can also be displayed through the touch display screen, thereby improving the display effect of the optimized artistic characters.
[0074] In some embodiments, the user inputs a message or signature by handwriting through the touch screen of the smart refrigerator. For example, the user inputs the word "Zeng Hua" by handwriting through the touch screen. When the user inputs the last stroke of the word "Hua" and stays for a preset time, the smart refrigerator obtains the handwriting image input by the user. Figure 4 As shown in the figure, the arrow above is the handwriting image of the two characters "Zeng Hua" input by the user. The smart refrigerator performs text recognition on each handwriting image to obtain text information and obtains the text graphics corresponding to each text information. The text graphics are spliced to obtain a text image, such as Figure 4 As shown in the figure, the text image below the arrow is the text image after the handwriting image is optimized. In this way, when the user inputs text on the touch screen of the smart refrigerator, he only needs to pause for a preset time when inputting the last stroke, and the smart refrigerator can automatically transform the input text into artistic words that imitate the user's continuous handwriting, so that the recognized handwriting is both artistic and can truly reflect the user's continuous handwriting style. Provide users with a more personalized and natural artistic word conversion experience.
[0075] Combination Figure 5 As shown, the embodiment of the present disclosure provides a device 500 for optimizing handwriting, including: a handwriting image acquisition module 501, a recognition module 502, a text graphic acquisition module 503 and a splicing module 504. The handwriting image acquisition module 501 is configured to acquire a handwriting image input by a user, and the handwriting image is an image containing at least two handwritings. The recognition module 502 is configured to perform text recognition on the handwriting image to obtain text information, and the text information is used to represent the text in the handwriting image. The text graphic acquisition module 503 is configured to acquire text graphics corresponding to each text information. The splicing module 504 is configured to splice each text graphic to obtain a text image in which each text graphic is connected as a whole.
[0076] The device for optimizing handwriting provided by the embodiment of the present disclosure can identify text information from the handwriting image input by the user, and splice the text graphics corresponding to each text information to obtain a text image in which each text graphics is connected as one. In this way, by connecting the text graphics corresponding to the text input by the user as one, a text image connected as one is obtained, thereby obtaining artistic characters with coherence. In turn, artistic characters that can imitate the user's coherent handwriting are formed. The optimization of artistic character recognition is achieved. The handwriting after recognition is made both artistic and can truly reflect the style of the user's coherent handwriting. It provides users with a more personalized and natural artistic character conversion experience.
[0077] Optionally, the text and graphic acquisition module 503 is configured to acquire the text and graphic corresponding to each text information by matching the text and graphic corresponding to each text information in a preset text and graphic library. The text and graphic library stores text information, text and graphic, and the corresponding relationship between text information and text and graphic.
[0078] Optionally, the splicing module 504 is configured to splice the text graphics to obtain a text image in which the text graphics are connected as one by: obtaining a font structure corresponding to each text information, splicing the text graphics according to the font structure, and obtaining a text image in which the text graphics are connected as one.
[0079] Optionally, the splicing module 504 is configured to splice the text graphics according to the font structure in the following manner: determine at least two candidate connection points on each text graphic according to the font structure of each text graphic, and splice the text graphics according to the candidate connection points.
[0080] Optionally, the splicing module 504 is configured to splice the text graphics according to the candidate connection points in the following manner: select at least one candidate connection point for each text graphic to perform overlapping processing, wherein each candidate connection point is overlapped at most once; the overlapping processing is to overlap two text graphics, and the overlapping area is one candidate connection point in each of the two text graphics. The two text graphics overlap each other at most once.
[0081] Optionally, the splicing module 504 is configured to splice the text graphics according to the alternative connection points in the following manner: select at least one alternative connection point for each text graphic for connection processing, wherein each alternative connection point is connected at most once; the connection processing is to connect two text graphics, and the connection area is an alternative connection point in each of the two text graphics; the two text graphics are connected to each other at most once.
[0082] Combination Figure 6As shown, the embodiment of the present disclosure provides a device 600 for optimizing handwriting, including a processor 604 and a memory 601. Optionally, the device may also include a communication interface 602 and a bus 603. The processor 604, the communication interface 602, and the memory 601 may communicate with each other through the bus 603. The communication interface 602 may be used for information transmission. The processor 604 may call the logic instructions in the memory 601 to execute the method for optimizing handwriting of the above embodiment.
[0083] In addition, the logic instructions in the memory 601 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0084] The memory 601 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 604 executes the function application and data processing by running the program instructions / modules stored in the memory 601, that is, implementing the method for optimizing handwriting in the above embodiment.
[0085] The memory 601 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 601 may include a high-speed random access memory and may also include a non-volatile memory.
[0086] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0087] The present disclosure provides an electronic device, including: an electronic device body, and the above-mentioned device for optimizing handwriting. Figure 7 As shown, the electronic device is a smart refrigerator 100, and the smart refrigerator 100 is provided with a touch display screen 102. The above-mentioned device 500 (600) for optimizing handwriting is installed in the body of the smart refrigerator 100. The installation relationship described here is not limited to placement inside the smart refrigerator, but also includes installation connections with other components of the smart refrigerator, including but not limited to physical connections, electrical connections or signal transmission connections. It can be understood by those skilled in the art that the device for optimizing handwriting can be adapted to a feasible smart refrigerator body, thereby realizing other feasible embodiments.
[0088] In other embodiments, the electronic device is an air conditioner equipped with a touch display screen, etc.
[0089] An embodiment of the present disclosure provides a storage medium storing program instructions, which, when run, execute the above-mentioned method for optimizing handwriting.
[0090] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0091] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0092] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0093] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0094] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for optimizing handwriting, characterized in that: include: Acquire a handwriting image input by a user, wherein the handwriting image is an image containing at least two handwritings; Performing text recognition on the handwriting image to obtain text information, wherein the text information is used to represent the text in the handwriting image; Obtaining text graphics corresponding to each of the text information; The various text graphics are spliced together to obtain a text image in which the various text graphics are connected as one.
2. The method according to claim 1, characterized in that Obtaining the text graphics corresponding to each of the text information includes: The text graphics corresponding to each of the text information are matched in a preset text graphics library; the text graphics library stores the text information, the text graphics, and the corresponding relationship between the text information and the text graphics.
3. The method according to claim 1, characterized in that The text graphics are spliced to obtain a text image in which the text graphics are connected as one, including: Get the font structure corresponding to each text information; The various text graphics are spliced according to the font structure to obtain a text image in which the various text graphics are connected as one.
4. The method according to claim 3, characterized in that The text graphics are spliced according to the font structure, including: Determine at least two candidate connection points on each character graphic according to the font structure of each character graphic; Connect the text graphics according to the alternative connection points.
5. The method according to claim 4, characterized in that Connect the text and graphics according to the alternative connection points, including: Selecting at least one candidate connection point for each character graphic to perform overlapping processing, wherein each candidate connection point is overlapped at most once; The overlapping process is to overlap two text graphics, and the overlapping area is a candidate connection point of each of the two text graphics; the two text graphics overlap each other at most once.
6. The method according to claim 4, characterized in that Connect the text and graphics according to the alternative connection points, including: Selecting at least one candidate connection point for each character graphic to perform connection processing, wherein each candidate connection point is connected once at most; The connection process is to connect two text graphics, and the connection area is a candidate connection point of each of the two text graphics; the two text graphics are connected to each other at most once.
7. A device for optimizing handwriting, characterized in that: include: A handwriting image acquisition module is configured to acquire a handwriting image input by a user, wherein the handwriting image is an image containing at least two handwritings; A recognition module, configured to perform text recognition on the handwriting image to obtain text information, wherein the text information is used to represent the text in the handwriting image; A text and graphic acquisition module is configured to acquire the text and graphic corresponding to each of the text information; The splicing module is configured to splice the text graphics to obtain a text image in which the text graphics are connected into one.
8. A device for optimizing handwriting, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to perform the method for optimizing handwriting as claimed in any one of claims 1 to 6 when executing the program instructions.
9. An electronic device, characterized in that: Comprising the device for optimizing handwriting as described in claim 8.
10. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for optimizing handwriting as described in any one of claims 1 to 6 is executed.
