A cursor generation method, a cursor generation device and a scanning pen
Patent Information
- Application Number
- CN202111314322.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2041-11-08
AI Technical Summary
在扫描笔的使用过程中,经常会遇到不同字体大小的文本内容需要扫描录入,这会导致用户在操作过程中容易出现扫描起止位置不准确的情况,造成扫描笔的扫描准确率下降,影响用户体验
[0016]第五方面,本申请提供了一种计算机程序产品,上述计算机程序产品包括计算机程序,上述计算机程序被一个或多个处理器执行时实现如上述第一方面的方法的步骤。
Smart Images

Figure CN116110048B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of smart device technology, and in particular relates to a cursor generation method, a cursor generation device, a scanning pen, and a computer-readable storage medium. Background Technology
[0002] A scanning pen, resembling a pen in appearance, is a handheld device that allows users to scan and input text. For scanned text, the scanning pen can perform various functions such as display, definition explanation, translation, and voice playback. However, during use, users often encounter text of varying font sizes that need to be scanned. This can lead to inaccurate start and end positions during scanning, resulting in decreased scanning accuracy and impacting user experience. Currently, some scanning pens have cursor indicators, but the cursor length is not adjustable. This means that even with text of different font sizes, the scanning pen cannot provide precise cursor positioning. Therefore, existing cursor generation solutions for scanning pens lack flexibility and cannot guarantee the accuracy of scan start and end positions in complex scanning scenarios. Summary of the Invention
[0003] This application provides a cursor generation method, a cursor generation device, a scanning pen, and a computer-readable storage medium, which can ensure the accuracy of the scanning start and end positions of the scanning pen in complex scanning scenarios and reduce the occurrence of missed scans, overscans, and incorrect scans.
[0004] In a first aspect, this application provides a cursor generation method, which is applied to a scanning pen. The scanning pen includes a preset number of light-emitting diodes (LEDs), and the imaging focal points of each LED are aligned on the same straight line. The cursor generation method includes:
[0005] After the scanning pen starts scanning, it acquires a real-time image of the currently scanned area;
[0006] Identify the text to be scanned in the aforementioned real-time image;
[0007] Based on the position of the text to be scanned in the real-time image, the target LED is determined from the preset number of LEDs;
[0008] The target LED is lit up so that the scanning pen generates a cursor for the text to be scanned in the scanned area through the lit target LED.
[0009] Secondly, this application provides a cursor generating device, which is applied to a scanning pen. The scanning pen includes a preset number of LEDs, and the imaging focal points of each LED are aligned on the same straight line. The cursor generating device includes:
[0010] The image acquisition module is used to acquire a real-time image of the currently scanned area after the scanning pen starts scanning.
[0011] The text determination module is used to determine the text to be scanned in the aforementioned real-time image;
[0012] The LED determination module is used to determine the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image.
[0013] The LED lighting module is used to light up the target LED so that the scanning pen can generate a cursor for the text to be scanned in the scanned area through the lit target LED.
[0014] Thirdly, this application provides a scanning pen, which includes a memory, a processor, a computer program stored in the memory and executable on the processor, and a preset number of LEDs, wherein the imaging focus of each LED is on the same straight line, and the processor executes the computer program to implement the steps of the method described in the first aspect.
[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.
[0016] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method described in the first aspect.
[0017] The beneficial effects of this application compared to the prior art are as follows: The internal structure of the scanning pen is modified by incorporating a preset number of LEDs, with the imaging focus of each LED aligned on a straight line. This allows the LEDs to form a cursor pattern in the scanned area when illuminated. After the scanning pen begins scanning, a real-time image of the scanned area is acquired, and the text to be scanned is determined within this image. Based on the position of the text in the real-time image, a target LED is identified from the preset number of LEDs and illuminated. In this way, the scanning pen generates a cursor in the scanned area by illuminating the target LED. Furthermore, since the target LED is determined based on the position of the text in the real-time image, the cursor generated by illuminating the target LED corresponds precisely to the text, achieving accurate association between the cursor and the text. The user can then determine the accurate location scanned by the scanning pen through the currently displayed cursor. It is understood that the beneficial effects of the second to fifth aspects described above can be found in the relevant descriptions of the first aspect above, and will not be repeated here. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an example diagram showing the light rays formed in the scanned area when all the LEDs of the scanning pen provided in this application embodiment are lit.
[0020] Figure 2 This is a schematic diagram illustrating the implementation flow of the cursor generation method provided in the embodiments of this application;
[0021] Figure 3 This is an example diagram of a horizontal reference line segment and the text to be scanned provided in an embodiment of this application;
[0022] Figure 4 This is another example diagram of the horizontal reference line segment and the text to be scanned provided in the embodiments of this application;
[0023] Figure 5 This is an example diagram of a cursor and text to be scanned provided in an embodiment of this application;
[0024] Figure 6 This is another example diagram of the cursor and the text to be scanned provided in the embodiments of this application;
[0025] Figure 7This is yet another example diagram of the cursor and the text to be scanned provided in the embodiments of this application;
[0026] Figure 8 This is an example diagram of the cursor corresponding to multiple lines of text to be scanned provided in the embodiments of this application;
[0027] Figure 9 This is an example image of incomplete text to be scanned in a real-time image provided in this application embodiment;
[0028] Figure 10 This is another example of incomplete text to be scanned in a real-time image provided in this application embodiment;
[0029] Figure 11 This is a structural block diagram of the cursor generation device provided in the embodiments of this application;
[0030] Figure 12 This is a schematic diagram of the structure of the scanning pen provided in the embodiments of this application. Detailed Implementation
[0031] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0032] To illustrate the technical solution proposed in this application, specific embodiments are described below.
[0033] The cursor generation method proposed in this application embodiment is described below. This cursor generation method is applied to a scanning pen, which includes a preset number of LEDs, and the imaging focus of each LED is on the same straight line. As an example only, to ensure that the imaging focus of each LED is on the same straight line, the position of each LED in the scanning pen can also be set to be on the same straight line. Of course, other methods of setting the LED positions are also possible, as long as the imaging focus of each LED is on the same straight line; this is not limited here. The preset number is usually three or more. It can be understood that when a user normally uses the scanning pen, they move the pen to the right to scan text on books or other media. Normally, the tip of the scanning pen is a transparent partition, through which the user can see the scanned text. When all the LEDs of the scanning pen are lit, a vertical line is formed at a designated position on (or near) the tip of the scanning pen. This vertical direction refers to the direction perpendicular to the scanning direction (i.e., the moving direction) of the scanning pen when it moves to the right on a plane. In other words, when all the LEDs of the scanning pen are lit, the light emitted by these LEDs shines on the book or other medium, forming a vertical line of light at a designated location within the scanning area (i.e., the area being scanned) of the scanning pen's scanning frame. Figure 1 As shown.
[0034] Please see Figure 2 The implementation process of this cursor generation method is detailed below:
[0035] Step 201: After the scanning pen starts scanning, acquire the real-time image of the currently scanned area.
[0036] In this embodiment, the scanning pen begins scanning when the user places it onto the medium to be scanned (e.g., paper or other scannable media). The scanning pen has a built-in camera that is pointed towards the area where the pen tip is located, thus capturing a real-time image of the currently scanned area.
[0037] Step 202: Identify the text to be scanned in the real-time image.
[0038] In this embodiment, the scanning pen can perform preliminary analysis on the real-time image to determine the text to be scanned. The scanning pen can first detect whether the real-time image contains text. If it does not contain text, it is considered that a false scan has occurred, and subsequent steps are not performed. Conversely, if it contains text, the text to be scanned can be determined based on the number of lines of the contained text.
[0039] In one application scenario, the scanner pen only supports single-line text scanning; or, although the scanner pen supports multi-line text scanning, the user has selected to enable the single-line scanning function. In this case, the process for determining the text to be scanned is as follows:
[0040] A1. Detect the number of lines of text contained in a real-time image.
[0041] A2. If there is only one line, then that line of text will be selected as the text to be scanned.
[0042] It is understandable that when there is only one line of text in a real-time image, that line of text can be directly identified as the text to be scanned.
[0043] A3. If the number of lines exceeds one, calculate the distance between each line of text in the real-time image and the preset horizontal reference line segment.
[0044] The horizontal reference line segment can be understood as the user's desired scanning position, which can be set by the scanning pen. Of course, users can also reset it according to their own usage habits when using the scanning pen; this is not limited here. Constructing an image coordinate system based on the top-left vertex of the real-time image as the origin, with the horizontal axis pointing to the right and the vertical axis pointing downwards, the horizontal reference line segment is usually parallel to this horizontal axis and can be represented by a preset vertical coordinate (because the vertical coordinates of all points in the horizontal reference line segment are the same). In one application scenario, the scanning pen can default to setting the horizontal reference line segment to the middle row of the real-time image. In another application scenario, depending on the user's operating habits, the user can set the horizontal reference line segment to a position higher or lower in the real-time image. For example, some users prefer to use the top of the scanning pen tip close to the text to be scanned, so the horizontal reference line segment can be set to a slightly higher position in the vertical direction of the real-time image; some users prefer to use the bottom of the scanning pen tip close to the text to be scanned, so the horizontal reference line segment can be set to a slightly lower position in the vertical direction of the real-time image.
[0045] The scanning pen can calculate the average vertical coordinate of the center of each line of text, and then calculate the absolute value of the difference between the average vertical coordinate of the center of each line of text and the preset vertical coordinate. The result is the distance between each line of text and the preset horizontal reference line segment.
[0046] A4. The line of text with the smallest distance from the horizontal reference line segment is selected as the text to be scanned.
[0047] It can be understood that the line of text that is closest to the horizontal reference line segment is the text closest to the user's desired scan position. Please refer to [link / reference]. Figure 3 and Figure 4Both figures use dashed lines to illustrate horizontal reference line segments (these dashed lines are only used to understand the embodiments of this application; in actual applications, the scanning pen will not display these dashed lines in the real-time image). Through Figure 3 and Figure 4 Understandably, in the same real-time image, different lateral reference line segments will affect the text to be scanned: Figure 3 In the middle, due to the distance of the text "AAA" Figure 3 The horizontal reference line segment is closest, therefore the text "AAA" can be identified as the text to be scanned; in Figure 4 In the text, due to the distance of "BBB" Figure 4 The horizontal reference line segment is closest, so the text "BBB" can be identified as the text to be scanned.
[0048] In another application scenario, the scanner is one that supports multi-line text scanning, and the user has selected to enable the multi-line scanning function. In this case, each line of text identified in the real-time image can be determined as the text to be scanned. That is, in this application scenario, multiple lines of text can be identified as the text to be scanned at the same time.
[0049] Step 203: Based on the position of the text to be scanned in the real-time image, determine the target LED from a preset number of LEDs.
[0050] In this embodiment, the position of each LED is fixed, that is, the light emission path of each LED is fixed; therefore, for any given LED, when it is lit, the position of the light it forms in the scanned area is also essentially fixed. It can be understood that, in the image coordinate system of the real-time image shown above, based on the following characteristics:
[0051] 1) The imaging focus of each LED of the scanning pen is on the same straight line. That is, the light rays formed by these LEDs in the scanned area are vertical (the light rays cannot move horizontally relative to the given scanned area; that is, the light rays are fixed relative to the scanning pen).
[0052] 2) Real-time images are obtained by capturing images of the scanned area using a camera.
[0053] It can be seen that the light emitted by each LED in the scanned area actually corresponds to one or more vertical coordinates of the real-time image. Since the font size of the text to be scanned varies, and each LED can be individually driven and lit, the scanning pen can determine the target LED based on the position of the text in the real-time image, so that the final cursor length is adapted to the font size of the text. Considering that the light emitted by each LED in the scanned area actually corresponds to one or more vertical coordinates of the real-time image, the scanning pen can specifically determine the target LED from these preset number of LEDs based on the vertical coordinate of the text in the real-time image.
[0054] As an example only, the specific process for determining the target LED is as follows:
[0055] B1. Determine the upper and lower limits of the vertical coordinate of the text to be scanned in the real-time image.
[0056] It can be understood that the difference between the upper and lower limits of the ordinate represents the font height in the text to be scanned. Typically, this font height is positively correlated with the font size.
[0057] B2. Determine the corresponding first LED based on the upper limit value of the vertical axis.
[0058] B3. Determine the corresponding second LED based on the lower limit of the vertical axis.
[0059] The scanning pen can be pre-set with different vertical coordinates corresponding to LEDs. It's understandable that, considering the potentially large illuminated area of a single LED, multiple vertical coordinates might correspond to the same LED. Assuming the scanning pen has n LEDs, these n LEDs are sequentially numbered to obtain LED1, LED2, and so on. n Taking the image coordinate system of the real-time image shown above as an example, assume that the maximum value of the vertical coordinate of the real-time image is y. n The scanning pen can then pre-create a ordinate-LED lookup table as shown in Table 1 below:
[0060] <![CDATA[(0,y1]]]> <![CDATA[LED1]]> <![CDATA[(y1,y2]]]> <![CDATA[LED2]]> <![CDATA[(y2,y3]]]> <![CDATA[LED3]]> …… …… <![CDATA[(y4,y n ]]]> <![CDATA[LED n ]]>
[0061] Table 1
[0062] After obtaining the upper and lower limits of the vertical coordinate of the text to be scanned in the real-time image, the scanning pen can determine the first LED corresponding to the upper limit of the vertical coordinate and the second LED corresponding to the lower limit of the vertical coordinate based on the vertical coordinate intervals in which the upper and lower limits of the vertical coordinate fall.
[0063] B4. The first LED, the second LED, and all LEDs between the first LED and the second LED are identified as target LEDs.
[0064] It is understood that the preset number of LEDs are usually arranged sequentially (e.g., these LEDs are in a straight line). Therefore, for any two non-adjacent LEDs, there must be at least one other LED between them. Considering that this application aims to generate a cursor that can indicate the current scanning position, and the cursor is actually composed of continuous light, the embodiments of this application will determine the first LED, the second LED, and all LEDs between the first LED and the second LED as target LEDs.
[0065] For example, assuming that the first LED is determined to be LED2 and the second LED is LED5 through steps B1-B3, the scanning pen will identify LED2, LED3, LED4 and LED5 as the target LEDs.
[0066] Step 204: Light up the target LED so that the scanning pen generates a cursor for the text to be scanned in the scanned area through the lit target LED.
[0067] In this embodiment, only the target LED is illuminated by the scanning pen; other LEDs not identified as target LEDs remain off. Since the target LEDs are necessarily continuous, the scanning pen can generate a cursor on the scanned medium, such as paper, using the light emitted by the target LEDs to indicate the text currently being scanned (i.e., the text to be scanned). Obviously, the larger the font size of the text to be scanned, the higher the font height; correspondingly, the more LEDs between the first and second LEDs, the longer the generated cursor. Thus, adaptive adjustment of the cursor length is achieved, accurately indicating the text to be scanned.
[0068] Please see Figure 5 , Figure 6 and Figure 7 The text to be scanned in all three images is "AAA". Figure 5 and Figure 6 Examples of cursors generated by the scanning pen when the font size of the text to be scanned is given. It can be seen that the length of the cursor changes accordingly with the font size of the text to be scanned. Figure 5 and Figure 7 Examples of cursors generated by the scanning pen are given when the font size of the text to be scanned is the same, but the position is different. It can be seen that the position of the cursor changes accordingly depending on the position of the text to be scanned.
[0069] In some embodiments, when there are multiple lines of text to be scanned (i.e., more than two lines of text to be scanned), the scanning pen can determine the corresponding target LED for each line of text to be scanned separately in step 203. To make the cursor generated in step 204 more directional, the scanning pen can consider generating a corresponding small cursor for each line of text to be scanned. Therefore, when there are multiple lines of text to be scanned, the scanning pen can further adjust the target LEDs corresponding to each line of text to be scanned after step 203 through the following process:
[0070] C1. Detect whether the last LED in the first target LED determined based on the first text to be scanned is the same as or adjacent to the first LED in the second target LED determined based on the second text to be scanned.
[0071] C2. If the last LED is the same as the first LED, then the last LED is removed from the first target LED, and the first LED is removed from the second target LED.
[0072] C3. If the last LED is adjacent to the first LED, then the last LED is removed from the first target LED, or the first LED is removed from the second target LED.
[0073] For ease of explanation, in any two adjacent lines of text to be scanned, the text above (i.e., the text closer to the horizontal axis) can be denoted as the first text to be scanned, and the text below (i.e., the text farther from the horizontal axis) can be denoted as the second text to be scanned. Through the preceding steps, several target LEDs corresponding to the first text to be scanned can be identified, denoted as the first target LED; similarly, several target LEDs corresponding to the second text to be scanned can be identified, denoted as the second target LED.
[0074] If the last LED in the first target LED is the same as or adjacent to the first LED in the second target LED, then there is no gap between the first and second target LEDs, meaning they form a continuous sequence of LEDs. This results in continuous light emitted by both LEDs when they are lit, and consequently, continuous cursors are generated. In this case, a large cursor (similar to the cursor generated by a single line of large-font text) is generated based on these two lines of text to be scanned.
[0075] To optimize this situation, if the last LED in the first target LED is the same as the first LED in the second target LED, then the last LED can be removed from the first target LED, and the first LED can be removed from the second target LED. For example, please refer to... Figure 8 The first target LEDs corresponding to the first text to be scanned, “AAA”, include LED1, LED2, and LED3. The second target LEDs corresponding to the second text to be scanned, “BBB”, include LED3, LED4, and LED5. The last LED in the first target LEDs is LED3, and the first LED in the second target LEDs is also LED3. Without adjustment, LEDs 1-5 will all be lit, resulting in a large cursor. To address this, the scanning pen can remove LED3 from the first target LEDs, leaving LED1 and LED2 as the remaining first target LEDs; similarly, removing LED3 from the second target LEDs leaves LED4 and LED5 as the remaining second target LEDs. Therefore, in step 204, the lit LEDs will be LED1, LED2, LED4, and LED5. Since LED3 is not lit, a small gap will be formed, thus distinguishing the large cursor from the two smaller cursors.
[0076] Similarly, when the last LED in the first target LED is adjacent to the first LED in the second target LED, the last LED can be removed from the first target LED, or the first LED can be removed from the second target LED. For example: Suppose the first target LEDs corresponding to the first text to be scanned include LED1, LED2, and LED3, and the second target LEDs corresponding to the second text to be scanned include LED4, LED5, and LED6. Then the last LED in the first target LED is LED3, and the first LED in the second target LED is LED4. If no adjustment is made, LED1-LED6 will all be lit, which will result in the generation of a large cursor. In this case, the scanning pen can choose to remove LED3 from the first target LED, so that the remaining first target LEDs are LED1 and LED2. Then in step 204, the LEDs that are lit will be: LED1, LED2, LED4, LED5, and LED6. Since LED3 is not lit, a small gap will be formed, and thus the large cursor can be distinguished into two small cursors. Alternatively, the scanning pen can be selected to remove LED4 from the second target LEDs, leaving LED5 and LED6 as the remaining second target LEDs. In this case, the LEDs lit in step 204 would be: LED1, LED2, LED3, LED5, and LED6. Since LED4 is not lit, a small break will be formed, thus distinguishing the large cursor from the two smaller cursors.
[0077] If there is a gap between the target LEDs corresponding to any two adjacent lines of text to be scanned (that is, the last LED in the first target LED is neither the same as nor adjacent to the first LED in the second target LED), then this gap will naturally become a break to avoid the generation of a large cursor. In other words, the scanning pen does not need to do anything in this case.
[0078] It is understandable that when a user uses a scanning pen to scan and input multi-line text, the user can choose whether the scanning pen needs to generate a separate cursor for each line of text to be scanned, based on their own usage habits. If so, steps C1-C3 can be executed first after step 203, followed by step 204. If not, step 204 can be executed directly after step 203, without needing to execute steps C1-C3.
[0079] In some embodiments, the LEDs in the scanning pen are all tri-color LEDs, meaning each LED consists of a red (R) LED, a green (G) LED, and a blue (B) LED. By controlling the tri-color LEDs of the target LED, the scanning pen can display cursors of different colors. Therefore, step 204 can specifically include: if a cursor color control command is received, lighting up the LED corresponding to the target color in the target LED, where the target color is the color indicated by the cursor color control command; if no cursor color control command is received, lighting up all the LEDs in the target LED. The scanning pen can pre-store several LEDs corresponding to different colors. Considering that more colors can be obtained by adjusting the brightness (i.e., operating current) of each different color LED, the scanning pen can also pre-store several LEDs corresponding to different colors and their operating currents to further enrich the selectable colors of the cursor. When all three primary color LEDs are lit, white light is obtained, meaning the generated cursor is white. It's understandable that white is the default cursor color.
[0080] In some embodiments, the user can also adjust the length of the cursor. After step 204, the scanning pen can further perform the following operations: if a cursor shortening command is received, the endpoint LED is turned off, where the endpoint LED is the LED at the endpoint of the currently lit LEDs. If a cursor lengthening command is received, the unlit LEDs adjacent to the endpoint LED are lit. For ease of understanding, specific examples are provided below for explanation and illustration:
[0081] Assuming that steps 201-204 have identified the target LEDs as LED2, LED3, LED4, and LED5, meaning that LED2, LED3, LED4, and LED5 are now lit, the endpoint LEDs are LED2 and LED5. If the user deems the current cursor too long, they can tap the virtual "Shorten Cursor" button on the scanner's touchscreen to input a cursor shortening command. Correspondingly, upon receiving this command, the scanner can turn off LED2 and / or LED5, thus shortening the generated cursor length. Conversely, if the user deems the current cursor too short, they can tap the virtual "Grow Cursor" button on the scanner's touchscreen to input a cursor growth command. Correspondingly, upon receiving this command, the scanner can light up LED1 and / or LED6, thus increasing the generated cursor length. It's understandable that the user can adjust the cursor length multiple times while using the scanner; therefore, each time the latest endpoint LED is determined based on the currently lit LEDs to ensure that the generated cursor doesn't have any breaks.
[0082] In some embodiments, the scanning pen also makes a preliminary judgment on the completeness of the text to be scanned to avoid invalid scans. After the scanning pen identifies the text to be scanned in the real-time image, it can continue to detect whether the text is complete. If the text is incomplete, the scanning pen can directly output a reminder message to alert the user that the text is missing. Only when the text is complete will the scanning pen continue to determine the target LED based on the text's position in the real-time image, thus generating the cursor. As an example, the reminder message can be in text form; that is, the scanning pen can display a text reminder on its touchscreen, such as "The text to be scanned is missing text. Please check if the font is too large and if the scanning pen is aligned correctly." Furthermore, to prevent the user from missing the text reminder in time, the scanning pen can also trigger a vibration reminder, or emit a voice reminder or ringtone through a speaker; the form of the reminder message is not limited here.
[0083] Please see Figure 9 and Figure 10 Both images provide examples of incomplete text to be scanned in real-time images. Specifically, Figure 9 An example of a real-time image is given when the scanning pen is misaligned. In this case, the user only needs to adjust the position of the scanning pen to continue scanning. Figure 10 An example of a real-time image is given when the font size of the text to be scanned is too large. In this case, the text to be scanned exceeds the scanning capability of the scanning pen, and the scanning pen cannot scan the text.
[0084] As can be seen from the above, the internal structure of the scanning pen has been modified through this embodiment. A preset number of LEDs are built into the scanning pen, and the imaging focus of each LED is on the same straight line. This allows these LEDs to form a cursor pattern when lit. After the scanning pen starts scanning, a real-time image of the currently scanned area can be acquired first. Then, the text to be scanned is determined in the real-time image. Based on the position of the text to be scanned in the real-time image, the target LED can be determined from the preset number of LEDs and lit. In this way, the scanning pen can generate a cursor in the scanned area by lighting up the target LED. Furthermore, since the target LED is determined based on the position of the text to be scanned in the real-time image, the cursor generated by lighting up the target LED can correspond to the text to be scanned, achieving a precise association between the cursor and the text to be scanned. The user can thus know the exact position scanned by the scanning pen through the currently displayed cursor.
[0085] Corresponding to the cursor generation method provided above, this application also provides a cursor generation device. The cursor generation device is applied to a scanning pen, which includes a preset number of LEDs, and the imaging focal points of each LED are aligned on the same straight line; for example... Figure 11 As shown, the cursor generation device 110 includes:
[0086] Image acquisition module 111 is used to acquire a real-time image of the currently scanned area after the scanning pen starts scanning;
[0087] The text determination module 112 is used to determine the text to be scanned in the aforementioned real-time image;
[0088] LED determination module 113 is used to determine the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image.
[0089] LED lighting module 114 is used to light up the target LED so that the scanning pen generates a cursor for the text to be scanned in the scanned area through the lit target LED.
[0090] Optionally, the text determination module 112 mentioned above includes:
[0091] The distance calculation unit is used to calculate the distance between each line of text in the real-time image and a preset horizontal reference line segment if the number of lines of text contained in the real-time image exceeds one line, wherein the horizontal reference line segment is parallel to the horizontal axis of the real-time image.
[0092] The text determination unit is used to determine the line of text that is closest to the aforementioned horizontal reference line segment as the text to be scanned.
[0093] Optionally, the LED determining module 113 is specifically used to determine the target LED from the preset number of LEDs based on the vertical coordinate of the text to be scanned in the real-time image.
[0094] Optionally, the LED determining module 113 mentioned above includes:
[0095] The coordinate determination unit is used to determine the upper limit and lower limit of the vertical coordinate of the text to be scanned in the real-time image.
[0096] The first LED determining unit is used to determine the corresponding first LED based on the upper limit value of the above-mentioned vertical coordinate.
[0097] The second LED determination unit is used to determine the corresponding second LED based on the aforementioned lower limit value of the vertical coordinate.
[0098] The target LED determination unit is used to determine the first LED, the second LED, and all LEDs between the first LED and the second LED as target LEDs.
[0099] Optionally, each of the above-mentioned LEDs uses tri-color LED beads; the above-mentioned LED lighting module 114 includes:
[0100] The first lighting unit is used to light up the LED corresponding to the target color in the target LED if a cursor color control command is received, wherein the target color is the color indicated by the cursor color control command.
[0101] The second lighting unit is used to light up all the LED beads in the target LED if the cursor color control command is not received.
[0102] Optionally, the cursor generation device 110 further includes:
[0103] The cursor shortening module is used to turn off the endpoint LEDs if a cursor shortening command is received, wherein the endpoint LEDs are the LEDs at the endpoints of the currently lit LEDs;
[0104] The cursor growth module is used to light up the unlit LEDs adjacent to the aforementioned endpoint LEDs if a cursor growth command is received.
[0105] Optionally, the cursor generation device 110 further includes:
[0106] The integrity detection module is used to detect whether the text to be scanned is complete after the text determination module 112 determines the text to be scanned in the real-time image.
[0107] The reminder output unit is used to output a reminder message if the text to be scanned is incomplete. The reminder message is used to remind the user that the text to be scanned is missing.
[0108] Accordingly, the LED determination module is specifically used to determine the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image if the text to be scanned is complete.
[0109] As can be seen from the above, the internal structure of the scanning pen has been modified through this embodiment. A preset number of LEDs are built into the scanning pen, and the imaging focus of each LED is on the same straight line. This allows these LEDs to form a cursor pattern when lit. After the scanning pen starts scanning, a real-time image of the currently scanned area can be acquired first. Then, the text to be scanned is determined in the real-time image. Based on the position of the text to be scanned in the real-time image, the target LED can be determined from the preset number of LEDs and lit. In this way, the scanning pen can generate a cursor in the scanned area by lighting up the target LED. Furthermore, since the target LED is determined based on the position of the text to be scanned in the real-time image, the cursor generated by lighting up the target LED can correspond to the text to be scanned, achieving a precise association between the cursor and the text to be scanned. The user can thus know the exact position scanned by the scanning pen through the currently displayed cursor.
[0110] Corresponding to the cursor generation method provided above, this application also provides a scanning pen. Please refer to... Figure 12 The scanning pen 12 in this embodiment includes: a memory 1201, and one or more processors 1202. Figure 12 Only one is shown in the image), a computer program stored in memory 1201 and executable on a processor, and a preset number of LEDs 1203. Figure 12 (Only 3 are shown in the image), and the imaging focus of each of the aforementioned LEDs 1203 is on the same straight line. The memory 1201 stores software programs and units. The processor 1202 executes various functional applications and diagnostics by running the software programs and units stored in the memory 1201 to obtain resources corresponding to the aforementioned preset events. Specifically, the processor 1202 implements the following steps when running the aforementioned computer program stored in the memory 1201:
[0111] After the scanning pen starts scanning, it acquires a real-time image of the currently scanned area;
[0112] Identify the text to be scanned in the aforementioned real-time image;
[0113] Based on the position of the text to be scanned in the real-time image, the target LED is determined from the preset number of LEDs;
[0114] The target LED is lit up so that the scanning pen generates a cursor for the text to be scanned in the scanned area through the lit target LED.
[0115] Assuming the above is the first possible implementation, in the second possible implementation provided based on the first possible implementation, determining the text to be scanned in the real-time image includes:
[0116] If the number of lines of text contained in the above real-time image exceeds one line, then the distance between each line of text in the above real-time image and the preset horizontal reference line segment is calculated, wherein the above horizontal reference line segment is parallel to the horizontal axis of the above real-time image.
[0117] The line of text that is closest to the aforementioned horizontal reference line segment is selected as the text to be scanned.
[0118] In a third possible implementation based on the first possible implementation described above, determining the target LED among the preset number of LEDs according to the position of the text to be scanned in the real-time image includes:
[0119] Based on the vertical coordinate of the text to be scanned in the real-time image, the target LED is determined from the preset number of LEDs.
[0120] In a fourth possible implementation based on the third possible implementation described above, determining the target LED from the preset number of LEDs based on the vertical coordinate of the text to be scanned in the real-time image includes:
[0121] Determine the upper and lower limits of the vertical coordinate of the text to be scanned in the real-time image.
[0122] The corresponding first LED is determined based on the upper limit value of the above vertical axis;
[0123] The corresponding second LED is determined based on the lower limit of the above vertical axis;
[0124] The first LED, the second LED, and all LEDs between the first LED and the second LED are all identified as target LEDs.
[0125] In the fifth possible implementation provided based on the first possible implementation described above, each of the aforementioned LEDs uses a tri-color LED chip; illuminating the aforementioned target LED includes:
[0126] If a cursor color control command is received, the LED corresponding to the target color in the target LED will be lit up, wherein the target color is the color indicated by the cursor color control command.
[0127] If the cursor color control command is not received, then all the LEDs in the target LED will be lit.
[0128] In a sixth possible implementation provided based on the first, second, third, fourth, or fifth possible implementations described above, after the target LED is lit, the processor 1202 further performs the following steps by running the computer program stored in the memory 1201:
[0129] If a cursor shortening command is received, the endpoint LED will be turned off, where the endpoint LED is the LED at the endpoint among the currently lit LEDs;
[0130] If a cursor increment command is received, the unlit LEDs adjacent to the aforementioned endpoint LED will be lit.
[0131] In a seventh possible implementation provided based on the first, second, third, fourth, or fifth possible implementations described above, after determining the text to be scanned in the real-time image, the processor 1202 further performs the following steps by running the computer program stored in the memory 1201:
[0132] Check whether the text to be scanned is complete;
[0133] If the text to be scanned is incomplete, a reminder message will be output to remind the user that the text to be scanned is missing.
[0134] Accordingly, determining the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image includes:
[0135] If the text to be scanned is complete, the target LED is determined from the preset number of LEDs based on the position of the text to be scanned in the real-time image.
[0136] It should be understood that, in the embodiments of this application, the processor 1202 may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0137] Memory 1201 may include read-only memory and random access memory, and provides instructions and data to processor 1202. Some or all of memory 1201 may also include non-volatile random access memory. For example, memory 1201 may also store device category information.
[0138] As can be seen from the above, the internal structure of the scanning pen has been modified through this embodiment. A preset number of LEDs are built into the scanning pen, and the imaging focus of each LED is on the same straight line. This allows these LEDs to form a cursor pattern when lit. After the scanning pen starts scanning, a real-time image of the currently scanned area can be acquired first. Then, the text to be scanned is determined in the real-time image. Based on the position of the text to be scanned in the real-time image, the target LED can be determined from the preset number of LEDs and lit. In this way, the scanning pen can generate a cursor in the scanned area by lighting up the target LED. Furthermore, since the target LED is determined based on the position of the text to be scanned in the real-time image, the cursor generated by lighting up the target LED can correspond to the text to be scanned, achieving a precise association between the cursor and the text to be scanned. The user can thus know the exact position scanned by the scanning pen through the currently displayed cursor.
[0139] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0141] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0142] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0143] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing associated hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer-readable storage device, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the contents of the aforementioned computer-readable storage media may be appropriately added to or subtracted from the contents according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media may not include electrical carrier signals and telecommunication signals.
[0145] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A cursor generation method, characterized in that, The cursor generation method is applied to a scanning pen, the scanning pen including a preset number of light-emitting diodes (LEDs), and the imaging focus of each LED is on the same straight line; the cursor generation method includes: After the scanning pen starts scanning, it acquires a real-time image of the currently scanned area; The text to be scanned is determined from the real-time image; Based on the position of the text to be scanned in the real-time image, a target LED is determined from the preset number of LEDs; The target LED is lit up so that the scanning pen generates a cursor in the scanned area that indicates the current scanning position of the text to be scanned; the length of the cursor is adapted to the font size of the text to be scanned, and the larger the font size of the text to be scanned, the longer the generated cursor will be. The step of determining the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image includes: Based on the vertical coordinate of the text to be scanned in the real-time image, the target LED is determined from the preset number of LEDs; The step of determining the target LED from the preset number of LEDs based on the vertical coordinate of the text to be scanned in the real-time image includes: Determine the upper and lower limits of the vertical coordinate of the text to be scanned in the real-time image; The corresponding first LED is determined based on the upper limit value of the vertical axis; The corresponding second LED is determined based on the lower limit value of the vertical coordinate. The first LED, the second LED, and all LEDs between the first LED and the second LED are identified as target LEDs.
2. The cursor generation method as described in claim 1, characterized in that, The step of determining the text to be scanned in the real-time image includes: If the number of lines of text contained in the real-time image exceeds one line, the distance between each line of text in the real-time image and a preset horizontal reference line segment is calculated, wherein the horizontal reference line segment is parallel to the horizontal axis of the real-time image. The line of text with the smallest distance from the horizontal reference line segment is identified as the text to be scanned.
3. The cursor generation method as described in claim 1, characterized in that, Each of the LEDs uses tri-color LED beads; lighting the target LED includes: If a cursor color control command is received, the LED corresponding to the target color in the target LED will be lit up, wherein the target color is the color indicated by the cursor color control command; If the cursor color control command is not received, then all the LEDs in the target LED will be lit.
4. The cursor generation method according to any one of claims 1 to 3, characterized in that, After the target LED is lit, the cursor generation method further includes: If a cursor shortening command is received, the endpoint LED will be turned off, wherein the endpoint LED is the LED at the endpoint among the currently lit LEDs; If a cursor increment command is received, the unlit LEDs adjacent to the endpoint LED will be lit.
5. The cursor generation method according to any one of claims 1 to 3, characterized in that, After determining the text to be scanned in the real-time image, the cursor generation method further includes: Detect whether the text to be scanned is complete; If the text to be scanned is incomplete, a reminder message will be output to remind the user that the text to be scanned is missing. Accordingly, determining the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image includes: If the text to be scanned is complete, the target LED is determined from the preset number of LEDs based on the position of the text to be scanned in the real-time image.
6. A cursor generation device, characterized in that, The cursor generation device is applied to a scanning pen, the scanning pen including a preset number of light-emitting diodes (LEDs), and the imaging focus of each LED is on the same straight line; the cursor generation device includes: The image acquisition module is used to acquire a real-time image of the currently scanned area after the scanning pen starts scanning; A text determination module is used to determine the text to be scanned in the real-time image; The LED determination module is used to determine the target LED from the preset number of LEDs based on the position of the text to be scanned in the real-time image. The LED lighting module is used to light up the target LED, so that the scanning pen generates a cursor indicating the current scanning position of the text to be scanned in the scanned area through the lit target LED; the length of the cursor is adapted to the font size of the text to be scanned, and the larger the font size of the text to be scanned, the longer the generated cursor will be. The LED determination module is specifically used to determine the target LED from the preset number of LEDs based on the vertical coordinate of the text to be scanned in the real-time image. The LED determination module includes: The coordinate determination unit is used to determine the upper limit and lower limit of the vertical coordinate of the text to be scanned in the real-time image. The first LED determining unit is used to determine the corresponding first LED based on the upper limit value of the above-mentioned vertical coordinate. The second LED determination unit is used to determine the corresponding second LED based on the aforementioned lower limit value of the vertical coordinate. The target LED determination unit is used to determine the first LED, the second LED, and all LEDs between the first LED and the second LED as target LEDs.
7. A scanning pen, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The scanning pen further includes a preset number of light-emitting diodes (LEDs), the imaging focus of each LED is on the same straight line, and the processor executes the computer program to implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Scanning pen
CN111783768A