Method, device, storage medium and equipment for adjusting imaging when scanning a screen

By adjusting the lamp brightness, aperture size and camera frame rate of the dictionary pen scanning device, the problem of poor imaging effect when the device scans the screen is solved, the OCR recognition accuracy is improved, and it can adapt to a variety of screen recognitions, providing users with better experience.

CN114268703BActive Publication Date: 2024-10-18HEFEI IFLYTEK TOYCLOUD TECH
View PDF 17 Cites 0 Cited by

Patent Information

Application Number
CN202111615122.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-10-18
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

When using a dictionary pen to scan a device, since the refresh frequency of the device screen and the frame rate of the camera are not integral multiples, the image imaging effect is poor and the accuracy of the OCR recognition results is affected.

Method used

By obtaining the target image of the scanning screen, it is judged whether it contains spots and processed by a preset algorithm, and the brightness and/or aperture size of the lamp bead, and the frame rate of the camera are adjusted to achieve the brightness and entropy of the image to meet the preset conditions, and the synergy is used to improve imaging effect.

Benefits of technology

It effectively improves the imaging effect and OCR recognition accuracy when scanning the screen, adapts to the scanning recognition of various screens, and provides users with a better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114268703B_ABST
    Figure CN114268703B_ABST
Patent Text Reader

Abstract

The present application discloses an imaging adjustment method, device, storage medium and equipment when scanning a screen, the method comprising: first acquiring a target image obtained when scanning the screen; then, when it is determined that the target image contains speckles, processing it using a preset algorithm to obtain a first target image; then, when the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image; and then, when the brightness and image entropy of the second target image do not meet the preset conditions, adjusting the frame rate of the image captured by the camera in the scanning device to achieve a synchronous relationship between the camera frame rate and the screen refresh frequency, and reacquiring an image that meets the preset conditions as the third target image. The present application achieves better imaging effects when scanning the screen by using a preset algorithm to adjust, adjusting the brightness of the lamp beads and / or the aperture size, and adjusting the camera frame rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an imaging adjustment method, device, storage medium and equipment when scanning a screen. Background Art

[0002] With the development of science and technology, the emergence of dictionary pens has brought great convenience to students' learning. Students only need to use the dictionary pen to scan the text to get the pronunciation, interpretation and translation of the text, without having to look up the dictionary many times or carry a bulky dictionary every time to school. It can be seen that the emergence of dictionary pens is a great blessing for students.

[0003] At present, when using a dictionary pen to scan text on a device screen, in the process of implementing its function, the scanned text is first captured by a camera, and then the scanned video is spliced ​​into a static image, and then the text in the image is recognized using optical character recognition (OCR) technology. However, when using a dictionary pen to scan a device screen, since the device screen refresh frequency and the dictionary pen camera frame rate are non-integer multiples, the image imaging effect is poor, which in turn affects the accuracy of the OCR recognition result.

[0004] Therefore, how to adjust the imaging when scanning the screen to improve the imaging effect and the accuracy of the OCR recognition results is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of the embodiments of the present application is to provide an imaging adjustment method, device, storage medium and equipment when scanning a screen, which can solve the problem of poor imaging effect when a scanning device (such as a dictionary pen) scans a screen, and then adapt to the scanning and recognition of various screens to provide users with a better user experience.

[0006] The embodiment of the present application provides an imaging adjustment method when scanning a screen, comprising:

[0007] Acquire a target image to be processed; the target image is an image obtained when scanning the screen;

[0008] When it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image;

[0009] When the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image;

[0010] When the brightness and image entropy of the second target image still do not meet the preset conditions, the frame rate of the image captured by the camera in the scanning device is adjusted to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and the image that meets the preset conditions is re-acquired as the third target image.

[0011] In a possible implementation, when it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image, including:

[0012] When the pattern presents periodic flashes of light and dark, a preset algorithm is used to screen and remove the dark image in the target image to obtain a bright image as the processed first target image;

[0013] Alternatively, when the streak does not present periodic flashing of light and dark, the position of the streak in the target image is marked, and the streak at the position is filled with white to obtain a processed first target image.

[0014] In a possible implementation, after the target image is processed by using a preset algorithm to obtain a processed first target image, the method further includes:

[0015] Calculating the grayscale histogram, brightness value and image entropy of the first target image;

[0016] According to the grayscale histogram and the brightness value of the target image, it is determined whether the brightness of the first target image meets a preset condition; and it is determined whether the image entropy of the first target image meets a preset condition.

[0017] In a possible implementation, when the exposure time of the scanning device is fixed, when the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image, including:

[0018] When the brightness and image entropy of the first target image do not meet preset conditions, determining whether the brightness is too dark;

[0019] If yes, when it is determined that the brightness of the lamp beads of the scanning device can be brightened, the brightness level of the lamp beads of the scanning device is increased so that the brightness of the image reacquired by the scanning device meets the preset condition, and the reacquired image is used as the second target image;

