Image acquisition method, device, scanning pen and storage medium
By setting the scroll wheel on the scanning pen tip to obtain the current scanning speed and adjusting the shooting frame rate according to the preset frame rate, the problem of reducing image recognition rate and increasing operation volume caused by fixed frame rate is solved, and efficient image acquisition and recognition is achieved.
Patent Information
- Application Number
- CN202010813054.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-13
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2040-08-13
AI Technical Summary
During the use of existing scanning pens, when image acquisition at fixed frame rates causes the user to scan too fast or slow, the image recognition rate will decrease or increase the excess computing and data transmission.
By setting the scroll wheel on the scanning pen tip, the current scanning speed is obtained, and the appropriate shooting frame rate is determined according to the preset frame rate correspondence relationship for image acquisition, so as to realize adaptive adjustment of the camera frame rate.
It ensures that the scanned image quality is sufficient to be correctly recognized, avoids too many images with high overlap, reduces the amount of computing and data transmission, and improves the user experience.
Smart Images

Figure CN111914828B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic equipment, and in particular to an image acquisition method, device, scanning pen and storage medium. Background Art
[0002] A scanning pen is a handheld electronic device. Users can scan and enter text or images by holding the scanning pen. Through the built-in optical character recognition (OCR) module, text can be recognized, stored and edited. It is widely used in scenarios such as student learning and travel translation.
[0003] When a user uses a scanning pen to scan, the scanning pen will collect images at a certain frame rate. However, current scanning pens usually collect images at a fixed frame rate during use, so that when the user scans too fast or too slow, the image recognition rate is reduced, or unnecessary calculation and data transmission are increased. Summary of the invention
[0004] The embodiments of the present invention provide an image acquisition method, device, scanning pen and storage medium to solve the defects in the prior art that may reduce the image recognition rate or increase the unnecessary amount of calculation and data transmission.
[0005] An embodiment of the present invention provides an image acquisition method, including:
[0006] Based on the roller set at the tip of the scanning pen, obtain the current scanning speed;
[0007] Determine a shooting frame rate corresponding to the current scanning speed;
[0008] Image acquisition is performed based on the shooting frame rate.
[0009] According to an image acquisition method of an embodiment of the present invention, the method of obtaining the current scanning speed based on a roller provided at the tip of the scanning pen specifically includes:
[0010] The current scanning speed is determined based on the angular velocity of the roller rotation acquired by a rotation speed sensor provided in the roller, or based on the number of rotations of the roller per unit time acquired by an encoder provided in the roller.
[0011] According to an image acquisition method according to an embodiment of the present invention, determining the shooting frame rate corresponding to the current scanning speed specifically includes:
[0012] Determining a shooting frame rate corresponding to the current scanning speed based on preset shooting frame rates corresponding to different scanning speeds;
[0013] Among them, the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates, testing the maximum scanning speed supported under the condition of meeting effective image recognition, or performing image acquisition at multiple preset scanning speeds, and testing the minimum preset shooting frame rate supported under the condition of meeting effective image recognition.
[0014] According to an image acquisition method of an embodiment of the present invention, determining the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds specifically includes:
[0015] If the current scanning speed is between the maximum scanning speeds corresponding to two adjacent preset shooting frame rates, the higher preset shooting frame rate is used as the shooting frame rate corresponding to the current scanning speed;
[0016] Or, if the current scanning speed is between two adjacent preset scanning speeds, the minimum preset shooting frame rate corresponding to the higher preset scanning speed is used as the shooting frame rate corresponding to the current scanning speed.
[0017] The image acquisition method according to an embodiment of the present invention further includes:
[0018] If the current scanning speed is greater than a preset maximum speed threshold, a rescan prompt is triggered, and the rescan prompt is in the form of at least one of a screen display prompt, a pen body vibration prompt, and a voice prompt.
[0019] According to an image acquisition method of an embodiment of the present invention, the current scanning speed is obtained based on a roller provided at the tip of the scanning pen, and the method further includes:
[0020] Update the general scanning speed of the scanning pen based on the historical scanning speed;
[0021] The shooting frame rate corresponding to the general scanning speed is used as the initial shooting frame rate, and image acquisition is started based on the initial shooting frame rate.
[0022] According to an image acquisition method of an embodiment of the present invention, the image acquisition is performed based on the shooting frame rate, and then further includes:
[0023] Based on the shooting frame rate and the current scanning speed, determining the overlap range of two consecutive frames of scanned images obtained by image acquisition;
[0024] Based on the overlap range, the two consecutive scanned image frames are spliced.
[0025] The embodiment of the present invention further provides an image acquisition device, comprising:
[0026] A speed acquisition unit, used for acquiring a current scanning speed based on a roller arranged at the tip of the scanning pen;
[0027] A shooting frame rate determining unit, used to determine the shooting frame rate corresponding to the current scanning speed;
[0028] An image acquisition unit is used to acquire images based on the shooting frame rate.
[0029] An embodiment of the present invention also provides a scanning pen, including a roller arranged at the pen tip, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned image acquisition methods are implemented.
[0030] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned image acquisition methods are implemented.
[0031] The image acquisition method, device, scanning pen and storage medium provided by the embodiments of the present invention obtain the current scanning speed based on the roller set at the pen tip of the scanning pen, and determine the shooting frame rate corresponding to the current scanning speed, so as to perform image acquisition based on the shooting frame rate. It can realize adaptive adjustment of the camera shooting frame rate to ensure that the quality of the acquired scanned image is sufficient to be correctly identified, and at the same time avoid acquiring too many images with high overlap, so as not to increase unnecessary calculation and data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A schematic diagram of a flow chart of an image acquisition method provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a roller arrangement provided in an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of the structure of a roller provided in an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of a flow chart of a frame rate initialization method provided by an embodiment of the present invention;
[0037] Figure 5A schematic diagram of a flow chart of an image stitching method provided by an embodiment of the present invention;
[0038] Figure 6 A schematic diagram of the structure of an image acquisition device provided by an embodiment of the present invention;
[0039] Figure 7 A schematic diagram of the structure of a scanning pen provided in an embodiment of the present invention.
[0040] Reference numerals:
[0041] 210: positioning claw; 220: roller; 310: speed sensor; 320: encoder. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] When the user uses the tip of the scanning pen to scan the text on a paper document or book at a constant speed, the built-in camera of the scanning pen will capture images at a certain frame rate for the optical character recognition module to perform image recognition and obtain the text in the image scanned by the user. The frame rate refers to the number of images captured by the camera per unit time.
[0044] During use, current scanning pens usually capture images at a fixed frame rate. However, when the user moves the scanning pen at a high speed and the camera frame rate is low, the image captured by the camera will have obvious afterimages, and the text strokes in the image will be unclear, resulting in a significant decrease in the accuracy of image recognition; when the user moves the scanning pen at a low speed and the camera frame rate is high, the camera will capture a large number of images with a very high overlap rate, so that the number of images collected exceeds the number of images required for text recognition, thereby increasing a large amount of unnecessary computing and data transmission, causing avoidable usage delays and reducing the user experience.
[0045] In this regard, an embodiment of the present invention provides an image acquisition method. Figure 1 A schematic diagram of a flow chart of an image acquisition method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0046] Step 110, obtaining a current scanning speed based on a roller disposed at the tip of the scanning pen;
[0047] Step 120, determining a shooting frame rate corresponding to the current scanning speed;
[0048] Step 130: Capture images based on the shooting frame rate.
[0049] Specifically, considering that when the speed at which the user moves the scanning pen does not match the frame rate of the image captured by the camera, the accuracy of image recognition will drop significantly, or a large amount of unnecessary calculations and data transmission will be increased, resulting in usage delays, the embodiment of the present invention uses the roller set at the tip of the scanning pen to obtain the current scanning speed when the user uses the scanning pen to scan. Here, the current scanning speed refers to the speed at which the user currently moves the scanning pen. When the user moves the tip of the scanning pen to scan text on paper such as newspapers or books, the roller set at the tip of the scanning pen will roll accordingly, so the current scanning speed can be known based on the rolling speed of the roller. Optionally, Figure 2 A schematic diagram of a roller arrangement provided in an embodiment of the present invention is shown in FIG. Figure 2 As shown, a pair of rollers 220 can be set at the positioning claw 210 of the scanning pen tip. When the user moves the scanning pen to scan the paper, the rollers 220 will contact the paper and be driven. On the one hand, the current scanning speed can be known according to the rolling speed of the rollers 220. On the other hand, the friction between the scanning pen tip and the paper can be reduced, so that the user can move the scanning pen more smoothly.
[0050] Based on the acquired current scanning speed, determine the shooting frame rate corresponding to the current scanning speed. The corresponding relationship between the scanning speed and the shooting frame rate may be pre-set, and specifically may be a table listing the corresponding relationship between each scanning speed or scanning speed range and the shooting frame rate, or a formula expressing the conversion relationship between each scanning speed and its corresponding shooting frame rate, so as to obtain the shooting frame rate corresponding to the current scanning speed according to the pre-set corresponding relationship between the scanning speed and the shooting frame rate. Here, the shooting frame rate corresponding to the current scanning speed can match the current scanning speed, so that when the image is captured based on the shooting frame rate, the scanned image obtained is clear enough to be effectively recognized by the optical character recognition module, and the overlap of the continuously captured scanned images is low. Then, change the frame rate setting of the scanning pen camera to capture the image at the shooting frame rate corresponding to the current scanning speed.
[0051] In addition, since the speed at which the user moves the scanning pen is not constant, during the user's use, the embodiment of the present invention can obtain the current scanning speed in real time based on the roller on the tip of the scanning pen, and automatically adjust the camera's shooting frame rate according to the current scanning speed until the scanning is completed. The above frame rate adaptive adjustment method can ensure that no matter what speed the user scans at, or how the scanning speed is changed, the camera's shooting frame rate can be automatically adjusted to ensure that the quality of the captured scanned image is sufficient to be correctly recognized, while avoiding the collection of too many images with high overlap, so as not to increase unnecessary computing and data transmission.
[0052] The method provided in an embodiment of the present invention obtains the current scanning speed based on the roller set at the tip of the scanning pen, and determines the shooting frame rate corresponding to the current scanning speed, so as to perform image acquisition based on the shooting frame rate. It can realize adaptive adjustment of the camera shooting frame rate to ensure that the quality of the captured scanned image is sufficient to be correctly identified, and at the same time avoids capturing too many images with high overlap, so as not to increase unnecessary calculation and data transmission.
[0053] Based on the above embodiment, step 110 specifically includes:
[0054] The current scanning speed is determined based on the angular velocity of the roller rotation acquired by a rotation speed sensor provided in the roller, or based on the number of rotations of the roller per unit time acquired by an encoder provided in the roller.
[0055] Specifically, in circular motion, there is a relationship between linear velocity and angular velocity: linear velocity = angular velocity * radius. Since the diameter of the roller is fixed, when it rolls, the angular velocity of its rotation and the linear velocity of its rotation are in a linear relationship. Figure 3 A schematic diagram of the structure of a roller provided in an embodiment of the present invention is shown in FIG. Figure 3 As shown in the upper part of , a rotation speed sensor 310 may be provided in the roller 220 to collect the angular velocity of the roller 220, so as to calculate the linear velocity of the roller 220 based on the radius of the roller 220 and the angular velocity of the roller 220 as the current scanning velocity. In addition, since the angular velocity of the roller 220 and the linear velocity of the roller 220 are in a linear relationship, that is, the greater the angular velocity of the roller 220, the greater the linear velocity of the roller 220, therefore, the angular velocity of the roller 220 may also be directly used as the current scanning velocity.
[0056] In addition, the circular motion can be converted into linear motion, and the current scanning speed can be obtained by using the rule of speed = moving distance / time. Figure 3As shown in the lower half of the figure, an encoder 320 may be provided inside the roller 220 to collect the number of rotations of the roller 220 per unit time. Based on the circumference of the roller 220 and the number of rotations, the distance moved by the roller 220 per unit time may be calculated, and the current scanning speed may be determined.
[0057] The method provided in an embodiment of the present invention determines the current scanning speed based on the angular velocity of the roller rotation collected by a speed sensor built into the roller, or the number of rotations of the roller per unit time collected by an encoder built into the roller. This method can quickly obtain the current scanning speed, which helps to improve the efficiency of frame rate adjustment.
[0058] Based on any of the above embodiments, step 120 specifically includes:
[0059] Determine the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds;
[0060] Among them, the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates, testing the maximum scanning speed supported under the condition of meeting effective image recognition, or performing image acquisition at multiple preset scanning speeds, and testing the minimum preset shooting frame rate supported under the condition of meeting effective image recognition.
[0061] Specifically, in order to determine the shooting frame rate corresponding to the current scanning speed, preset shooting frame rates corresponding to different scanning speeds can be pre-set, so as to select the preset shooting frame rate corresponding to the current scanning speed as the shooting frame rate. Among them, image acquisition can be performed at multiple preset shooting frame rates respectively, and the maximum scanning speed that can be achieved under the premise of being able to perform effective image recognition can be tested. Here, effective recognition means that the accuracy of image recognition can reach the preset standard. For example, the multiple frame rates supported by the camera are used as multiple preset shooting frame rates f1, f2, ..., f n , when based on any preset shooting frame rate f i When performing image acquisition, scanning is performed at the initial test speed to determine whether the scanned image acquired at the initial test speed can be effectively recognized. The initial test speed can be directly set to a lower value, or it can be set to the previous preset shooting frame rate f that is smaller than the preset shooting frame rate. i-1 The maximum scanning speed supported under the preset shooting frame rate is not specifically limited in the embodiment of the present invention. If it can be effectively recognized, the test speed is gradually increased until the acquired scanned image cannot be effectively recognized. At this time, the maximum test speed that can be effectively recognized can be used as the maximum scanning speed supported under the preset shooting frame rate.
[0062] In addition, image acquisition can be performed at multiple preset scanning speeds to test the minimum preset shooting frame rate that can be supported under the premise of effective image recognition. For example, multiple preset scanning speeds v1, v2, ..., v n , when any preset scanning speed v i When scanning, image acquisition is performed based on the initial test frame rate to determine whether the scanned image acquired at the initial test frame rate can be effectively recognized. The initial test frame rate can be directly set to a higher value or to the next preset scan speed v greater than the preset scan speed. i+1 The minimum preset shooting frame rate supported under the preset scanning speed is not specifically limited in the embodiment of the present invention. If it can be effectively recognized, the test frame rate is gradually reduced until the acquired scanned image cannot be effectively recognized. At this time, the minimum test frame rate that can be effectively recognized can be used as the minimum preset shooting frame rate supported under the preset scanning speed.
[0063] After obtaining the maximum scanning speed supported by each preset shooting frame rate, or the minimum preset shooting frame rate supported by each preset scanning speed, the preset shooting frame rates corresponding to different scanning speeds are obtained, and the shooting frame rate corresponding to the current scanning speed can be selected accordingly.
[0064] The method provided by the embodiment of the present invention determines the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds, and can quickly obtain the shooting frame rate matching the current scanning speed, which helps to improve the efficiency of frame rate adjustment.
[0065] Based on any of the above embodiments, based on preset shooting frame rates corresponding to different scanning speeds, determining the shooting frame rate corresponding to the current scanning speed specifically includes:
[0066] If the current scanning speed is between the maximum scanning speeds corresponding to two adjacent preset shooting frame rates, the higher preset shooting frame rate is used as the shooting frame rate corresponding to the current scanning speed;
[0067] Or, if the current scanning speed is between two adjacent preset scanning speeds, the minimum preset shooting frame rate corresponding to the higher preset scanning speed is used as the shooting frame rate corresponding to the current scanning speed.
[0068] Specifically, if the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates and testing the maximum scanning speed supported under the condition of meeting effective image recognition, then based on the maximum scanning speed supported by each preset shooting frame rate, the scanning speed range supported by each preset shooting frame rate can be known. i The maximum supported scanning speed is vmax i, the supported scanning speed range is (vmax i-1 ,vmax i ], where vmax i-1 The previous preset shooting frame rate f i-1 The maximum scanning speed supported. Therefore, the shooting frame rates corresponding to the scanning speeds within this range are all the preset shooting frame rates. Therefore, when the current scanning speed is between the maximum scanning speeds supported by two adjacent preset shooting frame rates, that is, the current scanning speed is within the scanning speed range supported by the higher preset shooting frame rate, then the shooting frame rate corresponding to the current scanning speed can be set to the higher preset shooting frame rate. If the current scanning speed is less than the maximum scanning speed supported by the lowest preset shooting frame rate, the lowest preset shooting frame rate can be directly used as the shooting frame rate corresponding to the current scanning speed.
[0069] If the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset scanning speeds and testing the minimum preset shooting frame rate supported under the condition of satisfying effective image recognition, then when the current scanning speed is exactly the same as or relatively close to a certain preset scanning speed, the minimum preset shooting frame rate corresponding to the preset scanning speed can be directly used as the shooting frame rate corresponding to the current scanning speed; when the current scanning speed is between two adjacent preset scanning speeds, the minimum preset shooting frame rate corresponding to the higher preset scanning speed can be used as the shooting frame rate corresponding to the current scanning speed to ensure that the scanned image acquired is clear enough; when the current scanning speed is less than the lowest preset scanning speed, the minimum preset shooting frame rate supported by the lowest preset scanning speed can be directly used as the shooting frame rate corresponding to the current scanning speed.
[0070] Based on any of the above embodiments, in this method, if the current scanning speed is greater than a preset maximum speed threshold, a rescan prompt is triggered, and the rescan prompt is in the form of at least one of a screen display prompt, a pen body vibration prompt, and a voice prompt.
[0071] Specifically, if the current scanning speed is greater than the preset maximum speed threshold, it means that the scanning speed at this time is too fast. Even if the image is collected at the maximum frame rate that the camera can support, there will still be residual images in the obtained scanned image, thereby affecting the recognition accuracy of the recognition module. Therefore, it is necessary to trigger a rescan prompt to remind the user to rescan at a slower speed to avoid invalid image recognition operations. Among them, the rescan prompt can be in the form of one or more reminder methods such as screen display prompts, pen body vibration prompts, and voice prompts. When the screen display prompt method is used for rescan prompts, prompt information can be displayed on the display screen of the scanning pen to inform the user to rescan at a slower scanning speed. In order to enhance the prompt effect, the vibration motor built into the scanning pen can also be used to vibrate the pen body, and / or the voice module built into the scanning pen can be used to play voice prompt audio to prevent the user from missing the prompt information.
[0072] Based on any of the above embodiments, Figure 4 A flow chart of a frame rate initialization method provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, before step 110, the following steps are also included:
[0073] Step 101, based on the historical scanning speed, updating the general scanning speed of the scanning pen;
[0074] Step 102: Taking the shooting frame rate corresponding to the general scanning speed as the initial shooting frame rate, and starting image acquisition based on the initial shooting frame rate.
[0075] Specifically, in the initial stage when the user is just about to start using the scanning pen, the current scanning speed cannot be obtained at this time, and the shooting frame rate corresponding to the current scanning speed cannot be determined, and it is also impossible to determine what shooting frame rate should be used for image acquisition at this time. In order to determine the shooting frame rate of the camera in the initial stage when the user uses the scanning pen, it is necessary to set an initial shooting frame rate. Here, the highest preset shooting frame rate supported by the camera can be used as the initial shooting frame rate for image acquisition to ensure that the scanned image acquired is clear enough. However, in the initial stage when the user uses the scanning pen, the scanning speed is usually not very fast. If the image is acquired directly at the highest preset shooting frame rate, the scanned images acquired in the initial stage may have a high overlap rate, thereby increasing the amount of unnecessary calculations and data transmission, affecting the user experience.
[0076] Considering that users have their own customary scanning speed when using a scanning pen to scan, the user's customary scanning speed can be used as the general scanning speed of the scanning pen. When the current scanning speed is unknown, the appropriate shooting frame rate is determined based on the general scanning speed to ensure that a sufficiently clear scanned image can be captured without causing a high overlap rate of adjacent scanned images, thereby increasing unnecessary computing and data transmission. Here, the scanning speed that the user is accustomed to using can be determined based on the user's historical scanning speed, and the determined scanning speed that the user is accustomed to using can be used as the general scanning speed of the scanning pen.
[0077] The user's usage habits are not static. In order to more accurately obtain the scanning speed that the user is currently accustomed to using, when obtaining the user's historical scanning speed, the historical scanning speeds that have been counted in the most recent period of time can be obtained first, and the general scanning speed of the scanning pen can be updated based on the historical scanning speeds in the period of time. In addition, considering that the user who uses the scanning pen may not be unique, when each user uses the scanning pen to scan, the acquired scanning speed can be associated with the user ID, and then when determining the general scanning speed, the historical scanning speed associated with the user ID of the current user can be obtained to infer the scanning speed that the current user is accustomed to using, and then the general scanning speed of the scanning pen can be updated.
[0078] After updating the universal scanning speed of the scanning pen, the shooting frame rate corresponding to the universal scanning speed is determined based on the preset shooting frame rates corresponding to different scanning speeds, and the shooting frame rate is used as the initial shooting frame rate, and image acquisition is started based on the initial shooting frame rate.
[0079] The method provided in an embodiment of the present invention updates the general scanning speed of the scanning pen based on the historical scanning speed, and then uses the shooting frame rate corresponding to the general scanning speed as the initial shooting frame rate, and starts image acquisition based on the initial shooting frame rate, thereby ensuring that a sufficiently clear scanning image can be acquired without causing a high overlap rate between adjacent scanning images, thereby preventing unnecessary increase in computing power and data transmission volume.
[0080] After acquiring the scanned image, the scanning pen will splice the adjacent scanned images and use the spliced image as the input of the recognition module to identify the scanned text content. When splicing images, it is necessary to determine the overlapping range of two consecutive frames of scanned images, and then splice based on the overlapping range. At present, the method of determining the image overlapping range is usually to use an image matching algorithm to calculate the similarity of two frames of scanned images, and obtain the image area with the highest similarity as the overlapping range of the two consecutive frames of scanned images. However, the image matching algorithm is highly complex and requires a large amount of computation, which results in low efficiency in image splicing.
[0081] In this regard, based on any of the above embodiments, Figure 5A flow chart of an image stitching method provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, after step 130, the following steps are also included:
[0082] Step 1301, based on the shooting frame rate and the current scanning speed, determining the overlap range of two consecutive scanned frames obtained by image acquisition;
[0083] Step 1302: splicing two consecutive scanned image frames based on the overlap range.
[0084] Specifically, since the shooting frame rate is the number of images collected by the camera per unit time, based on the shooting frame rate of the current captured image, the time taken to collect two consecutive frames of scanned images at the shooting frame rate corresponding to the current scanning speed can be calculated. On this basis, combined with the current scanning speed, the distance moved by the scanning pen during this period of time can be calculated. It can be known that after collecting a scanned image, the scanning pen will move a distance, and then collect another scanned image, and the previous scanned image will be segmented by the distance moved by the scanning pen, wherein the width of the left image obtained by segmentation is the distance moved by the scanning pen, then the overlapping range of the two scanned images is the area of the right image obtained by segmentation from the previous scanned image. Therefore, based on the distance moved by the scanning pen, the overlapping range of two consecutive frames of scanned images can be determined, and there is no need to perform matching operations on the images during the whole process, which reduces the complexity of the image stitching algorithm and improves the efficiency of image stitching. Based on the overlapping range, the above two consecutive frames of scanned images can be spliced to obtain a spliced image.
[0085] The method provided in the embodiment of the present invention determines the overlap range of two consecutive scanned image frames obtained by image acquisition based on the shooting frame rate and the current scanning speed, and then splices the two consecutive scanned image frames based on the overlap range. During the entire process, there is no need to perform matching operations on the images, which reduces the complexity of the image stitching algorithm and improves the efficiency of image stitching.
[0086] The image acquisition device provided by an embodiment of the present invention is described below. The image acquisition device described below and the image acquisition method described above can be referenced to each other.
[0087] Based on any of the above embodiments, Figure 6 A schematic diagram of the structure of an image acquisition device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the device includes a speed acquisition unit 610 , a shooting frame rate determination unit 620 and an image acquisition unit 630 .
[0088] The speed acquisition unit 610 is used to acquire the current scanning speed based on the roller set at the tip of the scanning pen;
[0089] The shooting frame rate determination unit 620 is used to determine the shooting frame rate corresponding to the current scanning speed;
[0090] The image acquisition unit 630 is used to acquire images based on the shooting frame rate.
[0091] The device provided by the embodiment of the present invention obtains the current scanning speed based on the roller set at the pen tip of the scanning pen, and determines the shooting frame rate corresponding to the current scanning speed, so as to perform image acquisition based on the shooting frame rate. It can realize adaptive adjustment of the camera shooting frame rate to ensure that the quality of the captured scanned image is sufficient to be correctly identified, and at the same time avoids capturing too many images with high overlap, so as not to increase unnecessary calculation and data transmission.
[0092] Based on any of the above embodiments, the speed acquisition unit 610 is specifically used for:
[0093] The current scanning speed is determined based on the angular velocity of the roller rotation acquired by a rotation speed sensor provided in the roller, or based on the number of rotations of the roller per unit time acquired by an encoder provided in the roller.
[0094] The device provided by an embodiment of the present invention determines the current scanning speed based on the angular velocity of the roller rotation collected by a speed sensor built into the roller, or the number of rotations of the roller per unit time collected by an encoder built into the roller. This can quickly obtain the current scanning speed, which helps to improve the efficiency of frame rate adjustment.
[0095] Based on any of the above embodiments, the shooting frame rate determining unit 620 is specifically used for:
[0096] Determine the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds;
[0097] Among them, the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates, testing the maximum scanning speed supported under the condition of meeting effective image recognition, or performing image acquisition at multiple preset scanning speeds, and testing the minimum preset shooting frame rate supported under the condition of meeting effective image recognition.
[0098] The device provided by the embodiment of the present invention determines the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds, and can quickly obtain the shooting frame rate matching the current scanning speed, which helps to improve the efficiency of frame rate adjustment.
[0099] Based on any of the above embodiments, based on preset shooting frame rates corresponding to different scanning speeds, determining the shooting frame rate corresponding to the current scanning speed specifically includes:
[0100] If the current scanning speed is between the maximum scanning speeds corresponding to two adjacent preset shooting frame rates, the higher preset shooting frame rate is used as the shooting frame rate corresponding to the current scanning speed;
[0101] Or, if the current scanning speed is between two adjacent preset scanning speeds, the minimum preset shooting frame rate corresponding to the higher preset scanning speed is used as the shooting frame rate corresponding to the current scanning speed.
[0102] Based on any of the above embodiments, the device also includes a rescan prompt unit, which is used to trigger a rescan prompt if the current scanning speed is greater than a preset maximum speed threshold. The rescan prompt is in the form of at least one of a screen display prompt, a pen body vibration prompt, and a voice prompt.
[0103] Based on any of the above embodiments, the device further includes an image acquisition starting unit, which is specifically used to:
[0104] Update the general scanning speed of the scanning pen based on the historical scanning speed;
[0105] The shooting frame rate corresponding to the general scanning speed is used as the initial shooting frame rate, and image acquisition is started based on the initial shooting frame rate.
[0106] The device provided by the embodiment of the present invention updates the general scanning speed of the scanning pen based on the historical scanning speed, and then uses the shooting frame rate corresponding to the general scanning speed as the initial shooting frame rate, and starts image acquisition based on the initial shooting frame rate, thereby ensuring that a sufficiently clear scanning image can be acquired without causing a high overlap rate between adjacent scanning images, thereby preventing unnecessary increase in computing power and data transmission volume.
[0107] Based on any of the above embodiments, the device further includes an image stitching unit, which is specifically used to:
[0108] Based on the shooting frame rate and the current scanning speed, determining the overlap range of two consecutive scanned frames obtained by image acquisition;
[0109] Based on the overlap range, two consecutive scanned images are spliced.
[0110] The device provided by the embodiment of the present invention determines the overlap range of two consecutive scanned image frames obtained by image acquisition based on the shooting frame rate and the current scanning speed, and then splices the two consecutive scanned image frames based on the overlap range. During the entire process, there is no need to perform matching operations on the images, which reduces the complexity of the image stitching algorithm and improves the efficiency of image stitching.
[0111] Figure 7 The following is a schematic diagram of the structure of a scanning pen. Figure 7As shown, the scanning pen may include: a roller disposed at the pen tip, a processor 710, a communications interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communications interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the image acquisition method, which includes: obtaining the current scanning speed based on the roller disposed at the pen tip of the scanning pen; determining the shooting frame rate corresponding to the current scanning speed; and performing image acquisition based on the shooting frame rate.
[0112] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0113] On the other hand, an embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the image acquisition method provided by the above-mentioned method embodiments, and the method includes: obtaining the current scanning speed based on the roller set at the pen tip of the scanning pen; determining the shooting frame rate corresponding to the current scanning speed; and performing image acquisition based on the shooting frame rate.
[0114] On the other hand, an embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the image acquisition method provided by the above embodiments, the method comprising: obtaining the current scanning speed based on the roller set at the pen tip of the scanning pen; determining the shooting frame rate corresponding to the current scanning speed; and performing image acquisition based on the shooting frame rate.
[0115] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image acquisition method, characterized in that: include: Based on the roller set at the tip of the scanning pen, obtain the current scanning speed; Determine a shooting frame rate corresponding to the current scanning speed; Capturing images based on the shooting frame rate; The determining of the shooting frame rate corresponding to the current scanning speed specifically includes: Determining a shooting frame rate corresponding to the current scanning speed based on preset shooting frame rates corresponding to different scanning speeds; Among them, the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates, testing the maximum scanning speed supported under the condition of meeting effective image recognition, or performing image acquisition at multiple preset scanning speeds, and testing the minimum preset shooting frame rate supported under the condition of meeting effective image recognition.
2. The image acquisition method according to claim 1, characterized in that: The method of obtaining the current scanning speed based on the roller disposed at the tip of the scanning pen specifically includes: The current scanning speed is determined based on the angular velocity of the roller rotation acquired by a rotation speed sensor provided in the roller, or based on the number of rotations of the roller per unit time acquired by an encoder provided in the roller.
3. The image acquisition method according to claim 2, characterized in that: The determining the shooting frame rate corresponding to the current scanning speed based on the preset shooting frame rates corresponding to different scanning speeds specifically includes: If the current scanning speed is between the maximum scanning speeds corresponding to two adjacent preset shooting frame rates, the higher preset shooting frame rate is used as the shooting frame rate corresponding to the current scanning speed; Or, if the current scanning speed is between two adjacent preset scanning speeds, the minimum preset shooting frame rate corresponding to the higher preset scanning speed is used as the shooting frame rate corresponding to the current scanning speed.
4. The image acquisition method according to claim 1, characterized in that: Also includes: If the current scanning speed is greater than a preset maximum speed threshold, a rescan prompt is triggered, and the rescan prompt is in the form of at least one of a screen display prompt, a pen body vibration prompt, and a voice prompt.
5. The image acquisition method according to any one of claims 1 to 4, characterized in that: The method of obtaining the current scanning speed based on the roller disposed at the tip of the scanning pen also includes: Update the general scanning speed of the scanning pen based on the historical scanning speed; The shooting frame rate corresponding to the general scanning speed is used as the initial shooting frame rate, and image acquisition is started based on the initial shooting frame rate.
6. The image acquisition method according to any one of claims 1 to 4, characterized in that: The image acquisition is performed based on the shooting frame rate, and then further includes: Based on the shooting frame rate and the current scanning speed, determining the overlap range of two consecutive frames of scanned images obtained by image acquisition; Based on the overlap range, the two consecutive scanned image frames are spliced.
7. An image acquisition device, characterized in that: include: A speed acquisition unit, used for acquiring a current scanning speed based on a roller arranged at the tip of the scanning pen; A shooting frame rate determining unit, used to determine the shooting frame rate corresponding to the current scanning speed; An image acquisition unit, configured to acquire images based on the shooting frame rate; The shooting frame rate determination unit is specifically used for: Determining a shooting frame rate corresponding to the current scanning speed based on preset shooting frame rates corresponding to different scanning speeds; Among them, the preset shooting frame rates corresponding to different scanning speeds are obtained by performing image acquisition at multiple preset shooting frame rates, testing the maximum scanning speed supported under the condition of meeting effective image recognition, or performing image acquisition at multiple preset scanning speeds, and testing the minimum preset shooting frame rate supported under the condition of meeting effective image recognition.
8. A scanning pen, comprising a roller arranged at a pen tip, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the image acquisition method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image acquisition method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Colour image reader
CN1252668A
Adaptive tuning of 3D acquisition speed for dental surface imaging
US20180296080A1
