Image processing method, device and electronic equipment
By identifying text areas and adjusting edges according to user input operations, the problem of missing or redundant text in text recognition is solved, and the accuracy and efficiency of recording wrong questions are improved.
Patent Information
- Application Number
- CN201911360998.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-05-30
AI Technical Summary
When students record wrong questions, due to the camera angle, it is difficult for the text recognition system to accurately identify the text area, which often results in missing or redundant text, requiring users to manually modify it, and the accuracy is low.
By identifying the text area in the target image and obtaining the target area with the text direction parallel to the edge of the area based on user input operations, text or image processing is performed to ensure text integrity and avoid missing or redundant text.
It improves the accuracy and efficiency of text or image processing, reduces the need for manual modification by users, and improves the accuracy of recording wrong questions.
Smart Images

Figure CN111144288B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text recognition, and in particular to an image processing method, device and electronic device. Background Art
[0002] In order to consolidate knowledge points during the learning process, students need to record wrong questions that occur during the learning process. However, students manually copy wrong questions from books into wrong question books or record them into computers, which often leads to low efficiency in wrong question recording.
[0003] To this end, currently a method is adopted in which a photo of a document such as a book is taken, and then the user selects the image area of the wrong question, and then the wrong question in the area selected by the user is obtained through text recognition.
[0004] However, in this method, due to the problem of shooting angle, there is often a situation where text is missing or there is redundant text content in the area selected by the user. Therefore, the identified wrong questions still need to be manually modified by the user, resulting in low accuracy. Summary of the invention
[0005] In view of this, the present application provides an image processing method, device and electronic device as follows:
[0006] An image processing method, comprising:
[0007] Identify a text area in a target image, wherein the target image is an image acquired by capturing an image of a document, and a direction of text in the text area is not parallel to an image edge of the target image;
[0008] According to the input operation on the target image, a target area in the text area is obtained, wherein the target area is a quadrilateral, and a text direction in the target area is parallel to an area edge of the target area;
[0009] The text or image corresponding to the target area is processed.
[0010] In the above method, preferably, obtaining the target area in the text area according to the input operation on the target image includes:
[0011] In the text area, determining at least one line of first text corresponding to the input operation;
[0012] According to the text direction of the first text, a target area corresponding to the input operation of the target image is divided in the text area, and the text direction of the first text is parallel to the area edge of the target area.
[0013] In the above method, preferably, obtaining the target area in the text area according to the input operation on the target image includes:
[0014] In the text area, determining a starting line of text corresponding to the input operation;
[0015] According to the text direction of the starting line of text, determining, in the text area, a starting edge line parallel to the text direction of the starting line of text;
[0016] Obtain the end line text corresponding to the input operation in the text area;
[0017] According to the text direction of the end line of text, determining, in the text area, an end edge line parallel to the text direction of the end line of text;
[0018] A target area is obtained according to the starting edge line and the ending edge line.
[0019] In the above method, preferably, when the area edge of the target area overlaps with a line of second text in the text area, the method further comprises:
[0020] The region edge of the target region is adjusted so that the region edge of the target region is located at one side of the second text in the text region.
[0021] The above method preferably processes the text or image corresponding to the target area, including:
[0022] In the target image, obtaining a text image corresponding to the target area;
[0023] The text image is transmitted.
[0024] The above method preferably processes the text or image corresponding to the target area, including:
[0025] Perform text recognition on the target area to obtain text content in the target area.
[0026] The above method preferably further comprises:
[0027] Modifying at least one character in the text content;
[0028] The target area is modified according to the text content after the characters are modified, so that the target image includes the modified target area.
[0029] Preferably, the above method further comprises, before processing the text or image corresponding to the target area:
[0030] The target area is deformed so that the target area is rectangular.
[0031] An image processing device, comprising:
[0032] An image recognition unit, used for recognizing a text area in a target image, wherein the target image is an image acquired by capturing an image of a document, and a direction of text in the text area is not parallel to an image edge of the target image;
[0033] A region obtaining unit, configured to obtain a target region in the text region according to an input operation on the target image, wherein the target region is a quadrilateral, and a text direction in the target region is parallel to a region edge of the target region;
[0034] The area processing unit is used to process the text or image corresponding to the target area.
[0035] An electronic device, comprising:
[0036] An image collector is used to collect images of a document to obtain a target image, wherein a text direction of a text area in the target image is not parallel to an image edge of the target image;
[0037] A processor is used to identify a text area in the target image, obtain a target area in the text area according to an input operation on the target image, wherein the target area is a quadrilateral, and the text direction in the target area is parallel to the area edge of the target area, and process the text or image corresponding to the target area.
[0038] It can be seen from the above technical solutions that the image processing method, device and electronic device disclosed in the present application, in the target image obtained by image acquisition of the document, the image edge of the target image is non-parallel to the text direction of the text area in the target image. In the present application, the text area in the target image is identified, and then the target area in which the text direction in the text area is parallel to the area edge is obtained according to the input operation on the target image, and then the target area is processed, such as processing the text or image. It can be seen that in the present application, when the document image is recognized, the target area corresponding to the input operation is divided according to the text direction in the text area, so that the text direction in the divided target area is parallel to the area edge, thereby ensuring the integrity of the text in the text area in the text direction, thereby avoiding the situation where the text in the target area for text or image processing is missing or redundant, thereby improving the accuracy of text or image processing on the target area. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A flowchart of an image processing method provided in Embodiment 1 of the present application;
[0041] Figure 2-Figure 21 They are respectively example diagrams of image processing performed in the embodiments of the present application;
[0042] Fig. 22 A schematic diagram of the structure of an image processing device provided in Embodiment 2 of the present application;
[0043] Fig.23 A schematic diagram of the structure of an electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] refer to Figure 1 As shown, it is a flowchart of an implementation of an image processing method provided in the first embodiment of the present application, and the method is applicable to electronic devices capable of image acquisition and image processing, such as scanners, mobile phones, pads or cameras. The method in this embodiment is mainly used to identify the integrity of the text area in the document image, so as to improve the accuracy of text or image processing.
[0046] Specifically, the method in this embodiment may include the following steps:
[0047] Step 101: Identify the text area in the target image.
[0048] Among them, the target image is the image obtained by collecting the image of the document, such as Figure 2 As shown in , in this embodiment, an image collector such as a camera or a webcam can be used to collect images of a desktop on which a document such as a book is placed, so as to collect a target image containing text content in the document.
[0049] It should be noted that, in the target image captured in this embodiment, due to the problem of the capture angle or the document placement angle, the text direction in the text area in the target image may be non-parallel to the image edge of the target image, that is, the text direction in the text area has a certain angle with the image edge, such as an acute angle or an obtuse angle, such as Figure 2 as shown in .
[0050] Specifically, in this embodiment, an image recognition algorithm or a text recognition algorithm can be used to recognize the text area in the target image. Figure 2 As shown in , the area corresponding to the dotted box is the text area in the target image.
[0051] The text in this embodiment can be a text composed of characters, such as Figure 3 The article text in can also be text consisting of characters containing borders, such as Figure 4 Or, it can contain both text composed of characters and text composed of characters with borders, such as Figure 5 Article text and table text in , etc.
[0052] The text direction refers to the writing direction of the characters in the text, such as Figure 6 The horizontal writing direction of the text, or Figure 7 Of course, in addition to the vertical and horizontal writing directions, there can also be an inclined writing direction with a certain angle relative to the horizontal direction, etc.
[0053] Step 102: Obtain a target area in the text area according to an input operation on the target image.
[0054] The input operation refers to the input operation generated by the user operating the target image through fingers or other operating bodies, such as Figure 8 As shown in , the user slides or selects a target image with his finger to represent the text area that the user needs to process, that is, the target area.
[0055] For example, the user performs a sliding operation on the target image, sliding from the second line of text to the fourth line of text in the text area in the target image, indicating that the user needs to process the text or image from the second line to the fourth line.
[0056] It should be noted that the target area obtained in this embodiment is a quadrilateral, and the direction of the text in the target area is parallel to the area edge of the target area to ensure the integrity of each line of text in the target area.
[0057] For example, after the user slides his finger on the target image, in this embodiment, the target area where the text corresponding to the input operation is located is obtained in the text area in the target image according to the input operation of the user's finger sliding. At this time, the target area contains complete lines of text corresponding to the input operation, such as Fig. 9 As shown in , the region edge in the target region is parallel to the text direction in the target region, ie, the text direction from the 2nd line of text to the 4th line of text, and the 2nd line of text to the 4th line of text are complete in the target region.
[0058] Step 103: Process the text or image corresponding to the target area.
[0059] Among them, the text contained in the target area is complete in the text direction, or the text image contained in the image corresponding to the target area is complete in the text direction. Therefore, when processing the text or image corresponding to the target area, the user does not need to manually modify or add the corresponding text or image, which can not only improve the processing accuracy but also improve the processing efficiency.
[0060] It can be seen from the above scheme that in the image processing method provided by the first embodiment of the present application, in the target image obtained by image acquisition of the document, the image edge of the target image is non-parallel to the text direction of the text area in the target image. In the present application, the text area in the target image is identified, and then the target area in which the text direction in the text area is parallel to the area edge is obtained according to the input operation on the target image, and then the target area is processed, such as processing the text or image. It can be seen that in the present embodiment, when the document image is recognized, the target area corresponding to the input operation is divided according to the text direction in the text area, so that the text direction in the divided target area is parallel to the area edge, thereby ensuring the integrity of the text in the text area in the text direction, thereby avoiding the situation where the text in the target area for text or image processing is missing or redundant, thereby improving the accuracy of text or image processing in the target area.
[0061] In one implementation, in step 102, when obtaining the target area in the text area according to the input operation on the target image, it can be specifically implemented in the following manner:
[0062] First, in the text area, at least one line of text corresponding to the input operation is determined. For example, after receiving the sliding input operation of the user's finger, the text whose text position intersects with the track position of the input operation is determined in the text area of the target image, such as Fig.10As shown in , the sliding track of the input operation starts from the second line of text and ends at the fourth line of text, and intersects with the second line of text, the third line of text, and the fourth line of text. At this time, the second line of text, the third line of text, and the fourth line of text are determined as the first text corresponding to the input operation;
[0063] Afterwards, according to the text direction of the first text, a target area corresponding to the input operation of the target image is divided in the text area. For example, after determining that the second line of text, the third line of text, and the fourth line of text are the first text corresponding to the input operation, according to the text direction of the second line of text, the third line of text, and the fourth line of text, the line area where each line of text is located is obtained, and the target area is divided according to these line areas, such as Fig.11 The target area shown in . At this time, the area edge of the target area is parallel to the text direction of each line of the first text, thereby making the text in the target area complete in the text direction.
[0064] Based on the above implementation, in this embodiment, after the target area is divided, the area frame line of the target area can be output on the target image to prompt the user of the divided target area. The user can further input operations on the target area or other areas in the target image according to needs.
[0065] In one implementation, when obtaining the target area in the text area according to the input operation on the target image in step 102, it can be specifically implemented in the following manner:
[0066] First, in the text area, determine the starting line of text corresponding to the input operation. For example, when receiving the starting operation of the sliding input operation of the user's finger, determine the text in the text area of the target image whose text position intersects with the trajectory position of the starting operation, such as Fig.12 As shown in , the sliding track of the input operation starts from the second line of text, so the second line of text in the text area is determined as the starting line of text corresponding to the input operation;
[0067] Secondly, according to the text direction of the starting line of text, in the text area, a starting edge line parallel to the text direction of the starting line of text is determined. For example, after determining that the second line of text is the starting line of text, according to the text direction of the second line of text, the edge line of the line area where the second line of text is located is obtained, and the edge line of the line area where the second line of text is located is determined as the starting line edge line, such as Fig.13 As shown in , it is the starting edge line of the target area. At this time, the length of the starting edge line is completely consistent with or approximately consistent with the area width of the text area;
[0068] Afterwards, as the input operation proceeds, when the input operation ends, the end line text corresponding to the input operation in the text area is obtained. For example, when the end operation of the sliding input operation of the user's finger is received, that is, when the user's finger is detected to be off the target image, the text whose text position intersects with the track position of the end operation is determined in the text area of the target image, such as Fig.14 As shown in , the sliding track of the input operation ends at the 4th line of text, so the 4th line of text in the text area is determined as the end line of text corresponding to the input operation;
[0069] Then, referring to the method for determining the starting edge line, in this embodiment, according to the text direction of the ending line text, in the text area, an ending edge line parallel to the text direction of the ending line text can be determined. For example, after determining that the 4th line of text is the ending line text, the edge line of the line area where the 4th line of text is located is obtained according to the text direction of the 4th line of text, and the edge line of the line area where the 4th line of text is located is determined as the ending line edge line, such as Fig.15 As shown in , it is the end edge line of the target area. At this time, the length of the end edge line is consistent with the area width of the text area and the length of the start edge line;
[0070] Finally, the target area is obtained according to the starting edge line and the ending edge line. Fig.16 As shown in , the target area is divided by using the starting edge line and the ending edge line as the area frame lines.
[0071] It should be noted that in this embodiment, as the input operation proceeds, the determined starting edge line and both side edge lines can be output on the target image to prompt the user of the edge lines of the target area that have been divided, until the input operation is completed, and the area frame line of the target area is output on the target image. At this time, the user can further perform input operations on the target area or other areas in the target image as needed.
[0072] Based on the above implementation, in this embodiment, the starting operation position of the input operation may overlap with the starting line of text, or the ending operation position of the input operation may overlap with the ending line of text, resulting in the area edge of the divided target area overlapping with a line of second text in the first text in the target area. At this time, in this embodiment, the area edge of the target area can be adjusted so that the area edge of the target area is on one side of the second text.
[0073] For example, when the starting operation position of the input operation falls in the middle of the starting line of text in the first text, resulting in the overlap between the starting edge line of the target area and the starting line of text, in this embodiment, the starting edge line of the target area can be adjusted above the starting line of text so that the starting line of text is included in the target area. Fig.17 As shown in;
[0074] Alternatively, when the end operation position of the input operation falls in the middle of the end line text in the first text, resulting in an overlap between the end edge line of the target area and the end line text, in this embodiment, the end edge line of the target area can be lowered below the end line text so that the end line text is included in the target area. Fig.18 as shown in .
[0075] In one implementation, when processing the text or image corresponding to the target area in step 103, the processing may be performed in the following manner:
[0076] In the target image, the text image corresponding to the target area is obtained, and then the text image is transmitted. Fig.19 As shown in , the text image corresponding to the target area including the second line of text to the fourth line of text in the target image is intercepted, and then the text image is obtained and then output, for example, transmitted to other terminals through an application.
[0077] In another implementation, when processing the text or image corresponding to the target area in step 103, the processing may be performed in the following manner:
[0078] Perform text recognition on the target image to obtain the text content in the target area.
[0079] For example, a text recognition algorithm such as an optical character recognition (OCR) algorithm is used to recognize text in the target area. After the text content is obtained, the text content can be saved or transmitted to other terminals.
[0080] Based on the above implementation, after identifying the text content in the target area, at least one character in the text content can be modified, for example, modifying one or more characters in the text content, deleting emoticons in the text content, replacing punctuation marks in the text content, etc., and then, based on the text content after the character modification, the target area is modified so that the target image includes the modified target area. That is to say, in this embodiment, the text content in the target area is recognized, and then the corresponding target image is regenerated after the text content is modified, so as to achieve the purpose of modifying the text in the target image.
[0081] In one implementation, before processing the text or image corresponding to the target area in step 103, the target area may be deformed first, because the divided target area may appear as a parallelogram or an irregular quadrilateral due to the problem of the image shooting angle. At this time, the text image in the target area may appear deformed, such as Fig.19 As shown in , at this time, in this embodiment, the text image corresponding to the target area can be deformed, such as Fig. 20 As shown in , the four corners of the text image are stretched or scaled so that the target area is rectangular, so as to facilitate the user to read the text image or recognize the text corresponding to the target area.
[0082] In summary, in this embodiment, based on the text detection and recognition solution, Fig.21 As shown in the figure, the position of the text line on the document is first detected. When the user is sliding his finger to select an area (as shown by the arrow in the figure), a parallelogram frame that conforms to the inclination direction of the text (the direction in which the text is written) is dynamically generated according to the position of the text line. Thus, the selected frame conforms to the up, down, left, and right positions of the text, so that subsequent uses can be made directly, such as text line recognition, text image correction, extraction of specific text areas such as tables, and so on.
[0083] It can be seen that the technical solution in this embodiment can directly perform direction correction after text image extraction without manual rotation and cropping, and can accurately frame the text image selected by the user, and can also easily extract specific targets in the text such as tables, thereby improving text recognition accuracy and efficiency.
[0084] refer to Fig. 22 , is a schematic diagram of the structure of an image processing device provided in Embodiment 2 of the present application, which can be configured in an electronic device capable of image acquisition and image processing, such as a scanner, a mobile phone, a pad or a camera. The device in this embodiment is mainly used to identify the integrity of the text area in the document image, so as to improve the accuracy of text or image processing.
[0085] Specifically, the device in this embodiment may include the following functional units:
[0086] An image recognition unit 2201 is used to recognize a text region in a target image, wherein the target image is an image acquired by capturing an image of a document, and a direction of text in the text region is not parallel to an image edge of the target image;
[0087] The region obtaining unit 2203 is used to obtain a target region in the text region according to the input operation on the target image, wherein the target region is a quadrilateral, and the direction of the text in the target region is parallel to the region edge of the target region;
[0088] The area processing unit 2203 is used to process the text or image corresponding to the target area.
[0089] It can be seen from the above scheme that in the image processing device provided by the second embodiment of the present application, in the target image obtained by image acquisition of the document, the image edge of the target image is non-parallel to the text direction of the text area in the target image. In the present application, the text area in the target image is identified, and then the target area in which the text direction in the text area is parallel to the area edge is obtained according to the input operation on the target image, and then the target area is processed, such as processing the text or image. It can be seen that in this embodiment, when the document image is recognized, the target area corresponding to the input operation is divided according to the text direction in the text area, so that the text direction in the divided target area is parallel to the area edge, thereby ensuring the integrity of the text in the text area in the text direction, thereby avoiding the situation where the text in the target area for text or image processing is missing or redundant, thereby improving the accuracy of text or image processing in the target area.
[0090] In one implementation, when the region obtaining unit 2202 obtains the target region in the text region according to the input operation on the target image, it can be implemented in the following manner:
[0091] In the text area, at least one line of first text corresponding to the input operation is determined; according to the text direction of the first text, a target area corresponding to the input operation of the target image is divided in the text area, and the text direction of the first text is parallel to the area edge of the target area.
[0092] In another implementation, the region obtaining unit 2202 may obtain the target region in the text region according to the input operation on the target image in the following manner:
[0093] In the text area, determine the starting line of text corresponding to the input operation; according to the text direction of the starting line of text, determine in the text area a starting edge line parallel to the text direction of the starting line of text; obtain the ending line of text corresponding to the input operation in the text area; according to the text direction of the ending line of text, determine in the text area an ending edge line parallel to the text direction of the ending line of text; and obtain a target area based on the starting edge line and the ending edge line.
[0094] Optionally, when the region edge of the target region overlaps with a line of second text in the text region, the region obtaining unit 2202 is further configured to:
[0095] The region edge of the target region is adjusted so that the region edge of the target region is located at one side of the second text in the text region.
[0096] Specifically, when the region processing unit 2203 processes the text or image corresponding to the target region, it can be implemented in the following manner:
[0097] In the target image, obtaining a text image corresponding to the target area; transmitting the text image;
[0098] Alternatively, the region processing unit 2203 may process the text or image corresponding to the target region in the following manner:
[0099] Perform text recognition on the target area to obtain text content in the target area.
[0100] Optionally, the region processing unit 2203 is further used to: modify at least one character in the text content; and modify the target region according to the text content after the character modification, so that the target image includes the modified target region.
[0101] In addition, before the region processing unit 2203 processes the text or image corresponding to the target region, the region obtaining unit 2202 is further configured to: perform region deformation on the target region so that the target region is rectangular.
[0102] It should be noted that the specific implementation of each unit in this embodiment can refer to the corresponding content and drawings in the previous text, and will not be described in detail here.
[0103] refer to Fig.23 , is a schematic diagram of the structure of an electronic device provided in the third embodiment of the present application, and the electronic device may be an electronic device capable of image acquisition and image processing, such as a scanner, a mobile phone, a pad or a camera. The electronic device in this embodiment is mainly used to identify the integrity of the text area in the document image, so as to improve the accuracy of text or image processing.
[0104] Specifically, the electronic device in this embodiment may include the following structure:
[0105] The image collector 2301 is used to collect images of documents to obtain a target image, wherein the text direction of the text area in the target image is not parallel to the image edge of the target image.
[0106] The image collector 2301 may be a camera or other component for collecting images of documents.
[0107] Processor 2302 is used to identify the text area in the target image, obtain the target area in the text area according to the input operation on the target image, the target area is a quadrilateral, and the text direction in the target area is parallel to the area edge of the target area, and process the text or image corresponding to the target area.
[0108] It can be seen from the above scheme that in an electronic device provided by Embodiment 3 of the present application, in a target image obtained by capturing an image of a document, the image edge of the target image is non-parallel to the text direction of the text area in the target image. In the present application, the text area in the target image is identified, and then the target area in which the text direction in the text area is parallel to the area edge is obtained according to the input operation on the target image, and then the target area is processed, such as processing the text or image. It can be seen that in the present embodiment, when the document image is recognized, the target area corresponding to the input operation is divided according to the text direction in the text area, so that the text direction in the divided target area is parallel to the area edge, thereby ensuring the integrity of the text in the text area in the text direction, thereby avoiding the situation where the text in the target area for text or image processing is missing or redundant, thereby improving the accuracy of text or image processing on the target area.
[0109] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0110] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0111] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0112] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, comprising: Identify a text area in a target image, wherein the target image is an image acquired by capturing an image of a document, and a direction of text in the text area is not parallel to an image edge of the target image; According to the input operation on the target image, a target area in the text area is obtained, wherein the target area is a quadrilateral, and a text direction in the target area is parallel to an area edge of the target area; Processing the text or image corresponding to the target area; Wherein, in the case where the area edge of the target area overlaps with a line of second text in the text area, the method further includes: The region edge of the target region is adjusted so that the region edge of the target region is located at one side of the second text in the text region.
2. The method according to claim 1, obtaining the target area in the text area according to the input operation on the target image, comprising: In the text area, determining at least one line of first text corresponding to the input operation; According to the text direction of the first text, a target area corresponding to the input operation of the target image is divided in the text area, and the text direction of the first text is parallel to the area edge of the target area.
3. The method according to claim 1, obtaining the target area in the text area according to the input operation on the target image, comprising: In the text area, determining a starting line of text corresponding to the input operation; According to the text direction of the starting line of text, determining, in the text area, a starting edge line parallel to the text direction of the starting line of text; Obtain the end line text corresponding to the input operation in the text area; According to the text direction of the end line of text, determining, in the text area, an end edge line parallel to the text direction of the end line of text; A target area is obtained according to the starting edge line and the ending edge line.
4. The method according to claim 1, processing the text or image corresponding to the target area comprises: In the target image, obtaining a text image corresponding to the target area; The text image is transmitted.
5. The method according to claim 1, processing the text or image corresponding to the target area comprises: Perform text recognition on the target area to obtain text content in the target area.
6. The method according to claim 5, further comprising: Modifying at least one character in the text content; The target area is modified according to the text content after the characters are modified, so that the target image includes the modified target area.
7. The method according to claim 1, before processing the text or image corresponding to the target area, the method further comprises: The target area is deformed so that the target area is rectangular.
8. An image processing device, comprising: An image recognition unit, used for recognizing a text area in a target image, wherein the target image is an image acquired by capturing an image of a document, and a direction of text in the text area is not parallel to an image edge of the target image; A region obtaining unit, configured to obtain a target region in the text region according to an input operation on the target image, wherein the target region is a quadrilateral, and a text direction in the target region is parallel to a region edge of the target region; A region processing unit, used for processing text or image corresponding to the target region; Wherein, in the case where the region edge of the target region overlaps with a line of second text in the text region, the image processing device further includes: The region edge of the target region is adjusted so that the region edge of the target region is located at one side of the second text in the text region.
9. An electronic device, comprising: An image collector is used to collect images of a document to obtain a target image, wherein a text direction of a text area in the target image is not parallel to an image edge of the target image; A processor is used to identify a text area in the target image, obtain a target area in the text area according to an input operation on the target image, wherein the target area is a quadrilateral, and a direction of text in the target area is parallel to an area edge of the target area, and process text or image corresponding to the target area; Wherein, in a case where the area edge of the target area overlaps with a line of second text in the text area, the electronic device further includes: The region edge of the target region is adjusted so that the region edge of the target region is located at one side of the second text in the text region.
Citation Information
Patent Citations
Distortion correction method and equipment for document image
CN105450900A
Image processing method and device
CN109542285A
Document image processing method, document image processing device and storage medium
CN110321887A
Method and device for parsing table in document image
US20190266394A1