[0020] If not, when it is determined that the brightness of the lamp beads of the scanning device can be dimmed, the brightness level of the lamp beads of the scanning device is reduced so that the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image.

[0021] In a possible implementation, when the brightness level of the lamp beads of the scanning device is fixed, when the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness and / or aperture size of the lamp beads of the scanning device, and reacquiring the image as the second target image, includes:

[0022] When the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the brightness of the lamp beads of the scanning device is dim, the aperture of the scanning device is increased, or, when it is determined that the brightness of the lamp beads of the scanning device is bright, the aperture of the scanning device is reduced, so that the brightness of the image re-acquired by the scanning device meets the preset conditions;

[0023] It is determined whether the image entropy of the reacquired image reaches a maximum value. If not, the aperture of the scanning device is fine-tuned and the image is reacquired as the second target image.

[0024] In a possible implementation, when the brightness and image entropy of the first target image do not meet preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image includes:

[0025] When the brightness and image entropy of the first target image do not meet the preset conditions, and it is judged that the brightness is dark, a brightness level of the scanning device is increased based on the previous brightness level, and the brightness level is gradually increased until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions, and it is judged that the brightness is bright, a brightness level of the scanning device is reduced based on the previous brightness level, and the brightness level is gradually reduced until an image that meets the preset conditions is obtained as the second target image;

[0026] When the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is small, the aperture size of the scanning device is increased based on the previous aperture size, and gradually increased until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is too large, the aperture size of the scanning device is reduced based on the previous aperture size, and gradually reduced until an image that meets the preset conditions is obtained as the second target image.

[0027] In a possible implementation, when the brightness and image entropy of the second target image still do not meet the preset condition, adjusting the frame rate of the image captured by the camera in the scanning device to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and reacquiring an image that meets the preset condition as the third target image, including:

[0028] When the brightness and image entropy of the second target image still do not meet the preset condition, obtaining a first number and a first area of ​​the spots in the target image, and obtaining a second number and a second area of ​​the spots in the second target image;

[0029] When it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, determining whether the frame rate of the image captured by the camera in the scanning device is adjustable, and if so, increasing the frame rate level by one level under the current frame rate, and gradually increasing the frame rate until an image that meets the preset condition is obtained as the third target image;

[0030] Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

[0031] The embodiment of the present application also provides an imaging adjustment device for scanning a screen, comprising:

[0032] An acquisition unit, used for acquiring a target image to be processed; the target image is an image obtained when scanning the screen;

[0033] A processing unit, configured to process the target image using a preset algorithm to obtain a processed first target image when it is determined that the target image contains speckles;

[0034] A first adjustment unit, configured to adjust the brightness of a lamp bead and / or the aperture size of a scanning device and reacquire an image as a second target image when the brightness and image entropy of the first target image do not meet a preset condition;

[0035] The second adjustment unit is used to adjust the frame rate of the image captured by the camera in the scanning device when the brightness and image entropy of the second target image still do not meet the preset conditions, so as to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and re-acquire the image that meets the preset conditions as the third target image.

[0036] In a possible implementation, the processing unit is specifically configured to:

[0037] When the pattern presents periodic flashes of light and dark, a preset algorithm is used to screen and remove the dark image in the target image to obtain a bright image as the processed first target image;

[0038] Alternatively, when the streak does not present periodic flashing of light and dark, the position of the streak in the target image is marked, and the streak at the position is filled with white to obtain a processed first target image.

[0039] In a possible implementation manner, the device further includes:

[0040] A calculation unit, used to calculate the grayscale histogram and brightness value and image entropy of the first target image;

[0041] A judging unit is used to judge whether the brightness of the first target image meets a preset condition according to the grayscale histogram and the brightness value of the target image; and to judge whether the image entropy of the first target image meets a preset condition.

[0042] In a possible implementation, when the exposure time of the scanning device is fixed, the first adjusting unit includes:

[0043] A judging subunit, configured to judge whether the brightness is too dark when the brightness and image entropy of the first target image do not meet preset conditions;

[0044] The raising subunit is used for raising the brightness level of the lamp beads of the scanning device if it is judged that the brightness is dim, and when it is judged that the brightness of the lamp beads of the scanning device can be brightened, so that the brightness of the image reacquired by the scanning device meets the preset condition, and the reacquired image is used as the second target image;

[0045] The lowering subunit is used to reduce the brightness level of the lamp beads of the scanning device if it is determined that the brightness is not too dim, when it is determined that the brightness of the lamp beads of the scanning device can be dimmed, so that the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image.

[0046] In a possible implementation, when the brightness level of the lamp beads of the scanning device is fixed, the first adjustment unit includes:

[0047] A first adjustment subunit is used to increase the aperture of the scanning device when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the brightness of the lamp beads of the scanning device is dim, or to reduce the aperture of the scanning device when it is judged that the brightness of the lamp beads of the scanning device is bright, so that the brightness of the image re-acquired by the scanning device meets the preset conditions;

[0048] The fine-tuning subunit is used to determine whether the image entropy of the reacquired image reaches a maximum value. If not, the aperture of the scanning device is fine-tuned and the image is reacquired as the second target image.

[0049] In a possible implementation, the first adjusting unit includes:

[0050] The second adjustment subunit is used for, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the brightness is dark, increasing a brightness level of the scanning device on the basis of the previous brightness level, gradually increasing it until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the brightness is bright, reducing a brightness level of the scanning device on the basis of the previous brightness level, gradually reducing it until an image that meets the preset conditions is obtained as the second target image;

[0051] The third adjustment subunit is used to increase the aperture size of the scanning device on the basis of the previous aperture size, gradually increasing it until an image that meets the preset conditions is obtained as the second target image, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is small; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is too large, reduce the aperture size of the scanning device on the basis of the previous aperture size, gradually reducing it until an image that meets the preset conditions is obtained as the second target image.

[0052] In a possible implementation, the second adjusting unit includes:

[0053] an acquisition subunit, configured to acquire a first number and a first area of ​​the spots in the target image, and acquire a second number and a second area of ​​the spots in the second target image when the brightness and the image entropy of the second target image still do not meet the preset condition;

[0054] a fourth adjusting subunit, for determining whether the frame rate of the image captured by the camera in the scanning device is adjustable when it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, and if so, increasing the frame rate level by one frame rate level at the current frame rate, and gradually increasing the frame rate level until an image satisfying the preset condition is obtained as the third target image;

[0055] Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

[0056] The embodiment of the present application also provides an imaging adjustment device for scanning a screen, comprising: a processor, a memory, and a system bus;

[0057] The processor and the memory are connected via the system bus;

[0058] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementations of the imaging adjustment method when scanning the screen.

[0059] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any one of the implementations of the imaging adjustment method when scanning the screen.

[0060] The embodiment of the present application further provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the implementations of the imaging adjustment method when scanning a screen.

[0061] The present application provides an imaging adjustment method, device, storage medium and equipment for scanning a screen. First, a target image to be processed is obtained; wherein the target image is an image obtained when scanning the screen; then, when it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image; then, when the brightness and image entropy of the first target image do not meet the preset conditions, the brightness and / or aperture size of the lamp beads of the scanning device are adjusted, and the image is re-acquired as the second target image; and then, when the brightness and image entropy of the second target image still do not meet the preset conditions, the frame rate of the image captured by the camera in the scanning device is adjusted to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and the image that meets the preset conditions is re-acquired as the third target image. It can be seen that the present application embodiment is to coordinate the three adjustment methods of adjusting by using a preset algorithm, adjusting the brightness and / or aperture size of the lamp beads of the scanning device, and adjusting the frame rate of the image captured by the camera in the scanning device, so that the brightness and image entropy of the imaging of the scanning device when scanning the screen can meet the use requirements, obtain better imaging effects, adapt to the scanning and recognition of various screens, and provide users with a better use experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0063] Figure 1a One of the example diagrams of black spots appearing on the scanning screen provided in the embodiment of the present application;

[0064] Figure 1b This is a second example of a black streak appearing on a scanning screen provided in an embodiment of the present application;

[0065] Figure 1c The third example of black spots appearing on the scanning screen provided in the embodiment of the present application;

[0066] Figure 2 A schematic diagram of a flow chart of an imaging adjustment method when scanning a screen provided in an embodiment of the present application;

[0067] Figure 3 A flowchart of an embodiment of the present application for processing a target image using a preset algorithm to obtain a processed first target image when it is determined that the target image contains speckles;

[0068] Figure 4 One of the flow charts for adjusting the brightness of the lamp beads and / or the aperture size of the scanning device and reacquiring an image as a second target image provided in an embodiment of the present application;

[0069] Figure 5 The second flowchart of adjusting the brightness of the lamp beads and / or the aperture size of the scanning device and reacquiring an image as the second target image provided in the embodiment of the present application;

[0070] Figure 6 The third flowchart of adjusting the brightness of the lamp beads and / or the aperture size of the scanning device and reacquiring the image as the second target image provided in the embodiment of the present application;

[0071] Figure 7 A flowchart of adjusting the frame rate of an image captured by a camera in a scanning device according to an embodiment of the present application to achieve a synchronization relationship between the frame rate of an image captured by the camera and a screen refresh frequency, and reacquiring an image that meets a preset condition as a third target image;

[0072] Figure 8 A schematic diagram of the composition of an imaging adjustment device for scanning a screen provided in an embodiment of the present application. DETAILED DESCRIPTION

[0073] With the rapid development of informatization, technology and intelligence; especially children's smart products have higher and higher requirements for intelligence, such as portable smart dictionary pens, which have various functions such as scanning, looking up words and translation. However, when using a dictionary pen to scan text on the device screen, in the process of realizing its function, the scanned text is first captured by a camera, and then the scanned video is spliced ​​into a static image, and then the OCR technology is used to recognize the text in the image. However, when using a dictionary pen to scan the device screen, since the device screen refresh frequency and the dictionary pen camera frame rate are non-integer multiples, and the camera frame rate is high, it can clearly capture the linear changes in the screen refresh process, which leads to the phenomenon that the lines block the text, resulting in various black spots in the captured image, and the imaging effect is poor, which affects the accuracy of the OCR recognition results.

[0074] Among them, the black spots that appear on the screen of scanning devices such as dictionary pens usually include three categories: the first category is Figure 1a The "wiper-style" black stripes shown in the figure are flashing. This phenomenon is approximately centered at a certain point, with the length of the black stripes as the radius, scanning within the imaging area; the second type is as follows Figure 1b The "rain curtain" black stripes shown in the figure are flashing. This phenomenon is similar to the rain curtain, but the difference is that the occlusion is periodic. The third type is as follows Figure 1c The black stripes shown show periodic flickering of light and dark. In this phenomenon, "dark" refers to the complete blackness of the screen, and "bright" refers to the real image information.

[0075] In order to solve the above defects, the present application provides an imaging adjustment method when scanning a screen, firstly obtaining a target image to be processed; wherein the target image is an image obtained when scanning the screen; then when it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image; then, when the brightness and image entropy of the first target image do not meet the preset conditions, the brightness and / or aperture size of the lamp beads of the scanning device are adjusted, and the image is re-acquired as the second target image; and then when the brightness and image entropy of the second target image still do not meet the preset conditions, the frame rate of the image captured by the camera in the scanning device is adjusted to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and the image that meets the preset conditions is re-acquired as the third target image. It can be seen that the embodiment of the present application is to coordinate the three adjustment methods of adjusting by using a preset algorithm, adjusting the brightness and / or aperture size of the lamp beads of the scanning device, and adjusting the frame rate of the image captured by the camera in the scanning device, so that the brightness and image entropy of the imaging of the scanning device when scanning the screen can meet the use requirements, obtain better imaging effects, adapt to the scanning and recognition of various screens, and provide users with a better use experience.

[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0077] First embodiment

[0078] See also Figure 2 , is a flow chart of an imaging adjustment method when scanning a screen provided in this embodiment, the method comprising the following steps:

[0079] S201: Acquire a target image to be processed; wherein the target image is an image obtained when scanning a screen.

[0080] In this embodiment, the image obtained when any scanning screen adjusted by this embodiment (such as the image obtained after scanning the screen by a scanning device such as a dictionary pen, etc.) is defined as a target image. It should be noted that this embodiment does not limit the type of target image. For example, the target image can be a color image composed of the three primary colors of red (G), green (G), and blue (B), or it can be a grayscale image, etc.

[0081] S202: When it is determined that the target image contains spots, the target image is processed using a preset algorithm to obtain a processed first target image.

[0082] In this embodiment, after obtaining the target image to be processed in step S201, it can be further determined whether the target image contains speckles. If so, the target image can be processed using a preset algorithm to obtain a processed first target image for executing the subsequent step S203. Specifically, when the target image is preprocessed using the preset algorithm, it mainly includes the detection and removal of speckles and the detection of screen brightness; if it is determined according to the detection result that the target image can meet the preset conditions, that is, meet the use requirements, the parameters of the current scanning device can be directly used, otherwise it enters the subsequent step S203 for further imaging adjustment processing.

[0083] Specifically, if Figure 3 As shown, after obtaining n consecutive images at the same time, random frame difference calculation can be performed on the n images at the same time. After obtaining m images, corrosion and dilation processing is performed on them, and then it is determined whether there is a streak area in the processed image, where m = (n(n-1)) / 2, and m and n are both positive integers.

[0084] Then, determine whether the target image contains Figure 1a , 1b , 1c, if so, then it is necessary to further determine whether the pattern is as shown in Figure 1c If the light and dark periodic flashes are shown, then a preset algorithm can be used to filter and remove the dark image in the target image to obtain a bright image as the first target image after processing to perform the subsequent step S203. Figure 1c The light and dark periodically flashes as shown, and the position of the current stripe in the target image can be marked, and the stripe at the position can be filled in with white to obtain a processed first target image for executing the subsequent step S203.

[0085] If it is determined whether the target image contains Figure 1a , 1b , 1c, it means that the current camera can collect usable image data (i.e., the target image). At this time, it is necessary to judge the brightness and image entropy of the target image. If both meet the preset usage conditions, the current scanning device related parameters are used as initial parameters. Otherwise, the target image can be directly used as the first target image and enter the subsequent step S203 to further adjust its brightness and image entropy.

