CN112099645A - Input image generation method and device, electronic equipment and storage medium - Google Patents

Input image generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112099645A
CN112099645A CN202010922078.4A CN202010922078A CN112099645A CN 112099645 A CN112099645 A CN 112099645A CN 202010922078 A CN202010922078 A CN 202010922078A CN 112099645 A CN112099645 A CN 112099645A
Authority
CN
China
Prior art keywords
image
input
character
track
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010922078.4A
Other languages
Chinese (zh)
Inventor
王群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010922078.4A priority Critical patent/CN112099645A/en
Publication of CN112099645A publication Critical patent/CN112099645A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a method and a device for generating an input image, electronic equipment and a storage medium, which relate to the technical field of information interaction, image processing and image identification, and the method comprises the following steps: acquiring an input track image; in the input track image, recognizing a character track area and generating characters matched with character contents in the character track area; and fusing the characters and the input track image to obtain a target fused image. The technical scheme of the embodiment of the application can provide a mode convenient for users to freely generate the input images, can enable the communication content between the users to be more visual, and improves the communication efficiency and reading experience of the users.

Description

Input image generation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of information interaction, image processing, and image recognition technologies, and in particular, to a method and an apparatus for generating an input image, an electronic device, and a storage medium.
Background
With the development of mobile internet technology, the emergence of intelligent terminals such as mobile phones and the like makes communication more and more convenient, and in the communication process, it has become very common to utilize the intelligent terminals to carry out input and output in web pages and applications.
In the process of implementing the invention, the inventor finds that the input method on the intelligent terminal mainly supports the editing of characters and voice and sends the existing contents such as pictures, expressions and the like. However, in some scenes, it may be necessary to input some arbitrary contents to facilitate the presentation and expression of information, and single text or emoticon input is difficult to satisfy the above requirements, and a chat person needs a certain expression skill or can accurately express the information through multiple rounds of interaction, which increases the communication cost among the chat persons and increases the communication time.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating an input image, electronic equipment and a storage medium.
According to a first aspect of embodiments of the present application, there is provided a method for generating an input image, including:
acquiring an input track image;
identifying a character track area in the input track image, and generating characters matched with character contents in the character track area;
and fusing the characters and the input track image to obtain a target fused image.
According to a second aspect of embodiments of the present application, there is provided an input image generation apparatus including:
the input track image acquisition module is used for acquiring an input track image;
the character track area identification module is used for identifying a character track area in the input track image and generating characters matched with the character content in the character track area;
and the target fusion image generation module is used for fusing the characters and the input track image to obtain a target fusion image.
According to a third aspect of embodiments of the present application, there is provided an electronic apparatus, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a method for generating an input image according to any embodiment of the present application.
According to a fourth aspect of embodiments of the present application, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method of generating an input image provided in any of the embodiments of the present application.
According to the technical scheme of the embodiment of the application, the communication freedom degree of the user can be greatly improved, the communication cost is reduced, and the communication efficiency is improved in the input method scene.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a schematic diagram of a method of generating an input image according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a method of generating an input image according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a method of generating an input image according to an embodiment of the present application;
FIG. 4a is a schematic diagram of a method for generating an input image according to an embodiment of the present application;
FIG. 4b is a scene diagram of a method for generating an input image, which can implement the embodiments of the present application;
FIG. 4c is a scene diagram of a method for generating an input image that can implement the embodiments of the present application;
FIG. 4d is a scene diagram of a method for generating an input image, which can implement the embodiment of the present application;
FIG. 4e is a scene diagram of a method for generating an input image, according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an apparatus for generating an input image according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device for implementing the method for generating an input image according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of a method for generating an input image according to an embodiment of the present application, where the method is applicable to a case where a user generates an input image by manually drawing, and the method may be performed by an apparatus for generating an input image, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device with a trace image input function, where the method specifically includes the following steps:
and step 110, acquiring an input track image.
In this step, the user can freely draw various tracks in the track image input interface provided by the electronic equipment to form specific information carriers such as graphics, characters or expressions.
Accordingly, when the input method detects that the user performs continuous track input operation in the track image input interface (for example, by touching, or by mouse clicking and sliding), the sliding track of the user in the input interface is acquired, and the input track image is generated according to the continuous sliding track.
And 120, identifying a character track area in the input track image, and generating characters matched with the character content in the character track area.
In this step, optionally, an image recognition technology may be used to recognize a text track area included in the input track image, and then an optical character recognition technology may be used to recognize text contents included in the text track area and generate text matching the text contents.
The text may refer to text content with a standard font or a standard font size, where the standard font or the standard font size includes a standard font or a standard font size with a high use frequency and other fonts or font sizes with a low use frequency, and the font size of the text may be set by a user.
Therefore, by identifying the character track area and generating the matched characters, the normalized display of the character content in the input track image can be realized, and the reading experience of the user is improved.
It should be emphasized again that, although the present application embodiment opens the authority of the user to freely input the required content, the user may input various tracks with the maximum degree of freedom to form graphics and characters, in order to ensure the regularity of the input track image to the maximum extent, facilitate the viewing of the information receiving party, or the viewing of the user himself, the present application creatively proposes to perform the normalization processing of the text content on the input track image, and ensure the readability (or identifiability) and the normalization of the characters while ensuring the user to freely input various graphics, thereby reducing the occurrence of ambiguity to the maximum extent.
And step 130, fusing the characters and the input track image to obtain a target fused image.
The image fusion refers to that image data which are collected by a multi-source channel and related to the same target are processed by an image processing technology, a computer technology and the like, so that favorable information in each channel is extracted to the maximum extent, and finally, the favorable information is synthesized into a high-quality image. In this embodiment, the text is a regularized expression in the text track region in the input track image, and the regularization of the target fusion image can be ensured to the greatest extent by fusing the text with the input track image on the basis of ensuring the input freedom of the user.
In this step, optionally, the characters may be correspondingly covered on the character track area in the input track image to obtain the target fusion image, so as to implement replacement of the character track area in the input track image by using the characters.
That is, the target fusion image includes various graphics freely drawn by the user and the text content in the standard format customized by the user.
According to the method and the device, the input track image is obtained, the character track area is identified in the input track image, the characters matched with the character content in the character track area are generated, the characters and the input track image are fused, and the target fused image is obtained.
The embodiment of the present application provides an alternative implementation for acquiring an input track image on the basis of the above embodiment. The same or corresponding terms as those of the above embodiments are explained, and the embodiments of the present application are not described in detail.
Fig. 2 is a flowchart of a method for generating an input image according to an embodiment of the present disclosure, where the method specifically includes the following steps:
step 210, obtaining an input trace image in response to the interaction trace received in real time in the drawing canvas.
In this step, the drawing canvas is an interface for the user to draw the input image, and the drawing canvas can provide the user with the functions of adjusting the size of the brush, setting the color of the brush, erasing the rubber and the like.
Therefore, when a user wants to draw an input image, different drawing requirements of the user can be met by setting the exclusive drawing canvas, the input track image of the user can be conveniently obtained, and the obtaining efficiency of the input track image is improved.
In this embodiment, optionally, a touch trajectory or a cursor sliding trajectory in the drawing canvas may be used as an interaction trajectory, and the continuous interaction trajectories are connected to generate an input trajectory image.
And step 220, identifying a character track area in the input track image, and generating characters matched with the character content in the character track area.
In one implementation manner of the embodiment of the present application, recognizing a text track area in an input track image includes: and if the input track image is detected not to be changed within the set time length, identifying a character track area in the input track image.
Optionally, when it is detected that no touch operation or no cursor sliding occurs in the drawing canvas within the set time length, it may be determined that the input track image is not changed.
The advantages of such an arrangement are: the problem that in the process of changing the input track image, the recognition result is wrong due to the fact that the character track area is recognized is solved, and therefore the accuracy rate of recognizing the character track area can be improved.
And step 230, fusing the characters and the input track image to obtain a target fused image.
In this embodiment, optionally, after the fusing the text and the input track image to obtain the target fused image, the method may further include: in the drawing canvas, the display target fusion image is updated.
The benefits of this arrangement are: the user can conveniently check the generated target fusion image before inputting the image, and the problem that the communication content is deviated due to character generation errors is avoided.
The embodiment of the application acquires the input track image by responding to the interactive track received in real time in the drawing canvas, identifies the character track area in the input track image, generates characters matched with the character content in the character track area, fuses the characters and the input track image, and obtains the technical means of target fusion image.
On the basis of the above embodiments, before acquiring the input trace image in response to the interaction trace received in real time in the drawing canvas, the method further includes:
and responding to the image editing instruction, transmitting the image to be edited matched with the image editing instruction to the drawing canvas, and displaying the drawing canvas.
If the user finds that the image close to the idea which the user wants to express is locally stored in the communication process or the image which is input is required to be edited again, the user can select the image to be edited by means of screenshot or directly selecting the image, then an image editing option is provided for the image selected by the user, when the user selects the image editing option, an image editing instruction is triggered to be generated, the image to be edited is transmitted to the drawing canvas, and the drawing canvas is displayed.
The benefits of this arrangement are: the drawing process of the user is simplified, the time consumed by the user for redrawing is saved, and the communication efficiency of the user is improved.
On the basis of the above embodiments, generating an input trajectory image in response to an interaction trajectory received in real time in the drawing canvas may include: responding to an interaction track received in real time in the drawing canvas, and acquiring an action pixel position of the interaction track in the drawing canvas; and updating the pixel matrix matched with the drawing canvas according to the action pixel position, and generating an input track image according to the updated pixel matrix.
Wherein, the effect pixel position is the position of every pixel point in the drawing canvas on the mutual orbit, and is optional, can be according to the current brush colour that effect pixel position and user selected in the drawing canvas, the pixel matrix that updates and drawing canvas matches, according to the colour value of each pixel point in the pixel matrix after the update, generates input orbit image.
The benefits of this arrangement are: the drawing requirements of the user are met, and the drawing experience of the user is improved.
The drawing canvas can correspond to a pixel matrix, different positions in the drawing canvas correspond to pixel values of different pixel points in the pixel matrix, and then when a user draws an input track on the drawing canvas, the pixel values of the corresponding positions in the pixel matrix can be correspondingly adjusted so as to finally represent the input track image of the user through the pixel matrix.
Optionally, updating the pixel matrix matched with the drawing canvas according to the active pixel position may include: and setting the color value of each pixel point at the action pixel position as the drawing color in the pixel matrix matched with the drawing canvas.
Wherein the drawing color may be a current brush color selected by the user, different from a background color of the drawing canvas.
The benefits of this arrangement are: the color value of the input track image is distinguished from the background color value of the drawing canvas, so that the input track image can be conveniently and rapidly acquired.
On the basis of the above embodiments, the embodiment of the present application provides an optional implementation manner for acquiring an input track image and recognizing a character track area, and generating a matched character. The same or corresponding terms as those of the above embodiments are explained, and the embodiments of the present application are not described in detail.
Fig. 3 is a flowchart of a method for generating an input image according to an embodiment of the present disclosure, where the method specifically includes the following steps:
and step 310, acquiring an input track image in an input interface of the input method.
In this step, the input method is an encoding method adopted to input various symbols into an electronic device, and the electronic device may be a computer or other intelligent terminal, such as a mobile phone, a tablet, and the like. Generally, when a user interacts information with other users through a chat application in an electronic device, a native input method carried by the system or an installed input method application is needed to realize the input of the information.
The input interface of the input method specifically refers to an interface for inputting information by a user, and the input interface can display different types of auxiliary input controls according to an information input form selected by the user, such as a handwriting input board, a nine-grid keyboard or a full keyboard.
In the embodiment, the input form of the input method is expanded, and the user can input the track image freely drawn by the user through the input interface provided by the input method.
In an alternative embodiment, if the user wants to draw an input image during the process of information interaction with others through the chat software, for example: in a certain customized window style, a function of drawing an image can be selected in a setting column of an input method, and the image can be drawn through a drawing area or a drawing control provided by an input method input interface.
In an implementation manner of the embodiment of the present application, acquiring, in an input interface of an input method, an input trajectory image may include: displaying a drawing canvas in an input interface of the input method; generating the input trace image in response to an interaction trace received in real-time in the drawing canvas.
The displaying of the drawing canvas in the input interface of the input method may include: and displaying the drawing canvas in response to a drawing input instruction received in an input interface of the input method.
The benefits of this arrangement are: the drawing canvas is prevented from being always displayed in the input interface, and the visual experience of a user is reduced.
Optionally, the input method may add an option of a drawing input form on the basis of an existing information input form (handwriting, squared figure or full keyboard, etc.), and when a user selects a button or a control for using drawing input, the input method triggers generation of the drawing input instruction, and then a drawing canvas for receiving user trajectory data is displayed in an input interface of the input method.
And step 320, inputting the input track image into a pre-trained character area recognition engine, and acquiring a character track area according to an output result of the character area recognition engine.
The character track area recognition engine is used for recognizing the position and the size value of the character track area in the input image.
In this step, after the input track image is input to the character area recognition engine, the character area recognition engine recognizes the suspected character according to the input track image, calculates a minimum rectangular area covered by the suspected character in the input track image, uses the rectangular area as a character track area corresponding to the input track image, and outputs the length, width, and coordinates of the character track area.
Before an input track image is input to a character area recognition engine, a plurality of image samples carrying character content are obtained, the plurality of image samples are divided into a training data set and a testing data set, and a neural network model is subjected to iterative training by using the training data set and the testing data set to obtain the character area recognition engine.
The advantages of such an arrangement are: the accuracy of character track area identification is guaranteed, and a technical basis is provided for subsequent character identification.
In this embodiment, optionally, the text region recognition engine is configured in the client.
The advantages of such an arrangement are: the client has the function of recognizing the character track area, frequent interaction between the client and the server is avoided, and the recognition efficiency of the character track area is improved.
Step 330, inputting the text track area into the optical character recognition analyzer, obtaining text content corresponding to the text track area, and generating text corresponding to the text content.
In this step, an optical character recognition parser is used to recognize the text included in the text track area.
The advantages of such an arrangement are: the accuracy of character recognition is guaranteed, and the communication efficiency between users is improved.
And 340, fusing the characters and the input track image to obtain a target fused image.
According to the method, the input track image is acquired in the input interface of the input method, the input track image is input into the pre-trained character area recognition engine, the character track area is acquired according to the output result of the character area recognition engine, the character track area is input into the optical character recognition analyzer, the character content corresponding to the character track area is acquired, the characters corresponding to the character content are generated, the characters and the input track image are fused, and the target fused image is obtained.
On the basis of the above embodiments, after the characters are fused with the input track image to obtain the target fused image, the method further includes: in response to the image selection instruction, dragging the target fusion image to an information input box of the chat application adapted to the input method; and responding to the information sending instruction, and sending the target fusion image in the information input box to the matched target chatting party.
And when an information sending instruction triggered by the user is detected, the target fusion image is sent to the target chatting party.
The advantages of such an arrangement are: the user can check whether the target fusion image is correct or not before sending the target fusion image, and therefore the accuracy of the communication content is guaranteed.
The embodiment of the present application provides an optional implementation manner for fusing the text and the input track image to obtain the target fused image based on the above embodiment. The same or corresponding terms as those of the above embodiments are explained, and the embodiments of the present application are not described in detail.
Fig. 4a is a flowchart of a method for generating an input image according to an embodiment of the present application, where the method specifically includes the following steps:
and step 410, acquiring an input track image.
And step 420, identifying a character track area in the input track image, and generating characters matched with the character content in the character track area.
And step 430, generating a text layer corresponding to the text.
And 440, carrying out scaling processing on the character layer according to the size proportional relation between the character layer and the character track area.
In this step, optionally, the size of the text layer may be adjusted according to a size proportional relationship between the text layer and the text track area. For example, when the length or width of the text layer is greater than the length or width of the text track area, the font of the text in the text layer is reduced to a font matching the size of the text track area.
The advantages of such an arrangement are: the size of the characters in the character layer is ensured to be closer to the size of the characters actually input by a user, and the authenticity of a subsequently generated target fusion image is improved.
And step 450, replacing the character track area in the input track image by using the character layer after the scaling processing to obtain a target fusion image.
In this step, optionally, the pixel value of each pixel point in the text layer may be obtained, and the pixel value of each pixel point in the text layer is used to replace the pixel value of the pixel point at the corresponding position in the text track region, so as to obtain the target fusion image.
The advantages of such an arrangement are: the attractiveness of the target fusion image is guaranteed, and the reading experience of a user is improved.
In an implementation manner of the embodiment of the present application, replacing a text track area in an input track image with a text layer after scaling processing to obtain the target fusion image includes: restoring the color value of each pixel point in the character track area in the input track image into the area color value in the character track area; and filling the character layer matched with the character track area in the character track area.
Wherein, regional colour value in the characters orbit region is the background colour value in characters orbit region, with the colour value of each pixel in the characters orbit region, resume to the regional colour value in characters orbit region after, characters in the characters orbit region are then emptied, then will match the characters picture layer, fill in characters orbit region, can accomplish the characters picture layer to the regional replacement of characters orbit.
The advantages of such an arrangement are: by emptying the characters in the character track area, a good replacing effect can be ensured; secondly, the character layer is directly filled in the character track area, so that the character track area can be replaced by the character layer quickly, and the replacement efficiency is improved.
According to the embodiment of the application, the input track image is obtained, the character track area is identified in the input track image, the characters matched with the character contents in the character track area are generated, the character layer corresponding to the characters is generated, the character layer is subjected to scaling processing according to the size proportional relation between the character layer and the character track area, the character layer subjected to scaling processing is used for replacing the character track area in the input track image, and the technical means of the target fusion image is obtained.
In order to better introduce the technical solution provided by the embodiment of the present application, the embodiment of the present application provides an implementation manner in which a user freely generates an input image when interacting with other users through a chat application:
step 1: the method comprises the steps that a user triggers a drawing input instruction in an input interface of an input method, the input method displays a drawing canvas, or the user selects an image to be edited by triggering an image editing function in the input interface of the input method, the input method copies the selected image to be edited to a clipboard, and the image to be edited is transmitted to the drawing canvas through the clipboard, wherein the drawing canvas is used for displaying trajectory data drawn by the user.
Step 2: the user records the contact movement track in the drawing canvas by means of touch screen or mouse drawing, and the drawing canvas 401 is a blank area below the text input box 402, as shown in fig. 4 b. According to the position of each pixel point on the contact moving track, setting the color value of the pixel point on the corresponding position in the drawing canvas into the drawing color (pen-touch color), acquiring the pixel matrix corresponding to the whole drawing canvas, and transmitting the pixel matrix to the step 3 after the track image drawn by the user is stable.
And step 3: and identifying and calculating a rectangular area covered by the suspected characters in the track image through an online reasoning engine according to the pixel matrix corresponding to the drawing canvas.
And 4, step 4: inputting the rectangular area in the step 3 into an optical character recognition analyzer, recognizing characters included in the rectangular area through the optical character recognition analyzer, converting the characters included in the rectangular area into characters with a set character format, and calling the characters with the set character format as font characters.
And 5: replacing the corresponding rectangular area in the track image with the font characters generated in the step 4: in order to adjust the size of the font characters, an independent image layer can be generated for each section of font characters, the color of each pixel point in the corresponding rectangular area is emptied into the background color in the rectangular area, the font characters are arranged in the rectangular area, default font sizes are preferentially adopted for the font characters, and the font sizes of the font characters are scaled according to the size of the rectangular area. If the width or height of the font characters exceeds the width or height of the rectangular area, the font size of the font characters is reduced to be not more than the font size of the rectangular area according to the size of the rectangular area. And after the font characters are automatically adjusted, combining the track image and the font characters to generate a picture to be input. As shown in fig. 4c, after the user draws an input image in the drawing canvas 401, the input method inputs the generated to-be-input picture into the text input box 402.
Step 6: and 5, taking the picture to be input generated in the step 5 as the input of the target anchor point, and transferring the picture to be input to a corresponding position. As shown in fig. 4d, after the user selects the picture to be input in the text input box 402, the picture to be input is sent to the target chat party.
In the embodiment of the application, the user can select the image on the screen in the input interface of the input method for editing again. As shown in fig. 4e, the user may edit again in the drawing canvas 401 after selecting the image on the current chat interface 403.
The method provided by the embodiment of the application can enable the communication content between users to be more visual, greatly expands the functions of the input method, improves the communication freedom of the users, and improves the communication efficiency while reducing the communication cost.
Fig. 5 is a block diagram of an input image generation apparatus 500 according to an embodiment of the present application, where the apparatus includes: an input track image acquisition module 510, a character track area recognition module 520 and a target fusion image generation module 530.
The input track image acquiring module 510 is configured to acquire an input track image;
a text track area identification module 520, configured to identify a text track area in the input track image, and generate a text that matches text content in the text track area;
and a target fusion image generation module 530, configured to fuse the text with the input track image to obtain a target fusion image.
According to the method and the device, the input track image is obtained, the character track area is identified in the input track image, the characters matched with the character content in the character track area are generated, the characters and the input track image are fused, and the target fused image is obtained.
On the basis of the foregoing embodiments, the input track image obtaining module 510 may include:
the interactive track response unit is used for responding to an interactive track received in real time in the drawing canvas, and acquiring the input track image;
the drawing canvas display subunit is used for responding to an image editing instruction, transmitting an image to be edited matched with the image editing instruction to the drawing canvas, and displaying the drawing canvas;
and the input interface processing unit is used for acquiring an input track image in an input interface of the input method.
The text track area identifying module 520 may include:
the input track image detection unit is used for identifying a character track area in the input track image when detecting that the input track image is not changed within a set time length;
the input track image input unit is used for inputting the input track image into a pre-trained character area recognition engine and acquiring the character track area according to the output result of the character area recognition engine; the character track area identification engine is used for identifying the position and the size value of a character track area in an input image; the character area recognition engine is configured in the client;
and the character track area input unit is used for inputting the character track area into an optical character recognition analyzer, acquiring character contents corresponding to the character track area and generating characters corresponding to the character contents.
The target fusion image generation module 530 may include:
the target fusion image updating and displaying unit is used for updating and displaying the target fusion image in the drawing canvas;
a text layer generating unit, configured to generate a text layer corresponding to the text;
the character layer scaling unit is used for scaling the character layer according to the size proportional relation between the character layer and the character track area;
a text track area replacing unit, configured to replace a text track area in the input track image with the scaled text layer, so as to obtain the target fusion image;
a color value restoring subunit, configured to restore the color value of each pixel point in the text track region in the input track image to an area color value in the text track region;
the character layer filling subunit is used for filling the character layer matched with the character track area in the character track area;
the target fusion image dragging unit is used for responding to an image selection instruction and dragging the target fusion image to an information input box of the chat application adapted to the input method;
and the target fusion image sending unit is used for responding to an information sending instruction and sending the target fusion image in the information input box to the matched target chatting party.
The device for generating the input image, provided by the embodiment of the application, can execute the method for generating the input image, provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 6, the present invention is a block diagram of an electronic device according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the method for generating an input image provided herein. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the method of generating an input image provided by the present application.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method of generating an input image in the embodiment of the present application (for example, the input trajectory image acquisition module 510, the text trajectory region identification module 520, and the target fusion image generation module 530 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing, i.e., implementing the generation method of the input image in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device of the generation method of the input image, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory remotely located from the processor 601, and these remote memories may be connected over a network to the electronic device of the method of generating the input image. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the generation method of the input image may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the generation method of the input image, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the communication content between the users can be more visual, and the communication efficiency of the users is improved; secondly, by identifying the character track area and generating corresponding characters, the standardization of character contents in the input image can be realized, and the reading experience of a user is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions of the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (24)

1. A method of generating an input image, comprising:
acquiring an input track image;
identifying a character track area in the input track image, and generating characters matched with character contents in the character track area;
and fusing the characters and the input track image to obtain a target fused image.
2. The method of claim 1, wherein acquiring an input trajectory image comprises:
and responding to the interactive track received in real time in the drawing canvas, and acquiring the input track image.
3. The method of claim 2, wherein prior to acquiring the input trace image in response to the interaction trace received in real-time in the drawing canvas, further comprising:
and responding to an image editing instruction, transmitting the image to be edited matched with the image editing instruction to a drawing canvas, and displaying the drawing canvas.
4. The method of claim 2, wherein identifying a text track area in the input track image comprises:
if the input track image is detected not to be changed within the set time length, identifying a character track area in the input track image;
after the characters are fused with the input track image to obtain a target fusion image, the method further comprises the following steps:
and updating and displaying the target fusion image in the drawing canvas.
5. The method of claim 1, identifying a text track area in the input track image, comprising:
inputting the input track image into a pre-trained character area recognition engine, and acquiring the character track area according to an output result of the character area recognition engine;
the character track area identification engine is used for identifying the position and the size value of the character track area in the input image.
6. The method of claim 5, wherein the text region recognition engine is configured in the client.
7. The method of claim 1, wherein generating text that matches text content in the text track region comprises:
and inputting the character track area into an optical character recognition analyzer, acquiring character contents corresponding to the character track area, and generating characters corresponding to the character contents.
8. The method of claim 1, wherein fusing the text with the input track image to obtain a target fused image comprises:
generating a character layer corresponding to the characters;
carrying out scaling processing on the character layer according to the size proportional relation between the character layer and the character track area;
and replacing the character track area in the input track image by using the character layer after the scaling treatment to obtain the target fusion image.
9. The method according to claim 8, wherein replacing a text track area in the input track image with the scaled text layer to obtain the target fused image comprises:
restoring the color value of each pixel point in the character track area in the input track image into the area color value in the character track area;
and filling the character layer matched with the character track area in the character track area.
10. The method of any of claims 1-9, wherein acquiring an input trajectory image comprises:
and acquiring an input track image in an input interface of the input method.
11. The method of claim 10, wherein after fusing the text with the input track image to obtain a target fused image, further comprising:
in response to an image selection instruction, dragging the target fusion image to an information input box of the chat application adapted to the input method;
and responding to an information sending instruction, and sending the target fusion image in the information input box to a matched target chatting party.
12. An input image generation apparatus comprising:
the input track image acquisition module is used for acquiring an input track image;
the character track area identification module is used for identifying a character track area in the input track image and generating characters matched with the character content in the character track area;
and the target fusion image generation module is used for fusing the characters and the input track image to obtain a target fusion image.
13. The apparatus of claim 12, the input trajectory image acquisition module, comprising:
and the interaction track response unit is used for responding to the interaction track received in real time in the drawing canvas, and acquiring the input track image.
14. The apparatus of claim 13, the interaction trajectory response unit, further comprising:
and the drawing canvas display subunit is used for responding to an image editing instruction, transmitting the image to be edited matched with the image editing instruction to the drawing canvas, and displaying the drawing canvas.
15. The apparatus of claim 13, the text track area identification module, comprising:
the input track image detection unit is used for identifying a character track area in the input track image when detecting that the input track image is not changed within a set time length;
the target fusion image generation module comprises:
and the target fusion image updating and displaying unit is used for updating and displaying the target fusion image in the drawing canvas.
16. The apparatus of claim 12, the text track area identification module, further comprising:
the input track image input unit is used for inputting the input track image into a pre-trained character area recognition engine and acquiring the character track area according to the output result of the character area recognition engine;
the character track area identification engine is used for identifying the position and the size value of the character track area in the input image.
17. The apparatus of claim 16, the text region recognition engine configured in a client.
18. The apparatus of claim 12, the text track area identification module, comprising:
and the character track area input unit is used for inputting the character track area into an optical character recognition analyzer, acquiring character contents corresponding to the character track area and generating characters corresponding to the character contents.
19. The apparatus of claim 12, the target fusion image generation module, comprising:
a text layer generating unit, configured to generate a text layer corresponding to the text;
the character layer scaling unit is used for scaling the character layer according to the size proportional relation between the character layer and the character track area;
and the character track area replacing unit is used for replacing the character track area in the input track image by using the character layer after the zooming processing to obtain the target fusion image.
20. The apparatus of claim 19, the text track area replacement unit, comprising:
a color value restoring subunit, configured to restore the color value of each pixel point in the text track region in the input track image to an area color value in the text track region;
and the character layer filling subunit is used for filling the character layer matched with the character track area in the character track area.
21. The apparatus of any one of claims 12-20, wherein the input trajectory image acquisition module comprises:
and the input interface processing unit is used for acquiring an input track image in an input interface of the input method.
22. The apparatus of claim 21, the target fusion image generation module, comprising:
the target fusion image dragging unit is used for responding to an image selection instruction and dragging the target fusion image to an information input box of the chat application adapted to the input method;
and the target fusion image sending unit is used for responding to an information sending instruction and sending the target fusion image in the information input box to the matched target chatting party.
23. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
CN202010922078.4A 2020-09-04 2020-09-04 Input image generation method and device, electronic equipment and storage medium Pending CN112099645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010922078.4A CN112099645A (en) 2020-09-04 2020-09-04 Input image generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010922078.4A CN112099645A (en) 2020-09-04 2020-09-04 Input image generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112099645A true CN112099645A (en) 2020-12-18

Family

ID=73757747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010922078.4A Pending CN112099645A (en) 2020-09-04 2020-09-04 Input image generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112099645A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861471A (en) * 2021-02-10 2021-05-28 上海臣星软件技术有限公司 Object display method, device, equipment and storage medium
CN112907496A (en) * 2021-02-24 2021-06-04 嘉楠明芯(北京)科技有限公司 Image fusion method and device
CN113204283A (en) * 2021-04-30 2021-08-03 Oppo广东移动通信有限公司 Text input method, text input device, storage medium and electronic equipment
CN114092945A (en) * 2022-01-21 2022-02-25 广州文石信息科技有限公司 Handwriting input method and device based on ink screen
CN115494966A (en) * 2021-06-18 2022-12-20 北京搜狗科技发展有限公司 Rendering processing method, device and machine readable medium
CN116389227A (en) * 2023-03-23 2023-07-04 江苏锦花电子股份有限公司 Intelligent early warning system and method based on Internet of things

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138756A1 (en) * 2008-12-01 2010-06-03 Palo Alto Research Center Incorporated System and method for synchronized authoring and access of chat and graphics
CN102426568A (en) * 2011-10-04 2012-04-25 上海量明科技发展有限公司 Instant messaging text information picture editing method, client and system
CN103412677A (en) * 2013-08-05 2013-11-27 广东欧珀移动通信有限公司 Method and device for hand-painted content recognition
CN104267838A (en) * 2014-10-22 2015-01-07 陈华 Intelligent handwriting input method and input system
CN107273032A (en) * 2017-06-28 2017-10-20 广州视源电子科技股份有限公司 Information composition method, device, equipment and computer-readable storage medium
CN110764627A (en) * 2018-07-25 2020-02-07 北京搜狗科技发展有限公司 Input method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138756A1 (en) * 2008-12-01 2010-06-03 Palo Alto Research Center Incorporated System and method for synchronized authoring and access of chat and graphics
CN102426568A (en) * 2011-10-04 2012-04-25 上海量明科技发展有限公司 Instant messaging text information picture editing method, client and system
CN103412677A (en) * 2013-08-05 2013-11-27 广东欧珀移动通信有限公司 Method and device for hand-painted content recognition
CN104267838A (en) * 2014-10-22 2015-01-07 陈华 Intelligent handwriting input method and input system
CN107273032A (en) * 2017-06-28 2017-10-20 广州视源电子科技股份有限公司 Information composition method, device, equipment and computer-readable storage medium
CN110764627A (en) * 2018-07-25 2020-02-07 北京搜狗科技发展有限公司 Input method and device and electronic equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112861471A (en) * 2021-02-10 2021-05-28 上海臣星软件技术有限公司 Object display method, device, equipment and storage medium
CN112907496A (en) * 2021-02-24 2021-06-04 嘉楠明芯(北京)科技有限公司 Image fusion method and device
CN113204283A (en) * 2021-04-30 2021-08-03 Oppo广东移动通信有限公司 Text input method, text input device, storage medium and electronic equipment
CN115494966A (en) * 2021-06-18 2022-12-20 北京搜狗科技发展有限公司 Rendering processing method, device and machine readable medium
CN114092945A (en) * 2022-01-21 2022-02-25 广州文石信息科技有限公司 Handwriting input method and device based on ink screen
CN114092945B (en) * 2022-01-21 2022-04-19 广州文石信息科技有限公司 Handwriting input method and device based on ink screen
CN116389227A (en) * 2023-03-23 2023-07-04 江苏锦花电子股份有限公司 Intelligent early warning system and method based on Internet of things
CN116389227B (en) * 2023-03-23 2023-11-17 江苏锦花电子股份有限公司 Intelligent early warning system and method based on Internet of things

Similar Documents

Publication Publication Date Title
CN112099645A (en) Input image generation method and device, electronic equipment and storage medium
EP3843031A2 (en) Face super-resolution realization method and apparatus, electronic device and storage medium
CN111107392A (en) Video processing method and device and electronic equipment
CN111709875B (en) Image processing method, device, electronic equipment and storage medium
CN112001169B (en) Text error correction method and device, electronic equipment and readable storage medium
CN111259183B (en) Image recognition method and device, electronic equipment and medium
CN111860362A (en) Method and device for generating human face image correction model and correcting human face image
CN111913585A (en) Gesture recognition method, device, equipment and storage medium
CN111241810A (en) Punctuation prediction method and device
CN112527115A (en) User image generation method, related device and computer program product
CN111695518A (en) Method and device for labeling structured document information and electronic equipment
CN112036315A (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN114245155A (en) Live broadcast method and device and electronic equipment
CN113313027A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112380566A (en) Method, apparatus, electronic device, and medium for desensitizing document image
CN111199802A (en) Electronic medical record data mining method, device, equipment and medium
CN115101069A (en) Voice control method, device, equipment, storage medium and program product
CN112508964B (en) Image segmentation method, device, electronic equipment and storage medium
CN110727383A (en) Touch interaction method and device based on small program, electronic equipment and storage medium
CN111861954A (en) Method and device for editing human face, electronic equipment and readable storage medium
CN111638787A (en) Method and device for displaying information
CN111783600A (en) Face recognition model training method, device, equipment and medium
CN111352685B (en) Display method, device, equipment and storage medium of input method keyboard
CN114065783A (en) Text translation method, device, electronic equipment and medium
CN112000828B (en) Method, device, electronic equipment and readable storage medium for searching expression picture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination