CN111639634B - OCR (optical character recognition) method and electronic equipment - Google Patents

OCR (optical character recognition) method and electronic equipment Download PDF

Info

Publication number
CN111639634B
CN111639634B CN202010411130.XA CN202010411130A CN111639634B CN 111639634 B CN111639634 B CN 111639634B CN 202010411130 A CN202010411130 A CN 202010411130A CN 111639634 B CN111639634 B CN 111639634B
Authority
CN
China
Prior art keywords
image
ocr recognition
cutting
recognition
page image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010411130.XA
Other languages
Chinese (zh)
Other versions
CN111639634A (en
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.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius 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 Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202010411130.XA priority Critical patent/CN111639634B/en
Publication of CN111639634A publication Critical patent/CN111639634A/en
Application granted granted Critical
Publication of CN111639634B publication Critical patent/CN111639634B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application discloses an OCR (optical character recognition) method and electronic equipment, wherein the method comprises the following steps: acquiring a page image; cutting the page image to obtain a plurality of image blocks; starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block; and obtaining the identification result of the page image according to the identification result of each image block. By implementing the embodiment of the application, the experience of interactive learning of the user can be improved.

Description

OCR (optical character recognition) method and electronic equipment
Technical Field
The application relates to the technical field of computers, in particular to an OCR (optical character recognition) method and electronic equipment.
Background
In order to improve learning interest, various interactive learning devices in the market are layered, wherein OCR recognition is a basic function of most interactive learning devices. In practice, it is found that most of the current OCR recognition is sequential word-by-word and line-by-line recognition, and this recognition mode is generally long in time consumption, and based on this, the experience of interactive learning of users is poor.
Disclosure of Invention
The embodiment of the application discloses an OCR (optical character recognition) method and electronic equipment, which can improve the experience of interactive learning of a user.
An embodiment of the present application in a first aspect discloses an OCR recognition method, including:
acquiring a page image;
cutting the page image to obtain a plurality of image blocks;
starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block;
and obtaining the identification result of the page image according to the identification result of each image block.
In an optional implementation manner, in the first aspect of the embodiment of the present application, after the cutting is performed on the page image to obtain a plurality of image blocks, and before the starting of OCR recognition threads corresponding to the plurality of image blocks respectively to obtain a recognition result of each image block, the method further includes:
carrying out noise reduction treatment on the plurality of image blocks to obtain a denoising image block corresponding to each image block;
starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block, wherein the method comprises the following steps:
and starting an OCR recognition thread of the denoising image block corresponding to each image block to obtain a recognition result of each image block.
In an optional implementation manner, in a first aspect of the embodiment of the present application, the cutting the page image to obtain a plurality of image blocks includes:
determining the number of OCR (optical character recognition) threads according to the current processing capacity of the electronic equipment;
and cutting the page image according to the OCR recognition line number to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR recognition line number.
In a first aspect of the embodiment of the present application, the cutting the page image according to the OCR recognition thread number to obtain a plurality of image blocks includes:
acquiring identification information of the page image;
determining preset cutting lines in the page image according to the identification information;
determining a target cutting line from the preset cutting lines according to the OCR recognition line number;
and cutting the page image according to the target cutting line to obtain a plurality of image blocks.
As an optional implementation manner, in the first aspect of the embodiment of the present application, the determining, according to the number of OCR recognition threads, a target cutting line from the preset cutting lines includes:
when the number of OCR recognition threads is reduced by one to be greater than or equal to the number of preset cutting lines, determining the preset cutting lines as target cutting lines;
and when the number of OCR recognition threads is reduced by one to be smaller than the number of preset cutting lines, determining target cutting lines from the preset cutting lines according to the respective priorities of the preset cutting lines, wherein the number of the target cutting lines is equal to the number of OCR recognition threads reduced by one.
A second aspect of an embodiment of the present application discloses an electronic device, including:
an acquisition unit configured to acquire a page image;
the cutting unit is used for cutting the page image to obtain a plurality of image blocks;
the recognition unit is used for starting OCR recognition threads corresponding to the image blocks respectively to obtain a recognition result of each image block; and obtaining the identification result of the page image according to the identification result of each image block.
As an optional implementation manner, in the second aspect of the embodiment of the present application, the electronic device further includes:
the denoising unit is used for denoising the plurality of image blocks after the cutting unit cuts the page image to obtain a plurality of image blocks, so as to obtain denoising image blocks corresponding to each image block;
the recognition unit is specifically configured to start an OCR recognition thread of a denoised image block corresponding to each image block, so as to obtain a recognition result of each image block.
As an optional implementation manner, in the second aspect of the embodiment of the present application, the cutting unit is specifically configured to determine the number of OCR recognition threads according to the current processing capability of the electronic device; and cutting the page image according to the OCR recognition line number to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR recognition line number.
In a second aspect of the present application, the cutting unit is configured to cut the page image according to the OCR recognition thread number to obtain a plurality of image blocks specifically:
the cutting unit is used for acquiring the identification information of the page image; determining a preset cutting line in the page image according to the identification information; determining a target cutting line from the preset cutting lines according to the OCR recognition line number; and cutting the page image according to the target cutting line to obtain a plurality of image blocks.
In a second aspect of the embodiment of the present application, the manner in which the cutting unit determines the target cutting line from the preset cutting lines according to the OCR recognition thread number is specifically:
the cutting unit is used for determining the preset cutting line as a target cutting line when the OCR recognition thread number is less than or equal to the preset cutting line number; and determining a target cutting line from the preset cutting lines according to the respective priority of the preset cutting lines when the number of OCR recognition threads is less than the number of the preset cutting lines, wherein the number of the target cutting lines is equal to the number of the OCR recognition threads minus one.
A third aspect of an embodiment of the present application discloses an electronic device, including:
a memory storing executable program code;
a processor coupled to the memory;
the processor invokes the executable program code stored in the memory to perform some or all of the steps of any of the methods of the first aspect of the application.
A fourth aspect of the embodiments of the present application discloses a computer-readable storage medium storing a computer program comprising part or all of the steps for performing any one of the methods of the first aspect of the present application.
A fifth aspect of embodiments of the application discloses a computer program product which, when run on a computer, causes the computer to perform part or all of the steps of any of the methods of the first aspect.
A sixth aspect of the embodiments of the present application discloses an application publishing system for publishing a computer program product, wherein the computer program product, when run on a computer, causes the computer to perform some or all of the steps of any one of the methods of the first aspect.
Compared with the prior art, the embodiment of the application has the following beneficial effects:
by implementing the embodiment of the application, the page image is acquired; cutting the page image to obtain a plurality of image blocks; starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block; and obtaining the identification result of the page image according to the identification result of each image block. By implementing the method, each image block obtained by cutting the page image is identified in a multithreading parallel manner, the OCR recognition efficiency of the page image can be effectively improved, and the experience of interactive learning of a user is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without the need of creative efforts for a person of ordinary skill in the art.
FIG. 1 is a schematic flow chart of an OCR method according to an embodiment of the present application;
FIG. 2 is a flow chart of another OCR method disclosed in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the terms "comprising," "having," and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
The OCR recognition method disclosed in the embodiment of the present application may be applied to an electronic device, where the electronic device may be a computer, and an operating system of the computer may include, but is not limited to, an Android operating system, an IOS operating system, a Symbian operating system, a Black Berry operating system, a Windows Phone8 operating system, and the like.
The electronic device may be a terminal device or other electronic devices. The terminal device may be referred to as a User Equipment (UE), a Mobile Station (MS), a mobile terminal (mobile terminal), an intelligent terminal, etc., and may communicate with one or more core networks via a radio access network (radio access network, RAN). For example, the terminal device may be a mobile phone (or "cellular" phone), a computer with a mobile terminal, etc., as well as portable, pocket, hand-held, computer-built-in or car-mounted mobile devices and terminal devices in future NR networks that exchange voice or data with the radio access network.
The embodiment of the application discloses an OCR (optical character recognition) method and electronic equipment, which can improve the experience of interactive learning of a user. The following is a detailed description.
Example 1
Referring to fig. 1, fig. 1 is a schematic flow chart of an OCR recognition method according to an embodiment of the application. The OCR recognition method as shown in fig. 1 may specifically include the steps of:
101. and acquiring a page image.
In the embodiment of the present application, the above page image may be directly acquired by an electronic device, or may be obtained by interaction between the electronic device and a user device communicatively connected to the electronic device, where, if the page image is directly acquired by the electronic device, the method for acquiring the page image may include, but is not limited to, the following implementation manners:
when a photographing instruction input by voice or gestures of a user is detected, a laser emitter arranged in the electronic equipment is utilized to project a dominant frame in a photographing area of a camera of the electronic equipment; and shooting the paper page in the dominant frame to obtain a page image.
102. And cutting the page image to obtain a plurality of image blocks.
In the embodiment of the present application, the cutting mode of the page image may be transverse cutting, longitudinal cutting or transverse-longitudinal combined cutting, which is not limited in the embodiment of the present application. The cutting mode of the electronic device for the page image can comprise a user intervention cutting mode and a non-user intervention cutting mode, and in the user intervention cutting mode, the electronic device can display cutting lines on the page image by detecting user instructions and cut the page image according to the displayed cutting lines; in the non-user intervention cutting mode, the electronic device may cut the page image according to a preset mode, where the preset mode may be equal-division cutting or non-equal-division cutting, and the embodiment of the present application is not limited.
Based on the above description, cutting the page image to obtain a plurality of image blocks may include: determining a current cutting mode of the electronic equipment; outputting a cutting line selection interface for a user to select line features of the cutting line when the current cutting mode is a user intervention cutting mode, wherein the line features can comprise line width, color and direction; displaying the cutting line on the page image according to the cutting track input by the user and the line characteristics of the cutting line determined by the user; cutting the page image according to the displayed cutting lines to obtain a plurality of image blocks; when the current cutting mode is a non-user intervention cutting mode, equally dividing and cutting the page image for preset times to obtain a plurality of image blocks. By implementing the method, flexible cutting of the page image can be realized.
Further, if the electronic device is a smart watch worn by a user, the display screen is generally smaller, and when the cutting line is displayed on the page image, the viewing angle experience of the user is affected, so that the projection operation can be performed on the page image displayed with the cutting line, so that the visual experience of the user is improved. The projection surface of the page image with the cutting line can be a wall, a desk or a large screen display terminal. Projecting the page image with the cutting line displayed thereon includes, but is not limited to, the following implementation manners:
mode 1: if the projection surface is a wall or a desk, detecting the ambient brightness of the environment where the projection surface is located, and when detecting that the ambient brightness of the environment where the projection surface is located is greater than a preset brightness threshold, sending a brightness adjustment instruction to brightness adjustment equipment of the environment where the projection surface is located, so that the brightness adjustment equipment adjusts the ambient brightness of the environment where the projection surface is located to be the preset brightness threshold, and projecting the page image with the cutting line.
Mode 2: if the projection surface is a large-screen display terminal, detecting whether a terminal identifier of the large-screen display terminal exists in a Bluetooth or Wifi radiation area of the electronic equipment, if so, establishing communication connection with the large-screen display terminal, detecting whether the large-screen display terminal is in a screen throwing state, and if so, sending the page image with the cutting line to the large-screen display terminal so as to project the page image with the cutting line to the large-screen display terminal.
103. And starting the OCR threads corresponding to the image blocks respectively to obtain the identification result of each image block.
104. And obtaining the identification result of the page image according to the identification result of each image block.
In the embodiment of the present application, the electronic device may further record a location identifier of each image block in the page image, where the obtaining, according to the identification result of each image block, the identification result of the page image may include: and obtaining the identification result of the page image according to the identification result of each image block and the corresponding position identification thereof.
In the embodiment of the present application, each image block corresponds to one OCR recognition thread, the OCR recognition threads corresponding to different image blocks are different, and resources of each OCR recognition thread may be the same or different, and after step 102, the following steps may be further executed:
counting the characters contained in each image block of the plurality of image blocks to obtain the number of characters of each image block;
determining an OCR recognition thread corresponding to each image block from preset OCR recognition threads of the electronic equipment according to the number of characters of each image block; the preset resources corresponding to the preset OCR recognition threads are different, the preset resources can comprise processing speed and storage space, the more the preset resources of the OCR recognition threads corresponding to the image blocks with more characters are, and conversely, the fewer the preset resources of the OCR recognition threads corresponding to the image blocks with fewer characters are, the reasonable allocation of the resources of the electronic equipment can be realized by implementing the method.
By implementing the method, the page image is cut into a plurality of image blocks, and the OCR recognition threads corresponding to each image block are started in parallel, so that the OCR recognition efficiency of the page image can be effectively improved, the experience of interactive learning of users can be improved, the flexible cutting of the page image can be realized, and the reasonable distribution of resources of electronic equipment can be realized.
Example two
Referring to fig. 2, fig. 2 is a schematic flow chart of another OCR recognition method according to an embodiment of the application. The OCR recognition method as shown in fig. 2 may specifically include the steps of:
201. and acquiring a page image.
For the description of step 201, refer to the description of step 101 in the first embodiment, and the description of the embodiment of the present application is omitted.
202. The number of OCR recognition threads is determined based on the current processing capabilities of the electronic device.
203. And cutting the page image according to the OCR line number to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR line number.
Since each OCR recognition thread number corresponds to one processor, the current processing capability of the electronic device indicates how many processors are used for performing OCR recognition, the determined OCR recognition thread number may be equal to the number of processors used for performing OCR recognition, and steps 202 to 203 are executed, and the determination of the OCR recognition thread number is performed based on the current processing capability of the electronic device, so that the orderly and stable execution of the OCR recognition threads is ensured, and the error probability of the OCR recognition threads may be reduced.
As an optional implementation manner, in an embodiment of the present application, the electronic device may further store coordinate information of preset cut lines of the page image, where the coordinate information of the preset cut line corresponding to each page image may be associated with a page identifier (such as a page number or a two-dimensional code) on the page image, that is, by identifying the page identifier, the preset cut line corresponding to each page image may be a dividing line of content included in the page image, for example, if the page image is a page of an english book, the page includes 3 modules, respectively including a list module, a peak module, and a Write module, the page may have 2 preset cut lines, where the first preset cut line is located between the list module and the peak module, and the second preset cut line is located between the peak module and the Write module.
Based on this, the cutting the page image according to the OCR recognition thread number to obtain a plurality of image blocks may include: acquiring the identification information of the page image; determining preset cutting lines in the page image according to the identification information; determining a target cutting line from preset cutting lines according to the OCR recognition line number; and cutting the page image according to the target cutting line to obtain a plurality of image blocks.
Illustratively, the above manner of determining the target cut line from the preset cut lines according to the number of OCR recognition threads includes, but is not limited to, the following implementation manners:
mode 1: when the number of OCR recognition threads is reduced by one to be greater than or equal to the number of preset cutting lines, determining the preset cutting lines as target cutting lines;
mode 2: and when the number of OCR recognition threads is reduced by one to be smaller than the number of preset cutting lines, determining target cutting lines from the preset cutting lines according to the respective priorities of the preset cutting lines, wherein the number of the target cutting lines is equal to the number of OCR recognition threads reduced by one.
The priority of the preset cut line is described as follows: for example, in the case that the resources corresponding to each OCR recognition thread are the same, if the number of characters of the list module is large, the number of characters of the speaker module and the number of characters of the Write module are small, and if the determined number of OCR recognition threads is 2, the number of target cut lines is 1, so as to equalize the execution time of each OCR recognition thread, the first preset cut line has a higher priority than the second preset cut line. By implementing the method, the recognition efficiency of the page image can be further improved. In addition, the page image is cut according to the preset cutting line in the page image, so that the integration efficiency of the identification result of the image block can be improved.
204. And carrying out noise reduction processing on the plurality of image blocks to obtain a denoising image block corresponding to each image block.
205. And starting an OCR recognition thread of the denoising image block corresponding to each image block to obtain a recognition result of each image block.
206. And obtaining the identification result of the page image according to the identification result of each image block.
In the embodiment of the present application, the algorithm for performing the noise reduction processing on the plurality of image blocks may be a spatial domain pixel feature denoising algorithm, a transform domain denoising algorithm or a BM3D denoising algorithm, which is not limited by the embodiment of the present application. Through executing the steps 205 to 206, after the page image is cut to obtain a plurality of image blocks, denoising pretreatment is performed on each image block, so that the recognition efficiency of the image blocks is improved.
In the embodiment of the present application, the page image may include a plurality of learning modules, each learning module is independent of the other learning module, the preset cutting line may be located between two adjacent learning modules, each image block obtained by cutting according to the target cutting line may correspond to one or more learning modules, if OCR recognition for the page image is to request for obtaining the associated learning content of the page image from the server, a request mode of the electronic device for the server may include an overall mode and a batch mode, where the overall mode is to send a recognition result of the page image to the server, and the batch mode is to send a recognition result of the learning module in the page image to the server in batches, specifically, the electronic device starts an OCR recognition thread of a denoising image block corresponding to each image block, and after obtaining the recognition result of each image block, may further execute the following steps:
determining a current request mode of the electronic device to the server, wherein the request mode of the electronic device to the server can comprise an overall mode and a batch mode;
when the current request mode is the integral mode, obtaining the identification result of the page image according to the identification result of each image block; sending the identification result of the page image to a server so that the server searches the associated learning content of the page image according to the identification result of the page image and feeds back the searched associated learning content of the page image to the electronic equipment;
when the current request mode is a batch mode, if the identification result of any image block is detected to be obtained, the identification result of any image block is sent to the server until the identification result of the plurality of image blocks is sent to the server, so that the server searches the associated learning content of each image block according to the identification result of each image block, obtains the associated learning content of the page image by integrating the associated learning content of each image block, and feeds back the associated learning content of the page image to the electronic equipment.
By implementing the method, based on the preset dividing line in the page image, the server can search the associated learning content of the learning module contained in the page image in batches, the execution time of the OCR recognition thread of the image block with few characters is short, the electronic equipment can firstly send the information to the server, the server can obtain the associated learning content of the learning module contained in the image block according to the recognition result of the image block after receiving the image block, and the server can integrate the associated learning content of each learning module to obtain the associated learning content of the page image after obtaining the associated learning content of the learning module contained in the last image block, so that the response rate of the server to the associated learning content of the page image can be improved.
By implementing the method, the OCR recognition efficiency of the page image can be effectively improved, the experience of interactive learning of the user can be improved, flexible cutting of the page image can be realized, reasonable allocation of electronic equipment resources can be realized, the error probability of OCR recognition threads can be reduced, the integration efficiency of the recognition results of the image blocks can be improved, the recognition efficiency of the page image can be further improved, and the response rate of a server to the associated learning content of the page image can be improved.
Example III
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 3, the electronic device may include:
an acquisition unit 301 for acquiring a page image.
In an embodiment of the present application, the acquiring unit 301 acquires the page image may include, but is not limited to, the following implementation manners: an obtaining unit 301, configured to, when a photographing instruction input by a user's voice or a gesture is detected, project a dominant frame in a photographing area of a camera of the electronic device by using a laser emitter built in the electronic device; and shooting the paper page in the dominant frame to obtain a page image.
And a cutting unit 302, configured to cut the page image to obtain a plurality of image blocks.
In the embodiment of the present application, referring to the description of step 102 in the first embodiment, the cutting mode of the cutting unit is not repeated. The manner in which the cutting unit 302 is configured to cut the page image to obtain the plurality of image blocks may specifically be: a cutting unit 302, configured to determine a current cutting mode of the electronic device; outputting a cutting line selection interface for a user to select line features of the cutting line when the current cutting mode is a user intervention cutting mode, wherein the line features can comprise line width, color and direction; displaying the cutting line on the page image according to the cutting track input by the user and the line characteristics of the cutting line determined by the user; cutting the page image according to the displayed cutting lines to obtain a plurality of image blocks; when the current cutting mode is a non-user intervention cutting mode, equally dividing and cutting the page image for preset times to obtain a plurality of image blocks.
Further, if the electronic device is a smart watch worn by a user, the display screen of the smart watch is generally smaller, and when the cutting unit 302 displays the cutting line on the page image, the viewing angle experience of the user is affected, so that the cutting unit 302 may further perform the projection operation on the page image displayed with the cutting line, so as to improve the visual experience of the user. The projection surface of the page image with the cutting line can be a wall, a desk or a large screen display terminal. The projection operation of the cutting unit 302 on the above page image with the cutting line displayed thereon includes, but is not limited to, the following implementation manners:
mode 1: if the projection surface is a wall or a desk, the cutting unit 302 detects the ambient brightness of the environment where the projection surface is located, and when detecting that the ambient brightness of the environment where the projection surface is located is greater than a preset brightness threshold, sends a brightness adjustment instruction to a brightness adjustment device of the environment where the projection surface is located, so that the brightness adjustment device adjusts the ambient brightness of the environment where the projection surface is located to be the preset brightness threshold, and performs a projection operation on the page image with the cutting line.
Mode 2: if the projection surface is a large-screen display terminal, the cutting unit 302 detects whether a terminal identifier of the large-screen display terminal exists in a Bluetooth or Wifi radiation area of the electronic device, if so, establishes communication connection with the large-screen display terminal, detects whether the large-screen display terminal is in a screen throwing state, and if so, sends the page image with the cutting line to the large-screen display terminal so as to project the page image with the cutting line on the large-screen display terminal.
A cutting unit 302, configured to count characters included in each of the plurality of image blocks to obtain a number of characters of each image block; determining an OCR recognition thread corresponding to each image block from preset OCR recognition threads of the electronic equipment according to the number of characters of each image block; the preset resources corresponding to the preset OCR recognition threads are different, and the preset resources may include a processing rate and a storage space size, and the more the preset resources of the OCR recognition threads corresponding to the image blocks with the larger number of characters are, the fewer the preset resources of the OCR recognition threads corresponding to the image blocks with the smaller number of characters are, on the contrary.
A recognition unit 303, configured to start OCR recognition threads corresponding to the plurality of image blocks, to obtain a recognition result of each image block; and obtaining the identification result of the page image according to the identification result of each image block.
In the embodiment of the present application, the electronic device may further record a location identifier of each image block in the page image, and the identifying unit 303 is configured to obtain, according to an identification result of each image block, an identification result of the page image in a specific manner may be: and the identifying unit 303 is configured to obtain the identification result of the page image according to the identification result of each image block and the corresponding position identifier.
In an embodiment of the present application, the electronic device may further include:
the denoising unit is configured to, after the cutting unit 302 cuts the page image to obtain a plurality of image blocks, perform denoising processing on the plurality of image blocks to obtain denoising image blocks corresponding to each image block; the recognition unit 303 is specifically configured to start an OCR recognition thread of a denoised image block corresponding to each image block, to obtain a recognition result of each image block.
For example, the manner in which the cutting unit 302 is configured to cut the page image to obtain the plurality of image blocks may specifically be: the cutting unit 302 is specifically configured to determine the number of OCR recognition threads according to the current processing capability of the electronic device; and cutting the page image according to the OCR line number to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR line number.
Optionally, the cutting unit 302 is configured to cut the page image according to the number of OCR recognition threads, so as to obtain a plurality of image blocks specifically may be: a cutting unit 302, configured to obtain identification information of the page image; determining a preset cutting line in the page image according to the identification information; determining a target cutting line from preset cutting lines according to the OCR recognition line number; and cutting the page image according to the target cutting line to obtain a plurality of image blocks.
Further, the manner in which the cutting unit 302 is configured to determine the target cutting line from the preset cutting line according to the OCR recognition thread number may specifically be: a cutting unit 302 for determining the preset cut line as a target cut line when the OCR recognition thread number is reduced by one by an amount greater than or equal to the preset cut line; and determining the target cutting line from the preset cutting lines according to the respective priority of the preset cutting lines when the number of OCR recognition threads is reduced by one to be smaller than the number of preset cutting lines, wherein the number of the target cutting lines is equal to the number of OCR recognition threads reduced by one.
Specifically, the identifying unit 303 may be further configured to cut the page image by using the cutting unit 302 to obtain a plurality of image blocks, and determine a current request mode of the electronic device to the server, where the request mode of the electronic device to the server may include an overall mode and a batch mode; when the current request mode is the integral mode, obtaining the identification result of the page image according to the identification result of each image block; sending the identification result of the page image to a server so that the server searches the associated learning content of the page image according to the identification result of the page image and feeds back the searched associated learning content of the page image to the electronic equipment; and when the current request mode is a batch mode, if the identification result of any image block is detected to be obtained, sending the identification result of any image block to a server until the identification results of the image blocks are sent to the server, so that the server searches the associated learning content of each image block according to the identification result of each image block, obtains the associated learning content of the page image by integrating the associated learning content of each image block, and feeds back the associated learning content of the page image to the electronic equipment.
By implementing the electronic equipment, the OCR recognition efficiency of the page image can be effectively improved, the experience of interactive learning of the user can be improved, flexible cutting of the page image can be realized, reasonable allocation of electronic equipment resources can be realized, the error probability of OCR recognition threads can be reduced, the integration efficiency of the recognition results of the image blocks can be improved, the recognition efficiency of the page image can be further improved, and the response rate of a server to the associated learning content of the page image can be improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 4, the electronic device may include:
a memory 401 storing executable program codes;
a processor 402 coupled with the memory 401;
the processor 402 calls executable program codes stored in the memory 401, and executes any one of the OCR recognition methods of fig. 1 to 2.
The embodiment of the application discloses a computer readable storage medium storing a computer program, wherein the computer program causes a computer to execute any one of OCR recognition methods shown in figures 1-2.
Embodiments of the present application disclose a computer program product that, when run on a computer, causes the computer to perform any of the OCR recognition methods of fig. 1-2.
The embodiment of the application discloses an application publishing system which is used for publishing a computer program product, wherein when the computer program product runs on a computer, the computer is caused to execute any one of OCR (optical character recognition) methods shown in figures 1-2.
Those of ordinary skill in the art will appreciate that all or part of the steps of the various methods of the above embodiments may be implemented by a program that instructs associated hardware, the program may be stored in a computer readable storage medium including Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable programmable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disk Memory, magnetic disk Memory, tape Memory, or any other medium that can be used for carrying or storing data that is readable by a computer.
The above describes in detail an OCR recognition method and an electronic device disclosed in the embodiments of the present application, and specific examples are applied to illustrate the principles and implementations of the present application, and the magnitude of the step numbers in the specific examples does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its functions and internal logic, but should not constitute any limitation to the implementation process of the embodiments of the present application. The units described above as separate components may or may not be physically separate, and some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
The character "/" herein generally indicates that the associated object is an "or" relationship. In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B may be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. If the integrated unit is implemented in the form of a software functional unit and sold or used as a stand-alone product, it may be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a memory, comprising several requests for a computer device (which may be a personal computer, a server or a network device, etc., in particular may be a processor in a computer device) to execute some or all of the steps of the above-mentioned method of the various embodiments of the present application.
The above description of embodiments is only for aiding in the understanding of the method of the present application and its core ideas; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (6)

1. A method of OCR recognition, the method comprising:
acquiring a page image;
determining the number of OCR (optical character recognition) threads according to the current processing capacity of the electronic equipment;
acquiring identification information of the page image;
determining preset cutting lines in the page image according to the identification information;
determining a target cutting line from the preset cutting lines according to the OCR recognition line number;
cutting the page image according to the target cutting line to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR recognition line number;
starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block;
obtaining the identification result of the page image according to the identification result of each image block;
wherein, the determining the target cutting line from the preset cutting lines according to the OCR recognition thread number comprises the following steps:
when the number of OCR recognition threads is reduced by one to be greater than or equal to the number of preset cutting lines, determining the preset cutting lines as target cutting lines;
and when the number of OCR recognition threads is reduced by one to be smaller than the number of preset cutting lines, determining target cutting lines from the preset cutting lines according to the respective priorities of the preset cutting lines, wherein the number of the target cutting lines is equal to the number of OCR recognition threads reduced by one.
2. The method of claim 1, wherein after the cutting the page image to obtain a plurality of image blocks and before the starting OCR recognition threads respectively corresponding to the plurality of image blocks to obtain a recognition result of each image block, the method further comprises:
carrying out noise reduction treatment on the plurality of image blocks to obtain a denoising image block corresponding to each image block;
starting OCR recognition threads respectively corresponding to the image blocks to obtain a recognition result of each image block, wherein the method comprises the following steps:
and starting an OCR recognition thread of the denoising image block corresponding to each image block to obtain a recognition result of each image block.
3. An electronic device, comprising:
an acquisition unit configured to acquire a page image;
the cutting unit is used for determining the OCR recognition thread number according to the current processing capacity of the electronic equipment; acquiring identification information of the page image; determining a preset cutting line in the page image according to the identification information; determining a target cutting line from the preset cutting lines according to the OCR recognition line number; cutting the page image according to the target cutting line to obtain a plurality of image blocks, wherein the number of the image blocks is equal to the OCR recognition line number;
the recognition unit is used for starting OCR recognition threads corresponding to the image blocks respectively to obtain a recognition result of each image block; according to the identification result of each image block, an identification result of the page image is obtained;
the cutting unit is further used for determining the preset cutting line as a target cutting line when the number of OCR recognition threads is less than or equal to the number of preset cutting lines; and determining a target cutting line from the preset cutting lines according to the respective priority of the preset cutting lines when the number of OCR recognition threads is less than the number of the preset cutting lines, wherein the number of the target cutting lines is equal to the number of the OCR recognition threads minus one.
4. The electronic device of claim 3, wherein the electronic device further comprises:
the denoising unit is used for performing denoising treatment on the plurality of image blocks after the cutting unit cuts the page image to obtain a plurality of image blocks so as to obtain denoising image blocks corresponding to each image block;
the recognition unit is specifically configured to start an OCR recognition thread of a denoised image block corresponding to each image block, so as to obtain a recognition result of each image block.
5. An electronic device, the electronic device comprising:
a memory storing executable program code;
a processor coupled to the memory;
the processor invokes the executable program code stored in the memory to perform part or all of the steps of the method of any one of claims 1-2.
6. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, the computer program comprising some or all of the steps for performing the method of any one of claims 1-2.
CN202010411130.XA 2020-05-15 2020-05-15 OCR (optical character recognition) method and electronic equipment Active CN111639634B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010411130.XA CN111639634B (en) 2020-05-15 2020-05-15 OCR (optical character recognition) method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010411130.XA CN111639634B (en) 2020-05-15 2020-05-15 OCR (optical character recognition) method and electronic equipment

Publications (2)

Publication Number Publication Date
CN111639634A CN111639634A (en) 2020-09-08
CN111639634B true CN111639634B (en) 2023-11-24

Family

ID=72330218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010411130.XA Active CN111639634B (en) 2020-05-15 2020-05-15 OCR (optical character recognition) method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111639634B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269323A (en) * 1997-03-27 1998-10-09 Hitachi Ltd Optical character reader and character distribution recognition system
CN108874547A (en) * 2018-06-27 2018-11-23 郑州云海信息技术有限公司 A kind of data processing method and device of astronomy software Gridding
CN111078082A (en) * 2019-06-09 2020-04-28 广东小天才科技有限公司 Point reading method based on image recognition and electronic equipment
CN111091576A (en) * 2020-03-19 2020-05-01 腾讯科技(深圳)有限公司 Image segmentation method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201206165A (en) * 2010-07-16 2012-02-01 Primax Electronics Ltd Image testing method of image pickup device and image testing device using the same
US10241811B2 (en) * 2016-11-23 2019-03-26 Significs And Elements, Llc Systems and methods for automatic data management for an asynchronous task-based runtime

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269323A (en) * 1997-03-27 1998-10-09 Hitachi Ltd Optical character reader and character distribution recognition system
CN108874547A (en) * 2018-06-27 2018-11-23 郑州云海信息技术有限公司 A kind of data processing method and device of astronomy software Gridding
CN111078082A (en) * 2019-06-09 2020-04-28 广东小天才科技有限公司 Point reading method based on image recognition and electronic equipment
CN111091576A (en) * 2020-03-19 2020-05-01 腾讯科技(深圳)有限公司 Image segmentation method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
费梦圆等.手机拍照阅读系统的设计与实现.《信息技术》.2017,(第2期),第29-32页. *

Also Published As

Publication number Publication date
CN111639634A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN109407936B (en) Screenshot method and related device
US10438086B2 (en) Image information recognition processing method and device, and computer storage medium
US20170032219A1 (en) Methods and devices for picture processing
US20210374447A1 (en) Method and device for processing image, electronic equipment, and storage medium
KR20150059466A (en) Method and apparatus for recognizing object of image in electronic device
US10701301B2 (en) Video playing method and device
US20150242982A1 (en) Method and apparatus for displaying image
CN107729889B (en) Image processing method and device, electronic equipment and computer readable storage medium
US11113998B2 (en) Generating three-dimensional user experience based on two-dimensional media content
WO2019105457A1 (en) Image processing method, computer device and computer readable storage medium
US20170206050A1 (en) Content sharing methods and apparatuses
CN107657219B (en) Face detection method and related product
CN112530205A (en) Airport parking apron airplane state detection method and device
CN109358927B (en) Application program display method and device and terminal equipment
US20170118401A1 (en) Electronic device and method for processing image
CN107291238B (en) Data processing method and device
CN108388781B (en) Mobile terminal, image data acquisition method and related product
CN112990197A (en) License plate recognition method and device, electronic equipment and storage medium
CN111639634B (en) OCR (optical character recognition) method and electronic equipment
US10091436B2 (en) Electronic device for processing image and method for controlling the same
CN109922457B (en) Information interaction method, device and system
KR101495790B1 (en) Mobile terminal and method for controlling screen display thereof
CN111639158A (en) Learning content display method and electronic equipment
WO2020124454A1 (en) Font switching method and related product
KR102266869B1 (en) Electronic apparatus and dispalying method thereof

Legal Events

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