[0086] The preset usage conditions (i.e., the preset conditions mentioned in the subsequent steps S203 and S204) refer to the image brightness being moderate and the image entropy (defined as E here) being able to be within the minimum threshold (defined as ET here) min ) and the maximum threshold (here defined as ET max ) (i.e. ET min ≤E≤ET MAX ). The moderate brightness of the image means that the brightness value of the image is between the thresholds GM_T1 and GM_T2, and most of the grayscale values ​​of the image histogram are distributed between GT1 and GT2. min and E max The specific value of GM_T1 can be set according to the actual situation, and the embodiment of the present application does not limit this. For example, GM_T1 and GM_T2 can be set to 200 and 240 respectively, and ET min and E.T. max Set to 0 and 8 respectively.

[0087] S203: When the brightness and image entropy of the first target image do not meet the preset conditions, adjust the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquire the image as the second target image.

[0088] In this embodiment, when the first target image is obtained through step S202, the grayscale histogram, brightness value and image entropy of the first target image can be further calculated, and it can be judged whether the brightness of the first target image meets the preset conditions according to the grayscale histogram and brightness value of the target image; and it can be judged whether the image entropy of the first target image meets the preset conditions. In addition, for scanning devices such as dictionary pens, the ambient light brightness mainly comes from the internal lamp beads of the device. By changing the drive, the brightness level of the lamp beads can be adjusted, thereby achieving the purpose of adjusting the image brightness. When the exposure time is fixed, the imaging effect can be adjusted by adjusting the brightness level of the lamp beads.

[0089] Specifically, when the exposure time of the scanning device is fixed, the specific implementation process of step S203 may include: Figure 4 As shown, when it is determined that the brightness and image entropy of the first target image do not meet the preset conditions, first determine whether the brightness is dim. If so, determine whether the brightness of the lamp beads of the scanning device can be brightened. If so, the brightness level of the lamp beads of the scanning device can be gradually increased until the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image. On the contrary, if it is determined that the brightness of the lamp beads of the scanning device cannot be brightened, it means that the brightness cannot be adjusted to the optimal level, and it is necessary to consider adjusting the aperture size to adjust the exposure time.

[0090] Alternatively, if it is determined that the brightness is not dim but bright, it can be further determined whether the brightness of the lamp beads of the scanning device can be dimmed. If so, the brightness level of the lamp beads of the scanning device can be gradually reduced until the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image. On the contrary, if it is determined that the brightness of the lamp beads of the scanning device cannot be dimmed, it means that the brightness cannot be adjusted to the optimal level, and it is necessary to consider adjusting the aperture size to adjust the exposure time.

[0091] In addition, it is also possible to determine whether the image entropy of the first target image and the image entropy of the reacquired image are the largest. If so, the currently set parameters of the scanning device are retained; if not, the brightness can be adjusted within a moderate brightness range.

[0092] In another optional implementation, since the brightness range of the lamp beads of scanning devices such as dictionary pens is limited, when the use requirements cannot be met by adjusting the brightness of the lamp beads, it is necessary to adjust the exposure time. Therefore, when the brightness level of the lamp beads of the scanning device is fixed, the specific implementation process of the above step S203 may include: Figure 5As shown, when it is determined that the brightness and image entropy of the first target image do not meet the preset conditions, it is first determined whether the brightness is dark. If so, the aperture of the scanning device can be gradually increased until the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image. On the contrary, if it is determined that the brightness is not dark but bright, the aperture of the scanning device can be gradually reduced until the brightness of the image reacquired by the scanning device meets the preset conditions.

[0093] In addition, it is also possible to determine whether the image entropy of the first target image and the image entropy of the reacquired image are the largest. If so, the parameters of the currently set scanning device are retained; if not, it is possible to consider fine-tuning the aperture of the scanning device within a moderate brightness range and use the reacquired image as the second target image.

[0094] It should be noted that whether adjusting the brightness of the lamp beads or the aperture size is to make the captured image quality better, but the adjustment efficiency is also a very important factor. In order to speed up the adjustment efficiency, in actual applications, the brightness of all lamp beads or the aperture size are usually not adjusted once, which will consume a long time. Therefore, in an optional implementation method, it is possible to consider adjusting the brightness of the lamp beads and the aperture size comprehensively. The specific implementation process may include: Figure 6 As shown, when it is determined that the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the brightness is too dark, the brightness level of the scanning device can be increased based on the previous brightness level, and the brightness level is gradually increased until an image that meets the preset brightness conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the brightness is too bright, the brightness level of the scanning device can be reduced based on the previous brightness level, and the brightness level is gradually reduced until an image that meets the preset brightness conditions is obtained as the second target image.

