Target content determination method, electronic equipment and storage medium
By performing fingertip stability determination on the motion changes of the current video frame relative to the previous video frame in the video stream, the problems of high computing resource usage and data loss in the existing technology are solved, and the target content pointed by the fingertip is accurately determined and Accurate identification.
Patent Information
- Application Number
- CN202310216958.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-10
AI Technical Summary
Existing vision-based finger-point reading word search technology requires fingertip positioning model to determine fingertip stability for each video frame, which takes up high computing resources and runs at a speed lower than the video stream frame rate, resulting in data loss and fingertip stability. The judgment result is inaccurate.
By determining the fingertip stability based on the motion changes of the current video frame relative to the previous video frame in the video stream, the optical flow calculation and motion area comparison are used to determine the fingertip stability, reducing the amount of calculation and ensuring that data is not lost, thereby achieving fingertip stability determination. Refers to the precise determination of target content.
It saves computing resources, improves the accuracy and speed of fingertip stability determination, and ensures accurate identification of the target content pointed by the fingertip.
Smart Images

Figure CN118629044A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a target content determination method, an electronic device, and a storage medium. Background Art
[0002] Looking up new words is a common scenario in the reading and learning process. Traditional methods of looking up new words (such as paper dictionaries, electronic dictionaries, etc.) are time-consuming and inefficient. With the development of computer vision and deep learning, vision-based finger-pointing word-looking applications have appeared on smart terminals. When the camera on the smart terminal is turned on, it can capture the image of the reading material. The user can point his finger at the target content (word or sentence) to be looked up in the reading material, and the application can return the definition and pronunciation of the target content (word or sentence), which greatly improves learning efficiency.
[0003] At present, the implementation of vision-based finger-pointing word search has the following problems: currently, the fingertip stability judgment needs to be performed on each video frame through the fingertip positioning model, which occupies a high computing resource. In addition, the running speed of the fingertip positioning model is lower than the video stream frame rate, which will affect the fingertip stability judgment result due to partial data loss, and further affect the determination of the target content pointed by the fingertip in the reading material. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method for determining target content, an electronic device, and a storage medium, which can achieve accurate determination of the target content pointed to by a fingertip in a reading material, thereby saving resource costs.
[0005] In a first aspect, an embodiment of the present application provides a method for determining target content, including:
[0006] In response to the triggered fingertip content determination operation, starting and receiving a video stream captured by a video capture device relative to the reading material;
[0007] Determine fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream;
[0008] When the current determination result is that the fingertip is stable, a content detection area in the current video frame is determined, and a target content pointed to by the fingertip is determined from the content detection area.
[0009] Furthermore, the fingertip stability determination based on the motion change of the current video frame relative to the previous video frame in the video stream includes:
[0010] Perform optical flow calculation on the current video frame and the previous video frame in the video stream to obtain a current optical flow map;
[0011] Comparing the current optical flow map with the previous optical flow map for changes in the motion area, and determining whether the fingertip stability determination condition is currently met according to the comparison result;
[0012] If so, the fingertip stability is determined by locating the fingertip in the current video frame and the previous video frame.
[0013] Furthermore, the comparing the current optical flow map with the previous optical flow map in terms of the change in the motion area, and determining whether the fingertip stability determination condition is currently met according to the comparison result, includes:
[0014] Determine a current motion region of the current optical flow map according to the optical flow value in the current optical flow map, and obtain a previous motion region of the previous optical flow map;
[0015] Comparing the optical flow points in the current motion area with the optical flow points in the previous motion area to determine the current motion disappearance area;
[0016] Based on the previous motion disappearance area cached in the cache data table, determining whether the disappearance time of the current motion disappearance area reaches a set time length;
[0017] If the disappearance time reaches the set time length, it is determined that the fingertip stability determination condition is currently met.
[0018] Further, the fingertip stability determination by positioning the fingertip in the current video frame and the previous video frame includes:
[0019] Obtaining the previous fingertip position information of the fingertip contained in the previous video frame;
[0020] Perform fingertip region recognition in the current video frame to obtain a fingertip region including the fingertip;
[0021] Positioning the fingertip in the fingertip area to obtain current fingertip position information of the fingertip;
[0022] If the position difference between the current fingertip position information and the previous fingertip position information is within a set range, the current determination result is determined as the fingertip is stable.
[0023] Further, the determining of the content detection area in the current video frame, and determining the target content pointed to by the fingertip from the content detection area, includes:
[0024] Obtaining the current fingertip position coordinates and a preset interception size corresponding to the fingertip being stable in the current video frame;
[0025] Determining a content detection area having the cutout size based on the current fingertip position coordinates in the current video frame;
[0026] Performing text line recognition on the content detection area, and determining word position information of a single word from the recognized text line;
[0027] The target word position information of the target word pointed by the fingertip is determined according to the word position information, and the target word is used as the target content.
[0028] Furthermore, the performing text line recognition on the content detection area and determining word position information of a single word from the recognized text line includes:
[0029] Input the content detection area after text segmentation processing into the trained text recognition model to obtain the output text line recognition result;
[0030] Determine the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result;
[0031] Obtaining the word component content of each word contained in the text line by word segmentation processing on the text line recognition result;
[0032] The word position information of each word contained in the text line is determined according to the single character information and the word segmentation composition content.
[0033] Furthermore, the determining of the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result includes:
[0034] Determine the character categories of the characters included in the text line recognition result, classify the characters into placeholders and non-placeholders, and obtain the placeholder character position information of each placeholder and the non-placeholder character position information of the non-placeholder;
[0035] Determine the average length of the placeholders between the non-placeholder characters by using the placeholder character position information;
[0036] Determine the single character position information and single character content information of each non-placeholder according to the average placeholder length and the position information of each non-placeholder character;
[0037] Corresponding non-placeholder single character information is constructed based on the single character position information and the single character content information.
[0038] Furthermore, the method further comprises:
[0039] Search a preset content database, determine and display the interpretation information corresponding to the target content, and play the pronunciation information of the target content.
[0040] In a second aspect, an embodiment of the present application provides an electronic device, including:
[0041] A video acquisition device, a display screen and one or more processors, wherein the processor runs the target content determination method on the electronic device, the video acquisition device sends the video stream acquired during the target content determination operation to the processor, and the display screen displays the content when the target content determination method is running; wherein,
[0042] The processor, in response to the triggered fingertip content determination operation, starts and receives a video stream captured by a video capture device relative to the reading material;
[0043] The processor determines fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream;
[0044] When the current determination result is that the fingertip is stable, the processor determines a content detection area in the current video frame, and determines the target content pointed to by the fingertip from the content detection area;
[0045] The electronic device further comprises: a memory for storing one or more programs;
[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the above-mentioned first aspect embodiment.
[0047] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in the embodiment of the first aspect above.
[0048] The above-mentioned target content determination method, electronic device and storage medium provided in this embodiment start and receive the video stream collected by the video acquisition device relative to the reading material in response to the triggered fingertip content determination operation; then the fingertip stability is determined according to the motion change of the current video frame relative to the previous video frame in the video stream; finally, when the current determination result is that the fingertip is stable, the content detection area in the current video frame is determined, and the target content pointed by the fingertip is determined from the content detection area. Compared with the existing method that requires fingertip positioning model to perform fingertip stability determination on each video frame, the above-mentioned technical solution performs fingertip stability determination based on the motion change of the current video frame relative to the previous video frame, has a small amount of calculation, saves computing resources and can ensure that data is not lost to a large extent, realizes the rapid identification of the target content pointed by the fingertip by pointing the fingertip to the reading material, and improves the accuracy of content recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0050] Figure 1a A flowchart of a method for determining target content provided in Example 1 of the present application;
[0051] Figure 1b This is a structural example diagram of an application scenario in a target content determination method provided in Example 1 of the present application;
[0052] Figure 2 A flowchart of another target content determination method provided in Embodiment 2 of the present application;
[0053] Figure 3 A schematic diagram of the structure of an electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical scheme and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0055] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of systems and methods consistent with some aspects of the present application as detailed in the attached claims.
[0056] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0057] Embodiment 1
[0058] Figure 1aA flowchart of a method for determining target content provided in the first embodiment of the present application. This embodiment is applicable to the case of determining target content in a visual-based finger-pointing word search. The method can be executed by an electronic device such as a server or a processing terminal, and in particular, based on a processor in an electronic device. The electronic device can be regarded as an execution terminal of the method for determining target content, and specifically can be a desktop learning terminal.
[0059] It should be noted that the execution subject of the method provided in this embodiment can be regarded as an electronic device on the server side, which can be regarded as a server side that provides a visual finger-pointing word-checking function and determines the target content pointed by the finger, and can be a desktop learning terminal. By executing the method provided in this embodiment, it is possible to determine the target content based on the video stream collected from the relative reading material.
[0060] Specifically, Figure 1a As shown, a target content determination method provided in Embodiment 1 of the present application may include the following operations:
[0061] S101 . In response to a triggered fingertip content determination operation, start and receive a video stream captured by a video capture device relative to a reading material.
[0062] It is clear that the visual finger-pointing word-checking function is increasingly commonly used in smart terminals. By calling the finger-pointing word-checking function, users can check words more conveniently and efficiently during the learning process, opening up a new way of autonomous learning. The application scenario of using the visual finger-pointing word-checking function of the smart terminal can be described as: when the visual finger-pointing word-checking function provided by the electronic device is needed, the user turns on the finger-pointing word-checking function. At the same time, a video acquisition device, such as a camera, is installed on the electronic device. When the finger-pointing word-checking function is started, the video acquisition device is turned on, and the picture of the reading material can be collected. The user can point to the target content to be checked in the reading material, such as a word or sentence, with a finger, and the application can return the interpretation and pronunciation of the target content, which greatly improves the learning efficiency. In this embodiment, the situation in which the user queries a word can be that the user points to an unknown word or word in the book with a finger, and the electronic device gives the standard pronunciation, stroke order, interpretation, example sentences and other contents. Alternatively, when using fingertip word-checking to learn words and words, click the "word" or "synonym and antonym" option to view more detailed information. In this embodiment, there is no specific limitation on the content of the reading material. For example, it can be Chinese characters or English words.
[0063] For example, in order to more clearly describe the scenario of using the target content determination method provided by this embodiment, a certain application scenario is used as an example for explanation. It is assumed that the intelligent terminal is a desktop learning device. Figure 1bThis is a structural example diagram of an application scenario in a target content determination method provided in Example 1 of the present application. Figure 1b As shown, the desktop learning device 1 includes a display screen 11, and a camera 12 is included at the top of the desktop learning device. The camera 12 is arranged toward the desktop, so that the camera 12 can capture the picture of the reading material 2 placed on the desktop. Function buttons are also arranged on the desktop learning device 1 to turn on or off various functions. The desktop learning device 1 integrates a target content determination method. When the word search function is turned on, when a hand points to a word or a word on the reading material, the desktop learning device 1 can determine the target content.
[0064] In this embodiment, it can be considered that the electronic device on which the method provided in this embodiment relies is provided with a trigger button, and the user can trigger the fingertip word search function by pressing the "word search start" button displayed on the electronic device. When the user triggers the "word search start" button, the electronic device can determine the operation in response to the triggered fingertip content. At this time, the video acquisition device on the electronic device will be turned on, and the video acquisition device can capture the video screen of the reading material in real time. It can be understood that if the user points to certain content of the reading material with a finger, the electronic device can also capture the video stream. The video stream can be specifically understood as the transmission of video data. For example, it can be processed as a stable and continuous stream through the network. In this way, the received information can be processed before the complete data information is received. The method of receiving and processing at the same time solves the problem of transmission of video data information on the network well. The video stream contains multiple video frames, and the collected multiple video frames are transmitted in the form of data streams to form a video stream.
[0065] For example, two text query buttons may be provided on the electronic device, including a sentence query button and a word query button. For the sentence query button, when the fingertip points to a certain position, the function can query the information of the line where the position is located. For the word query button, when the fingertip points to a certain position, the function can query the information related to the word at the position.
[0066] In this embodiment, when the user triggers the fingertip content determination operation, the execution subject will respond to the triggered fingertip content determination operation, start the video acquisition device to collect video streams relative to the reading material in real time, and at the same time, the collected video streams will be transmitted to the execution subject provided by this implementation in real time. The execution subject receives the video stream collected by the video acquisition device relative to the reading material in real time. It should be noted that in this embodiment, it is necessary to determine the content of the reading material pointed to by the fingertip based on the video stream.
[0067] S102: Determine fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream.
[0068] In this embodiment, the video stream contains multiple video frames, the video frame at the current moment is recorded as the current video frame, and the video frame at the previous historical moment is recorded as the previous video frame. In order to detect and recognize text content, it is necessary to first determine the stability of the fingertip based on the video stream. Only when it is determined that the fingertip is stable can text detection and recognition be performed.
[0069] Considering that in the prior art, fingertip stability determination is currently required for each video frame through a fingertip positioning model, which occupies a relatively high computing resource, and the fingertip positioning model runs at a lower speed than the video stream frame rate, which will affect the fingertip stability determination result due to partial data loss, thereby affecting the determination of the target content pointed to by the fingertip in the reading material. In this embodiment, fingertip stability determination is performed based on the motion change of the current video frame relative to the previous video frame in the video stream.
[0070] After the above steps receive the video stream captured by the video acquisition device relative to the reading material, this step can obtain the current video frame and the previous video frame from the video stream. Fingertip stability is determined based on the motion changes of the current video frame and the previous video frame. When making a fingertip stability determination, it is necessary to first determine whether the fingertip stability determination conditions are currently met, and then make a fingertip stability determination when the stability determination conditions are met. It can be understood that after the current video frame and the previous video frame are known, the motion changes between the current video frame and the previous video frame can be determined based on the optical flow map. Optical flow refers to the movement of target pixels in the video frame caused by the movement of objects in the video frame in two consecutive video frames.
[0071] Continuing with the above description, by calculating the optical flow of the current video frame and the previous video frame, the current optical flow map can be obtained, and the current optical flow map and the previous optical flow map are segmented to divide the motion area. Then, the area from motion to stillness can be determined, and the stillness time of the area can be determined. If the stillness time is greater than the set time threshold, it can be determined that the fingertip stability judgment condition is currently met.
[0072] In this embodiment, after determining that the fingertip stability determination condition is currently met, whether the fingertip is stable is determined based on whether the position information of the fingertip changes. It should be noted that only when the fingertip is determined to be stable, the content pointed by the fingertip is further determined. When the fingertip is determined to be unstable, the content pointed by the fingertip cannot be further determined, and it is necessary to return to continue to obtain the video stream.
[0073] S103: When the current determination result is that the fingertip is stable, determine a content detection area in the current video frame, and determine the target content pointed to by the fingertip from the content detection area.
[0074] The content detection area in the current video frame can be specifically understood as the area for content detection determined based on the fingertip pointing, which is equivalent to the text line to be recognized. It can be understood that the content detection area in the current video frame is related to the current fingertip position coordinates corresponding to the fingertip pointing to the reading material. The target content pointed by the fingertip can be specifically understood as the specific content of the word or word pointed by the fingertip.
[0075] In this embodiment, after determining that the fingertip is stable, the content pointed to by the fingertip is determined. First, the content detection area in the current video frame needs to be determined, and then the specific content of the word pointed to by the fingertip is determined from the content detection area. The process of determining the content detection area in the current video frame can be to obtain the current fingertip position coordinates corresponding to the current video frame when the fingertip is stable. In addition, the interception size can be pre-set, and the content detection area is determined based on the current fingertip position coordinates and the pre-set interception size.
[0076] In this embodiment, after determining the content detection area, it is necessary to determine the target content pointed to by the fingertip in the content detection area. The content detection area is segmented and then input into a pre-trained text recognition model, and the recognition result can be output. Exemplarily, the pre-trained text recognition model can be a connectionist temporal classification (CTC) based on a neural network. It is understandable that the recognition result may include placeholders and non-placeholders. Based on the text recognition model, the single character information of each non-placeholder can be determined, and the single character information can include the position information of the single character and the specific content of the single character.
[0077] Continuing with the above description, after determining the single character information, the single character can be segmented to obtain the segmented content of each segmented word contained in the text line. Further based on the single character information and the segmented content, the word position information of each word contained in the text line is determined. According to the position information of each word, the target word position information of the target word pointed by the fingertip can be determined, and the target word can also be determined, and the target word is used as the target content.
[0078] The first embodiment of the present invention provides a method for determining target content. First, in response to a triggered fingertip content determination operation, a video stream collected by a video acquisition device relative to a reading material is started and received; then, the fingertip stability is determined based on the motion change of the current video frame relative to the previous video frame in the video stream; finally, when the current determination result is that the fingertip is stable, the content detection area in the current video frame is determined, and the target content pointed to by the fingertip is determined from the content detection area. Compared with the existing method that requires fingertip positioning model to determine fingertip stability for each video frame, the above technical solution determines fingertip stability based on the motion change of the current video frame relative to the previous video frame, has a small amount of calculation, saves computing resources, and can ensure that data is not lost to a large extent, so that the target content pointed to by the fingertip can be quickly identified by pointing the fingertip to the reading material, thereby improving the accuracy of content recognition.
[0079] As an optional embodiment of this embodiment, based on the above optimization, the method further includes: searching a preset content database, determining and displaying interpretation information corresponding to the target content, and playing pronunciation information of the target content.
[0080] In this embodiment, the relevant information of the target content pointed to by the user's fingertip can be displayed accordingly through this step, so that the user can obtain the required information. In one implementation, the interpretation information corresponding to the target content can be displayed on the display screen of the electronic device for the user to view the interpretation information. It should be noted that in this embodiment, there is no specific restriction on the display mode of the interpretation information. The display mode of the interpretation information can be set before the electronic device leaves the factory, or it can be a personalized display mode, and the user can set the display mode according to his own needs. In another implementation, the pronunciation information of the target content can be automatically played when the user points to the target content with his fingertip. In this embodiment, there is no restriction on the specific broadcast form of the pronunciation information. The playback mode of the pronunciation information can be set before the electronic device leaves the factory, or it can be a personalized display mode, and the user can set the playback mode according to his own needs. Of course, the pronunciation information of the target content can also be played while displaying the interpretation information corresponding to the target content. What types of content can be specifically displayed are related to the design of the electronic device before leaving the factory.
[0081] In this optional embodiment, the content database is pre-set, and the content database may store the reading content and the corresponding interpretation information or pronunciation information, and the reading content and the corresponding interpretation information or pronunciation information have a one-to-one binding relationship. When the user points the fingertip at the reading and determines the target content pointed by the fingertip, the pre-set content database is queried to find the interpretation information or pronunciation information corresponding to the target content.
[0082] This optional embodiment specifies that when the fingertip points to the reading material and after the target content pointed to by the fingertip is determined, the interpretation information and pronunciation information corresponding to the target content can also be displayed or played. Through human-computer interaction, the user's point word query needs are met, greatly improving learning efficiency.
[0083] Embodiment 2
[0084] Figure 2 A flow chart of another target content determination method provided in Example 2 of the present application. This embodiment is based on the above-mentioned embodiment. In this embodiment, fingertip stability judgment based on the motion change of the current video frame relative to the previous video frame in the video stream can be specifically expressed as: optical flow calculation is performed on the current video frame and the previous video frame in the video stream to obtain a current optical flow map; the current optical flow map is compared with the previous optical flow map for changes in the motion area, and it is determined whether the fingertip stability judgment conditions are currently met based on the comparison results; if so, fingertip stability judgment is performed by positioning the fingertips in the current video frame and the previous video frame.
[0085] At the same time, this embodiment can also determine the content detection area in the current video frame, and determine the target content pointed to by the fingertip from the content detection area. Specifically expressed as: obtain the current fingertip position coordinates and a preset cropping size corresponding to the fingertip when the fingertip is stable in the current video frame; determine a content detection area with the cropping size based on the current fingertip position coordinates in the current video frame; perform text line recognition on the content detection area, and determine the word position information of a single word from the recognized text line; determine the target word position information of the target word pointed to by the fingertip according to each of the word position information, and use the target word as the target content.
[0086] like Figure 2 As shown, another target content determination method provided in Embodiment 2 of the present application specifically includes the following operations:
[0087] S201. In response to a triggered fingertip content determination operation, start and receive a video stream captured by a video capture device relative to a reading material.
[0088] Exemplarily, the electronic device is integrated with the target content determination method provided by the present embodiment, and has the function of determining the target content. A video acquisition device is installed on the top of the electronic device, and the video acquisition device is directed to the desktop to capture video data of the reading material placed on the desktop. At the same time, the electronic device includes a display screen for displaying relevant content to achieve human-computer interaction. A "point word query" button can also be provided on the electronic device, and the target content determination function can be started by clicking the button. When the user encounters a word or word that needs to be queried while reading a reading material, for example, if the user wants the electronic device to display the interpretation information of the target word or the electronic device to play the pronunciation information of the target word, the user can click the "point word query" button to start the point word query function, which is equivalent to triggering the fingertip content determination operation.
[0089] Continuing with the above description, the user can point his fingertip to the target word he wants to search. At this time, the execution subject, that is, the electronic device, responds to the triggered fingertip content determination operation and turns on the video acquisition device. The video acquisition device collects video data relative to the reading material in real time and transmits it to the execution subject in the form of a video stream. The execution subject receives the video stream collected by the video acquisition device relative to the reading material.
[0090] S202: Perform optical flow calculation on the current video frame and the previous video frame in the video stream to obtain a current optical flow map.
[0091] In this embodiment, video frame data of two adjacent frames, i.e., the current video frame and the previous video frame, are obtained from the video stream. Motion detection is performed on the current video frame and the previous video frame in the video stream by an optical flow algorithm, and the process of performing optical flow calculation is equivalent to determining the displacement of pixels in time. The optical flow method is an important method for motion image analysis. The optical flow expresses the changes in the image. Since it contains information about the motion of the target, it can be used to determine the motion of the target. In this embodiment, the dense optical flow method is preferably used. Exemplarily, assuming that the current video frame and the previous video frame can be represented as video frames of size H*W, it is determined that the optical flow calculation is performed, and the optical flow value of the current optical flow map can be expressed as H*W*2, where H and W represent the height and width of the video frame, respectively.
[0092] Specifically, the optical flow is calculated for the current video frame and the previous video frame in the video stream through a dense optical flow algorithm, that is, detection is performed, so as to output the current optical flow map.
[0093] S203: Compare the current optical flow map with the previous optical flow map in terms of changes in the motion area, and determine whether a fingertip stability determination condition is currently met based on the comparison result.
[0094] Among them, the result of comparing the changes in the motion area between the current optical flow map and the previous optical flow map may be that part of the area in the picture disappears or does not change. The fingertip stability judgment condition can be specifically understood as the fingertip stability judgment can only be performed when the fingertip stability judgment condition is met. This step uses the stillness of the picture as the trigger condition for the subsequent fingertip stability judgment. Compared with the prior art that only uses the stability of the fingertip coordinates as a trigger condition, this technical solution has a smaller amount of calculation, a lower CPU usage rate, and can ensure that data is not lost to a greater extent.
[0095] In this embodiment, the current optical flow map is determined based on the current two video frames, and the previous optical flow map is determined based on the previous two video frames. By comparing the motion area of the current optical flow map with the motion area of the previous optical flow map, the disappeared motion area can be determined, and it is determined whether the disappeared motion area is greater than the set time threshold. If it is greater than the set time threshold, it is considered that part of the area in the picture has changed from motion to stillness, and it is considered that the fingertip stability determination condition is currently met.
[0096] It is understandable that when the user places a finger and points to a word, the video acquisition device can capture multiple video frames including the movement of the finger, and finally the finger falls on the position of the word to be queried. Before that, there will be an area where movement occurs, and the movement area is the movement disappearance area.
[0097] In this embodiment, the disappearance of the moving area for a certain period of time means that no new moving area appears in this area during this period of time, and this area changes from a moving state to a static state during this period of time, and remains static for a period of time, so it can be considered that the part of the image (this area) changes from moving to static. When there is no such area, it is considered that the current state is moving or has been static.
[0098] In this embodiment, the optical flow map can be segmented based on the optical flow value of each point in the optical flow map, and the current optical flow map can be represented as a matrix composed of 0 and 1, and the previous optical flow map can also be represented as a matrix composed of 0 and 1. The two matrices are compared to determine that the values of the matrix elements under the same subscript are different, and the point is considered to be a motion vanishing point. Based on the motion vanishing point, it is judged whether the fingertip stability determination condition is currently met.
[0099] Furthermore, the step of comparing the current optical flow map with the previous optical flow map in terms of the change in the motion area, and determining whether the fingertip stability determination condition is currently met according to the comparison result can be expressed as:
[0100] a1) determining a current motion region of the current optical flow map according to the optical flow value in the current optical flow map, and obtaining a previous motion region of the previous optical flow map.
[0101] In this embodiment, the absolute value of the optical flow value of the current optical flow map is taken, and then threshold segmentation is performed. Among them, the threshold is set in advance based on an empirical value. The method of performing threshold segmentation can be described as taking the absolute value of each optical flow value of the optical flow map and then comparing it with the set threshold, setting the area where the absolute value is greater than or equal to the set threshold to 1, and setting the area where the absolute value is less than the set threshold to 0, thereby determining that the area with a value of 1 is a motion area. Exemplarily, the absolute value of the optical flow value of the size of H*W*2 is taken and threshold segmentation is performed, and merged into data of the size of H*W. It is equivalent to taking the absolute value of the optical flow value of each point in the optical flow map and performing threshold segmentation, so that a matrix composed of 0 and 1 can be obtained, and the area with a value of 1 is determined to be a motion area. Based on the above description, the current motion area of the current optical flow map can be determined. Similarly, the previous motion area of the previous optical flow map can be determined.
[0102] b1) comparing the optical flow points in the current motion region with the optical flow points in the previous motion region to determine the current motion disappearance region.
[0103] Specifically, the optical flow points in the current motion region are compared with the optical flow points in the previous motion region, and the region formed by the optical flow points whose matrix values have changed is determined as the current motion disappearance region.
[0104] c1) based on the previous motion disappearance region cached in the cache data table, determining whether the disappearance time of the current motion disappearance region reaches a set time length.
[0105] In this embodiment, the previous motion disappearance region can be cached in a cache data table. Based on the previous motion disappearance region cached in the cache data table and the current motion disappearance region, the disappearance time of the current motion disappearance region can be determined, and it is determined whether the disappearance time reaches a set time length. The set time length can be set according to a historical experience value.
[0106] d1) If the disappearance time reaches the set time length, it is determined that the fingertip stability determination condition is currently met.
[0107] Specifically, if the disappearance time of the current motion disappearance area reaches a set time, indicating that the area is stationary for the set time, it can be determined that the fingertip stability determination condition is currently met.
[0108] It is understandable that, compared with only using the stability of the fingertip coordinates as a trigger condition, the technical solution uses less computation and lower CPU usage, and guarantees data loss to a greater extent, by using the stillness of the screen as a trigger condition for subsequent fingertip positioning and text detection and recognition. In addition, compared with the global screen, the judgment based on the state of the local area can improve the response stability to complex situations such as light and shadow changes and non-stationary areas.
[0109] S204: If yes, determine the fingertip stability by locating the fingertip in the current video frame and the previous video frame.
[0110] In this embodiment, this step can be used to determine whether the fingertip stability determination condition is currently met. If the fingertip stability determination condition is met, the fingertip can be located based on the two preceding and following video frames to perform fingertip stability determination.
[0111] Considering that in desktop scenarios, the minimum width of a single character is about 5 to 10 pixels, accurate fingertip coordinates are required. In addition, in order to ensure the user experience on the mobile terminal, fingertip positioning needs to be completed at a faster speed. The existing technical solutions are difficult to balance speed and accuracy. In this embodiment, fingertip positioning is divided into two stages. The first stage is fast and rough positioning, and the second stage is precise positioning. The combination of the two stages achieves fast and accurate fingertip positioning. It can balance speed and accuracy in scenarios with low computing power.
[0112] Exemplarily, the specific implementation of fingertip positioning can be described as: in the first stage, only the area where the finger is located is roughly determined in the video frame by feature extraction, without specific positioning. For example, the feature information of the video frame can be matched with the predetermined fingertip feature information to determine whether there is a fingertip in the video frame. If there is a fingertip, an area is delineated within the set range based on the existence of the fingertip as a rough preliminary identification area.
[0113] In the second stage, precise positioning is performed, specifically, the fingertip position can be precisely located in the area where the finger is located determined in the first stage. For example, the specific position of the fingertip existing in the roughly identified area can be determined, and the determined position information is used as the fingertip position information of the fingertip in the video frame. In the existing fingertip positioning implementation, it is necessary to identify and precisely locate the fingertips in each video frame. Although the accuracy of fingertip positioning is guaranteed, it occupies more computing resources and affects the speed. In this embodiment, fingertip positioning is divided into two stages: the first stage is fast coarse positioning, and the second stage is precise positioning.
[0114] It can be seen that the first stage only needs to identify the information of the current video frame, and the second stage is to accurately locate the fingertips, which not only ensures the accuracy of fingertip positioning, but also improves the speed. The combination of the two stages achieves fast and accurate fingertip positioning, which can balance speed and accuracy in scenarios with low computing power.
[0115] Furthermore, the step of determining fingertip stability by locating the fingertip in the current video frame and the previous video frame can be expressed as:
[0116] a2) Obtain the previous fingertip position information of the fingertip contained in the previous video frame.
[0117] Specifically, fingertip region recognition is performed in the previous video frame to obtain the previous fingertip region containing the fingertip. Fingertip positioning is performed in the fingertip region to obtain the previous fingertip position information of the fingertip contained in the previous video frame. The previous fingertip position information can be expressed in coordinate form.
[0118] b2) performing fingertip region recognition in the current video frame to obtain a fingertip region including the fingertip.
[0119] Specifically, extract the feature information of the current video frame, match the fingertip feature information with the feature information of the current video frame, and if they match, it can be determined that the fingertip exists in the current video frame. According to the set interception size, intercept the area around the fingertip to obtain the fingertip area containing the fingertip. It should be noted that the function implemented by this step is the initial fingertip positioning stage, which realizes rapid identification of fingertips and preliminary rough positioning of fingertips.
[0120] c2) performing fingertip positioning in the fingertip area to obtain current fingertip position information of the fingertip.
[0121] In this step, after the fingertip area containing the fingertip is preliminarily determined in the above step, the fingertip is located in the area to obtain the current fingertip position information of the fingertip. The current fingertip position information can be expressed in the form of coordinates. It should be noted that this step is performed after the above fingertip is initially located, and based on the area containing the fingertip determined in the above step, the fingertip is further accurately located.
[0122] d2) If the position difference between the current fingertip position information and the previous fingertip position information is within a set range, the current determination result is determined as the fingertip is stable.
[0123] The setting range can be set according to actual conditions. In this embodiment, the position difference between the current fingertip position information and the previous fingertip position information is calculated, and if the position difference is within the setting range, it is considered that the fingertip is relatively still, and the current determination result is that the fingertip is stable.
[0124] It should be noted that if the fingertip is determined to be unstable, it is necessary to return to obtain the video stream data collected by the video acquisition device and perform fingertip stability determination based on the newly received video stream. The following steps S205-S208 provide specific implementation steps for determining the target content pointed by the fingertip.
[0125] S205: Obtain the current fingertip position coordinates corresponding to the fingertip being stable in the current video frame and a preset capture size.
[0126] In this embodiment, when it is determined that the fingertip is stable, the corresponding current fingertip position coordinates in the current video frame and the preset interception size are obtained. The current fingertip position coordinates can be determined based on the above steps. The interception size can be set based on an empirical value, and the area around the fingertip can be intercepted by the interception size. In this embodiment, there is no specific restriction on the interception size, for example, it can be a rectangle with set length and width, or a square with set length and width, or other shapes.
[0127] S206: Determine a content detection area having the clipping size in the current video frame based on the current fingertip position coordinates.
[0128] In this embodiment, when the current fingertip position coordinates are known, the area around the fingertip is captured in the current video frame according to the current fingertip position coordinates and a set capture size. In this embodiment, the area is recorded as a content detection area.
[0129] In this embodiment, there is no specific limitation on the method of determining the content detection area based on the current fingertip position coordinates and the interception size. For example, the current fingertip position coordinates can be used as the center point of the target detection area, and the content detection area can be determined based on the interception size. Alternatively, the current fingertip position coordinates can be used as the center point on the bottom edge of the target detection area, and the interception size can be used to determine the content detection area. Alternatively, based on the current fingertip position coordinates, the content detection area can be determined by intercepting the size of a row above the current fingertip position coordinates.
[0130] S207: Perform text line recognition on the content detection area, and determine word position information of a single word from the recognized text line.
[0131] Considering that the word or Chinese phrase corresponding to the fingertip needs to be obtained during text recognition, it is necessary to obtain not only the text content but also the coordinates at the character level. There are two main solutions in the prior art. The first solution is based on text line level detection and recognition, but lacks character level position; the other solution is based on character level detection and recognition, but its annotation cost is much higher than that of text line level annotation. In this embodiment, the character position is inferred based on the text recognition model, which can greatly reduce the annotation cost compared with the detection and recognition of a single character.
[0132] The word position information of a single word can be represented by the coordinates of the four vertices of the word frame, or by the coordinates of the center point of the word frame and the width and height of the word frame, and no specific limitation is made here. In this embodiment, the position information and content information of a single character are first determined, and then the character sequence is segmented based on the position information and content of the single character to obtain the word position information of the single word.
[0133] In this embodiment, the content detection area is first segmented to obtain multiple pictures. Then the multiple pictures are input into a text recognition model, which can be pre-trained. By inputting multiple pictures into the text recognition model, a text recognition result corresponding to the content detection area can be obtained, and the text recognition result is represented in the form of a character sequence. It is further necessary to classify the characters in the character sequence, and based on the classification results and the positions of each character, calculate the average placeholder length of the placeholders between non-placeholder characters. Based on the average placeholder length and the position information of the non-placeholder, the single character information of each non-placeholder can be determined. At the same time, the single character content of each non-placeholder character can also be determined.
[0134] Continuing with the above description, after determining the single character content and position of each non-placeholder character in the character sequence, the character sequence can be segmented to obtain the word composition content corresponding to each word. Further based on the word composition content and single character position information, the word position information of a single word can be determined. In this embodiment, the character position is inferred based on the text recognition model, which can greatly reduce the annotation cost compared to the detection and recognition of a single character.
[0135] Furthermore, the performing text line recognition on the content detection area and determining word position information of a single word from the recognized text line includes:
[0136] a3) Input the content detection area after text segmentation processing into the trained text recognition model to obtain the output text line recognition result.
[0137] The text recognition model may preferably use a CTC character recognition model. The text recognition model may be obtained by training based on a large amount of image-character sample data. The training process of the text recognition model is not specifically described here.
[0138] Considering that the content detection area contains multiple characters of the text line, the content detection area is first subjected to text segmentation processing. In this embodiment, there is no specific limitation on the method used for text segmentation processing. The content detection area after text segmentation processing is input into the text recognition model, and a text line recognition result can be output. Among them, the text line recognition result refers to the character sequence included in the text line.
[0139] b3) determining the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result.
[0140] Among them, the character category includes placeholders and non-placeholders, and non-placeholders can be understood as normal characters. In this step, the text recognition result is obtained, that is, the character sequence contained in the text line. Specifically, according to the text line recognition result, the contained characters can be classified into character categories to determine the placeholders and non-placeholders. Then the average placeholder length of each placeholder between the non-placeholder characters in the character sequence is calculated. According to the average placeholder length and the position information of each non-placeholder character, the single character position information and single character content information of each non-placeholder are determined.
[0141] Furthermore, the determining of the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result includes:
[0142] b31) Determine the character categories of the characters included in the text line recognition result, divide the characters into placeholders and non-placeholders, and obtain the placeholder character position information of each placeholder and the non-placeholder character position information of the non-placeholder.
[0143] Specifically, based on a set algorithm, such as a greedy algorithm, the character categories of the characters included in the text line recognition result are determined. At the same time, the placeholder character position information of each placeholder and the non-placeholder character position information of the non-placeholder can be obtained. The position information of the placeholder and the position information of the non-placeholder can both be represented based on the position of the placeholder center point.
[0144] b32) Determine the average length of the placeholders between non-placeholder characters through the placeholder character position information.
[0145] Exemplarily, assuming that there is a placeholder at the first and last positions in the character sequence, the first and last placeholders are ignored, and the average length of the placeholders between non-placeholder characters is calculated. It can be understood that when the placeholder character position information of the placeholder and the non-placeholder character position information of the non-placeholder and the length of the placeholder and non-placeholder characters are known, the length between the non-placeholder characters of the character sequence can be calculated, and combined with the number of placeholders, the average length of the placeholders between the non-placeholder characters can be calculated.
[0146] b33) Determine the single character position information and single character content information of each non-placeholder according to the average placeholder length and the position information of each non-placeholder character.
[0147] This step can determine the character frame of each non-placeholder, that is, the single character position information, based on the average placeholder length and the position information of each non-placeholder character. The single character position information can be represented by the coordinates of the four vertices of the character frame, or by the coordinates of the center point of the character frame and the width and height of the character frame. While determining the single character position information of each non-placeholder, the single character content information can also be determined. Exemplarily, each non-placeholder character is traversed, and based on the average length of the placeholders between characters, the left and right placeholder lengths of each character are determined, thereby determining the left and right boundaries of the character; the frame of each character is determined based on the left and right boundaries of the character and the upper and lower boundaries of the character.
[0148] In this embodiment, the solution of determining a single character frame based on the average placeholder width can output a more accurate character frame when the widths of characters in the same text line are inconsistent and the widths of intervals between characters are inconsistent.
[0149] b34) Constructing corresponding non-placeholder single character information based on the single character position information and the single character content information.
[0150] Specifically, the single-character position information and the single-character content information constitute the corresponding non-placeholder single-character information.
[0151] c3) obtaining the word segmentation content of each word contained in the text line by performing word segmentation processing on the text line recognition result.
[0152] Specifically, the recognized character sequence is segmented to obtain the segmented content of each segmented word contained in the text line. Exemplarily, the text line recognition result is segmented in Chinese and English to obtain multiple words or phrases. If the reading content is in English, the text line recognition result can be segmented to obtain words as the segmented content. If the reading content is text, the text line recognition result can be segmented to obtain phrases as the segmented content. Of course, there may also be a single word as the segmented content.
[0153] d3) Determine the word position information of each word contained in the text line according to the single character information and the word segmentation composition content.
[0154] Among them, the single character information includes single character position information and single character content information. According to the single character position information and the word segmentation composition content obtained in the previous step, the word position information of each word contained in the text line can be determined. Exemplarily, the width of the word can be determined according to the single character width and the content of the word, and then the word frame, that is, the word position information, can be determined. Similarly, the word position information can also be represented by the coordinates of the four vertices of the word frame, or by the coordinates of the center point of the word frame and the width and height of the word frame, and no specific restrictions are made here.
[0155] S208. Determine the target word position information of the target word pointed to by the fingertip according to the word position information, and use the target word as the target content.
[0156] It should be noted that the above steps identify the line text information, and the target word needs to be further determined based on the distance information. Specifically, the distance from each word position information to the fingertip is calculated respectively, and the word position information with the closest distance is used as the word position information of the target word. And if the content of each word has been identified in the above steps, the corresponding target word can be determined based on the target word position information, and the target word can be used as the target content.
[0157] This embodiment concretizes the steps of determining the stability of the fingertip according to the motion change of the current video frame relative to the previous video frame in the video stream, and determining the content detection area in the current video frame, and determining the target content pointed to by the fingertip from the content detection area. The above technical scheme uses the stillness of the picture as the trigger condition for the subsequent fingertip positioning model and text detection and recognition. Compared with only using the stability of the fingertip coordinates as a trigger condition, the computing resource usage rate is low and data loss is guaranteed to a large extent. In addition, based on the judgment of the state of the local area, compared with the global picture, the response stability to complex situations such as light and shadow changes and non-static areas can be improved. When performing text recognition, the character position is inferred based on the recognition model, which can greatly reduce the annotation cost compared to the detection and recognition of a single character.
[0158] Embodiment 3
[0159] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Example 3 of the present application. Figure 3 As shown, the electronic device 30 may include: a display screen 300 , at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , at least one communication bus 302 , and a video acquisition device 306 .
[0160] The communication bus 302 is used to realize the connection and communication between these components.
[0161] The user interface 303 may include a display screen (Display) and a connection interface of a video acquisition device (Camera). The optional user interface 303 may also include a standard wired interface and a wireless interface.
[0162] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0163] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts of the entire electronic device 30, and executes various functions and processes data of the electronic device 30 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operation user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0164] In this embodiment, the processor 301 runs the target content determination method on the electronic device, the video acquisition device 306 sends the video stream acquired during the target content determination operation to the processor, and the display screen 300 displays the content when the target content determination method is running; wherein,
[0165] In response to the triggered fingertip content determination operation, the processor 301 starts and receives a video stream captured by a video capture device relative to the reading material;
[0166] The processor 301 determines the fingertip stability according to the motion change of the current video frame relative to the previous video frame in the video stream;
[0167] When the current determination result is that the fingertip is stable, the processor 301 determines a content detection area in the current video frame, and determines the target content pointed to by the fingertip from the content detection area;
[0168] Among them, the memory 305 in the electronic device 30 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating network communication module, a user interface module, and an operating application program of the electronic device. Figure 3 In the electronic device 30 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call the operating application of the electronic device stored in the memory 305, and specifically perform the following operations:
[0169] In response to the triggered fingertip content determination operation, starting and receiving a video stream captured by a video capture device relative to the reading material;
[0170] Determine fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream;
[0171] When the current determination result is that the fingertip is stable, a content detection area in the current video frame is determined, and a target content pointed to by the fingertip is determined from the content detection area.
[0172] Furthermore, the processor 301 calls the program in the memory 305 to optimize the fingertip stability judgment based on the motion change of the current video frame relative to the previous video frame in the video stream as follows: perform optical flow calculation on the current video frame and the previous video frame in the video stream to obtain a current optical flow map; compare the changes in the motion area of the current optical flow map with the previous optical flow map, and determine whether the fingertip stability judgment conditions are currently met based on the comparison results; if so, perform fingertip stability judgment by positioning the fingertips in the current video frame and the previous video frame.
[0173] Furthermore, the processor 301 calls the program in the memory 305 to compare the changes in the motion area of the current optical flow map with the previous optical flow map, and determines whether the fingertip stability judgment condition is currently met based on the comparison result. The specific optimization is as follows: according to the optical flow value in the current optical flow map, determine the current motion area of the current optical flow map, and obtain the previous motion area of the previous optical flow map; compare the optical flow points in the current motion area with the optical flow points in the previous motion area to determine the current motion disappearance area; based on the previous motion disappearance area cached in the cache data table, determine whether the disappearance time of the current motion disappearance area reaches the set duration; if the disappearance time reaches the set duration, it is determined that the fingertip stability judgment condition is currently met.
[0174] Furthermore, the processor 301 calls the program in the memory 305 to optimize the fingertip stability judgment by locating the fingertips in the current video frame and the previous video frame as follows: obtaining the previous fingertip position information of the fingertip contained in the previous video frame; performing fingertip area recognition in the current video frame to obtain the fingertip area containing the fingertip; performing fingertip positioning in the fingertip area to obtain the current fingertip position information of the fingertip; if the position difference between the current fingertip position information and the previous fingertip position information is within a set range, determining the current judgment result as fingertip stability.
[0175] Furthermore, the processor 301 calls the program in the memory 305 to determine the content detection area in the current video frame, and determine the target content pointed to by the fingertip from the content detection area in a specific optimization as follows: obtain the current fingertip position coordinates and a preset cropping size corresponding to the fingertip when the fingertip is stable in the current video frame; determine a content detection area with the cropping size based on the current fingertip position coordinates in the current video frame; perform text line recognition on the content detection area, and determine the word position information of a single word from the recognized text line; determine the target word position information of the target word pointed to by the fingertip according to each of the word position information, and use the target word as the target content.
[0176] Furthermore, the processor 301 calls the program in the memory 305 to perform text line recognition on the content detection area, and optimize the determination of the word position information of a single word from the recognized text line as follows: input the content detection area after text segmentation processing into a trained text recognition model to obtain an output text line recognition result; determine the single character information of each non-placeholder based on the character position information of the placeholder and non-placeholder in the text line recognition result; obtain the word segmentation content of each word contained in the text line through word segmentation processing of the text line recognition result; determine the word position information of each word contained in the text line based on the single character information and the word segmentation content.
[0177] Furthermore, the processor 301 calls the program in the memory 305 to determine the single character information of each non-placeholder based on the character position information of the placeholders and non-placeholders in the text line recognition result, and specifically optimizes it as follows: determining the character category of the characters included in the text line recognition result, dividing the characters into placeholders and non-placeholders, and obtaining the placeholder character position information of each placeholder and the non-placeholder character position information of the non-placeholders; determining the average placeholder length of the placeholders between non-placeholder characters through the placeholder character position information; determining the single character position information and single character content information of each non-placeholder based on the average placeholder length and the non-placeholder character position information; and constructing the single character information of the corresponding non-placeholder based on the single character position information and the single character content information.
[0178] Furthermore, the processor 301 calls the program in the memory 305 to search a preset content database, determine and display the interpretation information corresponding to the target content, and play the pronunciation information of the target content.
[0179] When an electronic device provided in Embodiment 3 of the present application executes the target content determination method provided in Embodiment 1 or Embodiment 2 above, it has functions and beneficial effects corresponding to the target content determination method.
[0180] Embodiment 4
[0181] Embodiment 4 of the present application further provides a computer storage medium, wherein the computer storage medium can store multiple instructions.
[0182] The instructions are suitable for being loaded by a processor and executing the steps of the method provided in Example 1 or Example 2. The specific execution process can refer to the description of Example 1 or Example 2, which will not be repeated here.
[0183] The device where the storage medium is located may be an electronic device that integrates the blackboard display method.
[0184] Those skilled in the art should understand that the embodiments of the present application may be provided as methods or computer program products.
[0185] Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0186] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0187] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0188] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0189] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0190] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves. It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the presence of other identical elements in the process, method, commodity or device including the elements.
[0191] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for determining target content, characterized in that: include: In response to the triggered fingertip content determination operation, starting and receiving a video stream captured by a video capture device relative to the reading material; Determine fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream; When the current determination result is that the fingertip is stable, a content detection area in the current video frame is determined, and a target content pointed to by the fingertip is determined from the content detection area.
2. The method according to claim 1, characterized in that: The step of determining fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream includes: Perform optical flow calculation on the current video frame and the previous video frame in the video stream to obtain a current optical flow map; Comparing the current optical flow map with the previous optical flow map for changes in the motion area, and determining whether the fingertip stability determination condition is currently met according to the comparison result; If so, the fingertip stability is determined by locating the fingertip in the current video frame and the previous video frame.
3. The method according to claim 2, characterized in that The step of comparing the current optical flow map with the previous optical flow map for changes in the motion area, and determining whether the fingertip stability determination condition is currently met according to the comparison result, includes: Determine a current motion region of the current optical flow map according to the optical flow value in the current optical flow map, and obtain a previous motion region of the previous optical flow map; Comparing the optical flow points in the current motion area with the optical flow points in the previous motion area to determine the current motion disappearance area; Based on the previous motion disappearance area cached in the cache data table, determining whether the disappearance time of the current motion disappearance area reaches a set time length; If the disappearance time reaches the set time length, it is determined that the fingertip stability determination condition is currently met.
4. The method according to claim 2, characterized in that: The determining of fingertip stability by positioning the fingertip in the current video frame and the previous video frame includes: Obtaining the previous fingertip position information of the fingertip contained in the previous video frame; Perform fingertip region recognition in the current video frame to obtain a fingertip region including the fingertip; Positioning the fingertip in the fingertip area to obtain current fingertip position information of the fingertip; If the position difference between the current fingertip position information and the previous fingertip position information is within a set range, the current determination result is determined as the fingertip is stable.
5. The method according to claim 1, characterized in that The determining of the content detection area in the current video frame, and determining the target content pointed to by the fingertip from the content detection area, comprises: Obtaining the current fingertip position coordinates and a preset interception size corresponding to the fingertip being stable in the current video frame; Determining a content detection area having the clipping size based on the current fingertip position coordinates in the current video frame; Performing text line recognition on the content detection area, and determining word position information of a single word from the recognized text line; The target word position information of the target word pointed by the fingertip is determined according to the word position information, and the target word is used as the target content.
6. The method according to claim 5, characterized in that The step of performing text line recognition on the content detection area and determining word position information of a single word from the recognized text line includes: Input the content detection area after text segmentation processing into the trained text recognition model to obtain the output text line recognition result; Determine the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result; Obtaining the word component content of each word contained in the text line by word segmentation processing on the text line recognition result; The word position information of each word contained in the text line is determined according to the single character information and the word segmentation composition content.
7. The method according to claim 6, characterized in that The step of determining the single character information of each non-placeholder according to the character position information of the placeholder and the non-placeholder in the text line recognition result includes: Determine the character categories of the characters included in the text line recognition result, classify the characters into placeholders and non-placeholders, and obtain the placeholder character position information of each placeholder and the non-placeholder character position information of the non-placeholder; Determine the average length of the placeholders between the non-placeholder characters by using the placeholder character position information; Determine the single character position information and single character content information of each non-placeholder according to the average placeholder length and the position information of each non-placeholder character; Corresponding non-placeholder single character information is constructed based on the single character position information and the single character content information.
8. The method according to any one of claims 1 to 7, characterized in that: Also includes: Search a preset content database, determine and display the interpretation information corresponding to the target content, and play the pronunciation information of the target content.
9. An electronic device, characterized in that: include: A video acquisition device, a display screen and one or more processors, wherein the processor runs the target content determination method on the electronic device, the video acquisition device sends the video stream acquired during the target content determination operation to the processor, and the display screen displays the content when the target content determination method is running; wherein, The processor, in response to the triggered fingertip content determination operation, starts and receives a video stream captured by a video capture device relative to the reading material; The processor determines fingertip stability based on the motion change of the current video frame relative to the previous video frame in the video stream; When the current determination result is that the fingertip is stable, the processor determines a content detection area in the current video frame, and determines the target content pointed to by the fingertip from the content detection area; The electronic device further comprises: a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Finger stable frame detection method and device and computer readable storage medium
CN113485579A
Gesture recognition method and device, equipment and medium
CN113642493A
Text content recognition method and device, computer equipment and storage medium
CN115131693A