[0095] At the same time, when it is determined that the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the image entropy is small, the aperture size of the scanning device can be increased on the basis of the previous aperture size, and the aperture is gradually increased until an image that meets the preset conditions is obtained as the second target image; or, when it is determined that the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the image entropy is too large, the aperture size of the scanning device can be reduced on the basis of the previous aperture size, and it is gradually reduced until an image that meets the preset conditions is obtained as the second target image.

[0096] S204: When the brightness and image entropy of the second target image still do not meet the preset conditions, adjust the frame rate of the image captured by the camera in the scanning device to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and re-acquire an image that meets the preset conditions as the third target image.

[0097] In this embodiment, if the brightness and image entropy of the second target image obtained through step S203 still do not meet the preset conditions (that is, after selecting the optimal values ​​of the lamp bead brightness and aperture, the preset conditions still cannot be met), at this time, the frame rate of the image captured by the camera in the scanning device can be adjusted to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and the image that meets the preset conditions can be re-acquired as the third target image, thereby solving the problem of poor imaging effect when the scanning device (such as a dictionary pen) scans the screen, providing users with a better user experience.

[0098] Specifically, an optional implementation method is as follows: Figure 7 As shown, when it is determined that the brightness and image entropy of the second target image still do not meet the preset conditions, the number (defined here as the first number) and area (defined here as the first area) of the spots in the target image can be obtained first, and the number (defined here as the second number) and area (defined here as the second area) of the spots in the second target image can be obtained.

[0099] Then, the values ​​of the second number and the second area are compared with the values ​​of the first number and the first area. When it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is increased at the current frame rate, and the frame rate level is gradually increased until an image that meets the preset conditions is obtained as the third target image. Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate level is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

[0100] In this way, by adjusting the frame rate of the image collected by the camera in the scanning device, and then repeatedly calculating and comparing the number and area of ​​the "spots", until the device parameters that can scan and obtain an image that meets the preset conditions are obtained, the imaging adjustment when scanning the screen is completed. However, if the optimal parameters cannot be obtained in the end, a relatively better device parameter can be selected from the parameters debugged by executing steps S202, S203, and S204 as the final parameter to complete the imaging adjustment when scanning the screen.

[0101] In summary, the present embodiment provides an imaging adjustment method when scanning a screen, firstly obtaining a target image to be processed; wherein the target image is an image obtained when scanning the screen; then when it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image; then, when the brightness and image entropy of the first target image do not meet the preset conditions, the brightness and / or aperture size of the lamp beads of the scanning device are adjusted, and the image is re-acquired as the second target image; and then, when the brightness and image entropy of the second target image still do not meet the preset conditions, the frame rate of the image captured by the camera in the scanning device is adjusted to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and the image that meets the preset conditions is re-acquired as the third target image. It can be seen that the present application embodiment is to coordinate the three adjustment methods of adjusting by using a preset algorithm, adjusting the brightness and / or aperture size of the lamp beads of the scanning device, and adjusting the frame rate of the image captured by the camera in the scanning device, so that the brightness and image entropy of the imaging of the scanning device when scanning the screen can meet the use requirements, obtain better imaging effects, adapt to the scanning and recognition of various screens, and provide users with a better use experience.

[0102] Second embodiment

[0103] This embodiment will introduce an imaging adjustment device for scanning a screen. For related content, please refer to the above method embodiment.

[0104] See also Figure 8 , is a schematic diagram of the composition of an imaging adjustment device for scanning a screen provided in this embodiment, the device 800 includes:

[0105] The acquisition unit 801 is used to acquire a target image to be processed; the target image is an image obtained when scanning the screen;

[0106] The processing unit 802 is configured to process the target image using a preset algorithm to obtain a processed first target image when it is determined that the target image contains speckles;

[0107] A first adjustment unit 803 is used to adjust the brightness of the lamp beads and / or the aperture size of the scanning device and reacquire the image as the second target image when the brightness and image entropy of the first target image do not meet the preset conditions;

[0108] The second adjustment unit 804 is used to adjust the frame rate of the image captured by the camera in the scanning device when the brightness and image entropy of the second target image still do not meet the preset conditions, so as to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and re-acquire the image that meets the preset conditions as the third target image.

[0109] In an implementation of this embodiment, the processing unit 802 is specifically configured to:

[0110] When the pattern presents periodic flashes of light and dark, a preset algorithm is used to screen and remove the dark image in the target image to obtain a bright image as the processed first target image;

[0111] Alternatively, when the streak does not present periodic flashing of light and dark, the position of the streak in the target image is marked, and the streak at the position is filled with white to obtain a processed first target image.

[0112] In an implementation of this embodiment, the device further includes:

[0113] A calculation unit, used to calculate the grayscale histogram and brightness value and image entropy of the first target image;

[0114] A judging unit is used to judge whether the brightness of the first target image meets a preset condition according to the grayscale histogram and the brightness value of the target image; and to judge whether the image entropy of the first target image meets a preset condition.

[0115] In an implementation of this embodiment, when the exposure time of the scanning device is fixed, the first adjusting unit 803 includes:

[0116] A judging subunit, configured to judge whether the brightness is too dark when the brightness and image entropy of the first target image do not meet preset conditions;

[0117] The raising subunit is used for raising the brightness level of the lamp beads of the scanning device if it is judged that the brightness is dim, and when it is judged that the brightness of the lamp beads of the scanning device can be brightened, so that the brightness of the image reacquired by the scanning device meets the preset condition, and the reacquired image is used as the second target image;

[0118] The lowering subunit is used to reduce the brightness level of the lamp beads of the scanning device if it is determined that the brightness is not too dim, when it is determined that the brightness of the lamp beads of the scanning device can be dimmed, so that the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image.

[0119] In an implementation of this embodiment, when the brightness level of the lamp beads of the scanning device is fixed, the first adjustment unit 803 includes:

[0120] an increasing subunit, configured to increase the aperture of the scanning device when the brightness and image entropy of the first target image do not meet the preset conditions and it is determined that the brightness of the lamp beads of the scanning device is dim, or, when it is determined that the brightness of the lamp beads of the scanning device is bright, reduce the aperture of the scanning device, so that the brightness of the image reacquired by the scanning device meets the preset conditions;

[0121] The fine-tuning subunit is used to determine whether the image entropy of the reacquired image reaches a maximum value. If not, the aperture of the scanning device is fine-tuned and the image is reacquired as the second target image.

[0122] In an implementation of this embodiment, the first adjusting unit 803 includes:

[0123] The first adjustment subunit is used for, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the brightness is dark, increasing a brightness level of the scanning device on the basis of the previous brightness level, gradually increasing it until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the brightness is bright, reducing a brightness level of the scanning device on the basis of the previous brightness level, gradually reducing it until an image that meets the preset conditions is obtained as the second target image;

[0124] The second adjustment subunit is used to increase the aperture size of the scanning device based on the previous aperture size, gradually increasing it until an image that meets the preset conditions is obtained as the second target image, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is small; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is too large, reduce the aperture size of the scanning device based on the previous aperture size, gradually reducing it until an image that meets the preset conditions is obtained as the second target image.

[0125] In an implementation of this embodiment, the second adjusting unit 804 includes:

[0126] an acquisition subunit, configured to acquire a first number and a first area of ​​the spots in the target image, and acquire a second number and a second area of ​​the spots in the second target image when the brightness and the image entropy of the second target image still do not meet the preset condition;

[0127] a third adjusting subunit, for determining whether the frame rate of the image captured by the camera in the scanning device is adjustable when it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, and if so, increasing the frame rate level by one frame rate level under the current frame rate, and gradually increasing the frame rate level until an image satisfying the preset condition is obtained as the third target image;

[0128] Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

[0129] Furthermore, an embodiment of the present application also provides an imaging adjustment device when scanning a screen, comprising: a processor, a memory, and a system bus;

[0130] The processor and the memory are connected via the system bus;

[0131] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the imaging adjustment method when scanning the screen.

[0132] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned imaging adjustment method when scanning the screen.

[0133] Furthermore, an embodiment of the present application also provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the implementation methods of the imaging adjustment method when scanning a screen.

[0134] It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0135] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0136] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for adjusting imaging when scanning a screen, characterized in that: include: Obtaining a target image to be processed; The target image is an image obtained when scanning the screen; When it is determined that the target image contains speckles, the target image is processed using a preset algorithm to obtain a processed first target image; When the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image; When the brightness and image entropy of the second target image still do not meet the preset conditions, adjusting the frame rate of the image captured by the camera in the scanning device to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and reacquiring an image that meets the preset conditions as the third target image; When the brightness and image entropy of the second target image still do not meet the preset conditions, adjusting the frame rate of the image captured by the camera in the scanning device to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and reacquiring an image that meets the preset conditions as the third target image, including: When the brightness and image entropy of the second target image still do not meet the preset condition, obtaining a first number and a first area of ​​the spots in the target image, and obtaining a second number and a second area of ​​the spots in the second target image; When it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, determining whether the frame rate of the image captured by the camera in the scanning device is adjustable, and if so, increasing the frame rate level by one level under the current frame rate, and gradually increasing the frame rate until an image that meets the preset condition is obtained as the third target image; Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

2. The method according to claim 1, characterized in that When it is determined that the target image contains spots, the target image is processed using a preset algorithm to obtain a processed first target image, including: When the pattern presents periodic flashes of light and dark, a preset algorithm is used to screen and remove the dark image in the target image to obtain a bright image as the processed first target image; Alternatively, when the streak does not present periodic flashing of light and dark, the position of the streak in the target image is marked, and the streak at the position is filled with white to obtain a processed first target image.

3. The method according to claim 1, characterized in that After the target image is processed by a preset algorithm to obtain a processed first target image, the method further includes: Calculating the grayscale histogram, brightness value and image entropy of the first target image; According to the grayscale histogram and the brightness value of the target image, it is determined whether the brightness of the first target image meets a preset condition; and it is determined whether the image entropy of the first target image meets a preset condition.

4. The method according to claim 1, characterized in that: When the exposure time of the scanning device is fixed, when the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image, including: When the brightness and image entropy of the first target image do not meet preset conditions, determining whether the brightness is too dark; If yes, when it is determined that the brightness of the lamp beads of the scanning device can be brightened, the brightness level of the lamp beads of the scanning device is increased so that the brightness of the image reacquired by the scanning device meets the preset condition, and the reacquired image is used as the second target image; If not, when it is determined that the brightness of the lamp beads of the scanning device can be dimmed, the brightness level of the lamp beads of the scanning device is reduced so that the brightness of the image reacquired by the scanning device meets the preset conditions, and the reacquired image is used as the second target image.

5. The method according to claim 1, characterized in that When the brightness level of the lamp beads of the scanning device is fixed, when the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness and / or aperture size of the lamp beads of the scanning device, and reacquiring the image as the second target image, including: When the brightness and image entropy of the first target image do not meet the preset conditions, and it is determined that the brightness of the lamp beads of the scanning device is dim, the aperture of the scanning device is increased, or, when it is determined that the brightness of the lamp beads of the scanning device is bright, the aperture of the scanning device is reduced, so that the brightness of the image re-acquired by the scanning device meets the preset conditions; It is determined whether the image entropy of the reacquired image reaches a maximum value. If not, the aperture of the scanning device is fine-tuned and the image is reacquired as the second target image.

6. The method according to claim 1, characterized in that When the brightness and image entropy of the first target image do not meet the preset conditions, adjusting the brightness of the lamp beads and / or the aperture size of the scanning device, and reacquiring the image as the second target image, includes: When the brightness and image entropy of the first target image do not meet the preset conditions, and it is judged that the brightness is dark, a brightness level of the scanning device is increased based on the previous brightness level, and the brightness level is gradually increased until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions, and it is judged that the brightness is bright, a brightness level of the scanning device is reduced based on the previous brightness level, and the brightness level is gradually reduced until an image that meets the preset conditions is obtained as the second target image; When the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is small, the aperture size of the scanning device is increased based on the previous aperture size, and gradually increased until an image that meets the preset conditions is obtained as the second target image; or, when the brightness and image entropy of the first target image do not meet the preset conditions and it is judged that the image entropy is too large, the aperture size of the scanning device is reduced based on the previous aperture size, and gradually reduced until an image that meets the preset conditions is obtained as the second target image.

7. An imaging adjustment device for scanning a screen, characterized in that: include: An acquisition unit, used for acquiring a target image to be processed; The target image is an image obtained when scanning the screen; A processing unit, configured to process the target image using a preset algorithm to obtain a processed first target image when it is determined that the target image contains speckles; A first adjustment unit, configured to adjust the brightness of a lamp bead and / or the aperture size of a scanning device and reacquire an image as a second target image when the brightness and image entropy of the first target image do not meet a preset condition; A second adjustment unit is used to adjust the frame rate of the image captured by the camera in the scanning device when the brightness and image entropy of the second target image still do not meet the preset conditions, so as to achieve a synchronization relationship between the frame rate of the image captured by the camera and the screen refresh frequency, and re-acquire an image that meets the preset conditions as a third target image; The second adjusting unit comprises: an acquisition subunit, configured to acquire a first number and a first area of ​​the spots in the target image, and acquire a second number and a second area of ​​the spots in the second target image when the brightness and the image entropy of the second target image still do not meet the preset condition; a fourth adjusting subunit, for determining whether the frame rate of the image captured by the camera in the scanning device is adjustable when it is determined that the values ​​of the second number and the second area are greater than the values ​​of the first number and the first area, and if so, increasing the frame rate level by one frame rate level at the current frame rate, and gradually increasing the frame rate level until an image satisfying the preset condition is obtained as the third target image; Alternatively, when it is determined that the values ​​of the second number and the second area are not greater than the values ​​of the first number and the first area, it is determined whether the frame rate of the image captured by the camera in the scanning device is adjustable. If so, the frame rate level is reduced at the current frame rate, and the frame rate is gradually reduced until an image that meets the preset conditions is obtained as the third target image.

8. An imaging adjustment device for scanning a screen, characterized in that: include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Camera brightness regulating device and implementation method thereof

    CN103024279A

  • Method for intelligently adjusting brightness of picture on basis of detection of environmental brightness in photographing

    CN103973983A

  • Method and system for adjusting automatic exposure

    CN104754200A

  • Photographing method and device

    CN108174101A

  • Light adjusting method and device, storage medium and intelligent reading equipment

    CN109743825A