A pre-processing method and system for image recognition
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN HUIJIETONG TECH CO LTD
- Filing Date
- 2024-12-23
- Publication Date
- 2026-06-23
AI Technical Summary
Existing image recognition technology consumes a lot of CPU resources and power in reading devices, resulting in poor standby performance.
An image recognition preprocessing method is adopted to distinguish between valid and invalid images by judging the motion trajectory of the image and the camera. The images are then entered into performance mode and power saving mode respectively. Valid images are processed by the algorithm, while invalid images are discarded.
The image recognition process has been optimized, improving the image decoding success rate, reducing the power consumption of the reading device, enhancing standby capability, and enabling rapid acquisition of valid images for computation through predictive judgment.
Smart Images

Figure CN122265809A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a preprocessing method and system for image recognition. Background Technology
[0002] With the development of image recognition technology, it has been widely applied in reading pens and scanning pens. The hardware modules of these products typically include a CPU and a camera. These modules communicate via peripherals such as SPI, serial ports, and USB. After the camera acquires an image, the CPU uses software algorithms to parse the image into data information and further processes it. Images with ghosting or low frame rates during image processing are often invalid. However, in existing reading devices, the CPU's receiving module directly sends the image to the algorithm module for processing, and the CPU activates both the frequency module and the algorithm module to speed up the processing. This results in the CPU consuming significant CPU and memory resources and incurring computational overhead during image parsing, increasing the overall power consumption of the reading device and leading to poor standby performance. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a preprocessing method for image recognition, so as to solve the problems of high resource consumption and high power consumption of existing image recognition technologies.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A preprocessing method for image recognition is provided, further comprising the following steps: S1. The camera captures an image of the target and determines whether the image meets the first preset condition. If yes, the image is considered a valid image, and the system enters performance mode and executes step S3. If no, the image is considered an invalid image and the system executes step S2. S2. Obtain the motion trajectory of the camera and determine whether the motion trajectory of the camera meets the second preset condition; if yes, enter the performance mode and discard the invalid image; if no, enter the power saving mode and discard the invalid image. S3. Perform algorithmic processing on the valid image to parse the valid image and obtain data information.
[0005] Furthermore, in step S1, determining whether the image meets the first preset condition specifically includes: obtaining the characteristic value of the image, determining whether the characteristic value of the image is greater than a preset threshold value; if yes, the image is regarded as a valid image and enters the performance mode, and step S3 is executed; if no, the image is regarded as an invalid image, enters the power saving mode, and step S2 is executed.
[0006] Furthermore, the camera includes a light source element used to adjust the characteristic values of the image.
[0007] Furthermore, the aforementioned entry into performance mode specifically includes: increasing the luminous brightness of the light source and increasing the processor frequency.
[0008] Furthermore, increasing the luminous brightness of the light source specifically includes: adjusting the luminous brightness of the light source according to the characteristic value of the image and the target distance between the camera and the recognition target, wherein the characteristic value of the image and the target distance satisfy the following linear function: y=ax+b, where y is the characteristic value of the image, x is the target distance, a is the light sensitivity coefficient, the light sensitivity coefficient changes with the luminous brightness of the light source, and b is a preset base grayscale value.
[0009] Furthermore, entering the energy-saving mode specifically includes: reducing the luminous brightness of the light source and reducing the processor frequency.
[0010] Furthermore, in step S2, the motion trajectory of the camera is acquired, and it is determined whether the motion trajectory of the camera satisfies the second preset condition, specifically including: Obtain the characteristic value of the invalid image, and use the characteristic value of the invalid image as the characteristic value at the current time. Obtain the characteristic values of the image from the previous time step; Calculate the difference between the characteristic value at the current moment and the characteristic value of the image at the previous moment, and determine whether the difference meets the second preset condition; if yes, enter performance mode and discard the invalid image; if no, enter power saving mode and discard the invalid image. The second preset condition includes: the difference is greater than 0; or, the difference is not equal to 0.
[0011] Furthermore, the method also includes the step of: obtaining the target distance between the camera and the identified target based on the characteristic values of the image.
[0012] Furthermore, the characteristic values include brightness values or grayscale values.
[0013] Another objective of this invention is to provide an image recognition system for implementing the aforementioned image recognition preprocessing method. The image recognition system includes a camera and a processor. The camera is used to acquire images of the target to be recognized. The processor includes a receiving module, a preprocessing module, and an algorithm recognition module connected in sequence. The receiving module is connected to the camera. The preprocessing module is used to identify the image as a valid image or an invalid image, and to send the valid image to the algorithm processing module and discard the invalid image. The algorithm recognition module is used to perform algorithmic processing on the valid image to parse it into data information.
[0014] The beneficial effects of this invention are as follows: The image recognition preprocessing method provided by this invention can preprocess images, which can identify images as valid and invalid images, perform algorithmic recognition on valid images, and discard invalid images; this preprocessing method can optimize the image recognition process, improve the image decoding success rate by filtering valid and invalid images, eliminate the need for algorithmic recognition of invalid images, thereby reducing the power consumption of the reading device using this preprocessing method and improving the standby capability of the image recognition system; in addition, when the preprocessing method identifies an image as invalid, it analyzes whether the camera moves closer to or further away from the recognition target based on the camera's movement path, and makes a predictive judgment on whether a valid image will be received during the camera's movement along the path, thereby facilitating rapid calculation when the reading device's camera can acquire a valid image. Attached Figure Description
[0015] Figure 1 This is a flowchart of the preprocessing steps of the image recognition method described in this invention; Figure 2 This is a block diagram of the image recognition system described in this invention; Figure 3 This is an illustration showing an image where the characteristic value is greater than a preset threshold. Figure 4 This is an illustration showing an image where the characteristic value is less than a preset threshold.
[0016] Label Explanation: 1. Camera; 2. Processor; 21. Receiver module; 22. Preprocessing module; 23. Algorithm recognition module. Detailed Implementation
[0017] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0018] Please refer to Figure 1 as well as Figure 2An image recognition preprocessing method includes the following steps: S1. The camera captures an image of the target and determines whether the image meets the first preset condition. If yes, the image is considered a valid image, and the system enters performance mode and executes step S3. If no, the image is considered an invalid image and the system executes step S2. S2. Obtain the motion trajectory of the camera and determine whether the motion trajectory of the camera meets the second preset condition; if yes, enter the performance mode and discard the invalid image; if no, enter the power saving mode and discard the invalid image. S3. Perform algorithmic processing on the valid image to parse the valid image and obtain data information.
[0019] As described above, the beneficial effects of the present invention are as follows: The image recognition preprocessing method provided by the present invention can preprocess images, which can identify images as valid and invalid images, and perform algorithmic recognition on valid images while discarding invalid images; the preprocessing method can optimize the image recognition process, improve the image decoding success rate by filtering valid and invalid images, eliminate the need for algorithmic recognition of invalid images, thereby reducing the power consumption of the reading device using the preprocessing method and improving the standby capability of the image recognition system; in addition, when the preprocessing method identifies an image as invalid, it analyzes whether the camera moves closer to or further away from the recognition target based on the camera's movement path, and makes a predictive judgment based on whether a valid image will be received during the camera's movement along the path, thereby facilitating rapid calculation when the camera of the reading device can acquire a valid image.
[0020] Furthermore, in step S1, determining whether the image meets the first preset condition specifically includes: obtaining the characteristic value of the image, determining whether the characteristic value of the image is greater than a preset threshold value; if yes, the image is regarded as a valid image and enters the performance mode, and step S3 is executed; if no, the image is regarded as an invalid image, enters the power saving mode, and step S2 is executed.
[0021] As described above, the preset threshold value can be set according to the minimum characteristic value that the algorithm recognition module can effectively process.
[0022] In addition, the preset threshold value can also reflect the target distance between the camera and the target to be recognized. When the feature value of the image is greater than the preset threshold value, the target distance between the camera and the target to be recognized is the distance at which a valid image that can be successfully recognized by the recognition algorithm can be acquired.
[0023] Furthermore, the camera includes a light source element used to adjust the characteristic values of the image.
[0024] Furthermore, the aforementioned entry into performance mode specifically includes: increasing the luminous brightness of the light source and increasing the processor frequency.
[0025] Furthermore, increasing the luminous brightness of the light source specifically includes: adjusting the luminous brightness of the light source according to the characteristic value of the image and the target distance between the camera and the recognition target, wherein the characteristic value of the image and the target distance satisfy the following linear function: y=ax+b, where y is the characteristic value of the image, x is the target distance, a is the light sensitivity coefficient, the light sensitivity coefficient changes with the luminous brightness of the light source, and b is a preset base grayscale value.
[0026] As described above, the preprocessing method provided by the present invention can improve the basic value of the image's characteristic values by using a light source, so that when the target distance is within a reasonable range, the image's characteristic values can be improved by the light source, enabling the image to be quickly recognized and correctly parsed by the algorithm recognition module.
[0027] Furthermore, entering the energy-saving mode specifically includes: reducing the luminous brightness of the light source and reducing the processor frequency.
[0028] Furthermore, in step S2, the motion trajectory of the camera is acquired, and it is determined whether the motion trajectory of the camera satisfies the second preset condition, specifically including: Obtain the characteristic value of the invalid image, and use the characteristic value of the invalid image as the characteristic value at the current time. Obtain the characteristic values of the image from the previous time step; Calculate the difference between the characteristic value at the current moment and the characteristic value of the image at the previous moment, and determine whether the difference meets the second preset condition; if yes, enter performance mode and discard the invalid image; if no, enter power saving mode and discard the invalid image. The second preset condition includes: the difference is greater than 0; or, the difference is not equal to 0.
[0029] As described above, the preprocessing method provided by this invention can analyze the recognition distance between the camera and the target based on the principle of light reflection. Specifically, the smaller the recognition distance between the camera and the target, the higher the grayscale value of the image captured by the camera; conversely, the greater the recognition distance, the lower the grayscale value of the image captured by the camera. Therefore, by comparing the characteristic values at the current moment with those at the previous moment, the movement path of the camera relative to the target can be determined. Furthermore, the method also includes the step of: obtaining the target distance between the camera and the identified target based on the characteristic values of the image.
[0030] Furthermore, the characteristic values include brightness values or grayscale values.
[0031] Another objective of this invention is to provide an image recognition system for implementing the aforementioned image recognition preprocessing method. The image recognition system includes a camera and a processor. The camera is used to acquire images of the target to be recognized. The processor includes a receiving module, a preprocessing module, and an algorithm recognition module connected in sequence. The receiving module is connected to the camera. The preprocessing module is used to identify the image as a valid image or an invalid image, and to send the valid image to the algorithm processing module and discard the invalid image. The algorithm recognition module is used to perform algorithmic processing on the valid image to parse it into data information.
[0032] As can be seen from the above description, the image recognition system provided by the present invention possesses at least all the beneficial effects of the above-mentioned image recognition preprocessing method.
[0033] Example 1 Please refer to Figure 1 and Figure 2 Embodiment 1 of the present invention provides an image recognition preprocessing method, which includes the following steps: S1. The camera captures an image of the target and determines whether the image meets the first preset condition. If yes, the image is considered a valid image, and the system enters performance mode and executes step S3. If no, the image is considered an invalid image and the system executes step S2. S2. Obtain the motion trajectory of the camera and determine whether the motion trajectory of the camera meets the second preset condition; if yes, enter the performance mode and discard the invalid image; if no, enter the power saving mode and discard the invalid image. S3. Perform algorithmic processing on the valid image to parse the valid image and obtain data information.
[0034] Please refer to Figure 2 In this embodiment, the preprocessing method described above can be applied to the image recognition system of the reading device. The image recognition system includes a camera 1 and a processor 2. The camera is used to acquire an image 1 of the target to be recognized. The processor 2 includes a receiving module 21, a preprocessing module 22, and an algorithm recognition module 23 connected in sequence. The receiving module 21 is connected to the camera 1 and is used to receive the image and send the image to the preprocessing module 22. The preprocessing module 22 is used to recognize the image as a valid image or an invalid image, and sends the valid image to the algorithm processing module 23 and discards the invalid image. The algorithm recognition module 23 is used to perform algorithm processing on the valid image to parse the valid image into data information.
[0035] The aforementioned camera can specifically employ a camera device that uses the characteristic values of the captured image and the distance between the camera and the object being photographed, so that the recognition distance between the camera and the target can be reflected based on the characteristic values of the image.
[0036] In this embodiment, the camera can be a light-sensitive camera (such as an infrared camera). Based on the principle of light reflection, this preprocessing method can identify the recognition distance between the camera and the target by analyzing the characteristic values of the image.
[0037] Specifically, based on the principle of light reflection, the smaller the recognition distance between the camera and the target, the higher the grayscale or brightness value of the image captured by the camera; conversely, the greater the recognition distance, the lower the grayscale or brightness value of the image captured by the camera. Therefore, this embodiment can obtain the recognition distance between the camera and the target by acquiring the characteristic parameters of the image.
[0038] In this embodiment, the camera includes a light source element, which is used to adjust the characteristic values of the image.
[0039] In this embodiment, the reading device using this preprocessing method can be equipped with an infrared sensor as a light source. When the recognition distance is fixed, the grayscale value or brightness value of the image captured by the camera when the infrared light is increased is significantly greater than the grayscale value or brightness value of the image captured by the camera when the infrared light is reduced. By increasing the grayscale value or brightness value of the image, the image recognition efficiency of the algorithm recognition module can be improved.
[0040] The performance mode described in this embodiment specifically includes: increasing the luminous brightness of the light source and increasing the processor frequency.
[0041] Specifically, increasing the luminous brightness of the light source includes adjusting the luminous brightness of the light source based on the characteristic values of the image and the target distance between the camera and the target being identified. The characteristic values of the image and the target distance satisfy the following linear function: y=ax+b, where y is the characteristic value of the image, x is the target distance, a is the light sensitivity coefficient, which changes with the luminous brightness of the light source, and b is a preset base grayscale value.
[0042] When the recognition distance between the camera and the target is within a reasonable range, increasing the brightness of the light source improves the baseline values of the image characteristics, thereby increasing the image recognition processing speed. However, increasing the brightness of the light source increases the overall power consumption of the reading device; therefore, the application of the light source needs to be dynamically adjusted.
[0043] Increasing the processor frequency can improve the processing speed of image recognition, but it also increases the power consumption of the reading device; increasing the brightness of the light source can improve the basic value of the image characteristic value, thereby further improving the image recognition efficiency.
[0044] Accordingly, the system enters an energy-saving mode, which specifically includes reducing the brightness of the light source and lowering the processor frequency.
[0045] Reducing the processor frequency will decrease the efficiency of image recognition processing, allowing the processor to enter a low-power mode and reducing the overall power consumption of the reading device. Reducing the brightness of the light source will decrease the characteristic values of the image captured by the camera, reduce the efficiency of image recognition, and reduce the overall power consumption of the reading device.
[0046] In this embodiment, the parameter b, which represents the preset base grayscale value in the above linear function, can be regarded as a reference value. It does not affect the overall power consumption of the reading device. When the device leaves the factory, the parameter b is set according to the relationship between the characteristic value of the image captured by the camera and the distance during the factory test, and the parameter b is fixed in the reading device.
[0047] In step S1 of this embodiment, determining whether the image meets the first preset condition specifically includes: obtaining the characteristic value of the image, determining whether the characteristic value of the image is greater than a preset threshold value; if yes, the image is regarded as a valid image and enters the performance mode, and step S3 is executed; if no, the image is regarded as an invalid image, enters the power saving mode, and step S2 is executed.
[0048] The preset threshold value can be set based on the minimum characteristic value that the algorithm recognition module can effectively process. For example... Figure 3 As shown, when the grayscale value or brightness value of an image exceeds a preset threshold, the image is clear, and its algorithm recognition module can effectively and efficiently analyze and recognize the image; for example... Figure 4 As shown, when the grayscale value or brightness value of an image is less than a preset threshold, the algorithm recognition module has difficulty in analyzing and recognizing the image.
[0049] In this embodiment, the preprocessing module will only send images with feature values higher than the threshold value to the algorithm recognition module.
[0050] Preferably, the preset threshold values may include a first threshold value and a second threshold value. The first threshold value is the minimum characteristic value that the algorithm recognition module can effectively process when the light source is on; the second threshold value is the minimum characteristic value that the algorithm recognition module can effectively process when the light source is off. Setting the first and second threshold values in this manner can further improve the optimization effect of the image recognition process using this preprocessing method.
[0051] In step S2 of this embodiment, the motion trajectory of the camera is acquired, and it is determined whether the motion trajectory of the camera satisfies the second preset condition. Specifically, this includes: Obtain the characteristic value of the invalid image, and use the characteristic value of the invalid image as the characteristic value at the current time. Obtain the characteristic values of the image from the previous time step; Calculate the difference between the characteristic value at the current moment and the characteristic value of the image at the previous moment, and determine whether the difference meets the second preset condition; if yes, enter performance mode and discard the invalid image; if no, enter power saving mode and discard the invalid image.
[0052] The preprocessing method provided in this embodiment can quickly calculate and obtain the characteristic values of an image. These characteristic values include brightness values.
[0053] In detail, the brightness value can be calculated quickly by obtaining the pixels around the center of the image. The reading device using this preprocessing method will generate multiple images in chronological order during use. The preprocessing module can store the brightness values V1, V2, V3...Vn of multiple images in sequence. If the image at the current moment does not meet the first preset condition, the brightness value of the image at the current moment is compared with the brightness value of the image at the previous moment, and the difference between the two is calculated.
[0054] According to the principle of light reflection, the difference V' between the brightness value of the image at the current moment and the brightness value of the image at the previous moment has at least the following relationship: When V' equals 0, the recognition distance between the camera and the target remains unchanged at the current moment and the previous moment, that is, the camera's motion trajectory is relatively stationary with respect to the target; when V' is greater than 0, the recognition distance at the current moment is less than the recognition distance at the previous moment, that is, the camera's motion trajectory is moving towards the target; when V' is less than 0, the recognition distance at the current moment is greater than the recognition distance at the previous moment, that is, the camera's motion trajectory is moving away from the target.
[0055] In this embodiment, the second preset condition can be a difference greater than 0; or, a difference not equal to 0. When the second preset condition is set to a difference greater than 0, if the image does not meet the first preset condition, it will only determine that a valid image may be received behind the camera when the camera approaches the target and enter the performance mode, so that it can quickly perform calculations when a valid image is acquired.
[0056] When the second preset condition is set to a difference of not equal to 0, even if the image does not meet the first preset condition, the camera may receive a valid image when it moves closer to or further away from the target. In performance mode, the camera can quickly perform calculations when a valid image is acquired.
[0057] In summary, the image recognition preprocessing method provided by this invention can preprocess images, classifying them into valid and invalid images. Valid images are then subjected to algorithmic recognition, while invalid images are discarded. This preprocessing method optimizes the image recognition process, improving the image decoding success rate by filtering valid and invalid images, eliminating the need for algorithmic recognition of invalid images, thereby reducing the power consumption of the reading device using this preprocessing method and improving the standby capability of the image recognition system. Furthermore, when an image is identified as invalid, the preprocessing method analyzes the camera's movement path as it approaches or moves away from the target, making a predictive judgment based on whether a valid image will be received during the camera's movement. This facilitates rapid computation when the reading device's camera can acquire a valid image.
[0058] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A preprocessing method for image recognition, characterized in that, Includes the following steps: S1. The camera captures an image of the target and determines whether the image meets the first preset condition. If yes, the image is considered a valid image, and the system enters performance mode and executes step S3. If no, the image is considered an invalid image and the system executes step S2. S2. Obtain the motion trajectory of the camera and determine whether the motion trajectory of the camera meets the second preset condition; if yes, enter the performance mode and discard the invalid image; if no, enter the power saving mode and discard the invalid image. S3. Perform algorithmic processing on the valid image to parse the valid image and obtain data information.
2. The pretreatment method according to claim 1, characterized in that, In step S1, determining whether the image meets the first preset condition specifically includes: obtaining the characteristic value of the image, determining whether the characteristic value of the image is greater than a preset threshold value; if yes, the image is regarded as a valid image and enters the performance mode, and step S3 is executed; if no, the image is regarded as an invalid image, enters the power saving mode, and step S2 is executed.
3. The pretreatment method according to claim 1, characterized in that, The camera includes a light source element, which is used to adjust the characteristic values of the image.
4. The pretreatment method according to claim 3, characterized in that, The aforementioned entry into performance mode specifically includes: increasing the luminous brightness of the light source and increasing the processor frequency.
5. The pretreatment method according to claim 4, characterized in that, The method of increasing the luminous brightness of the light source specifically includes: adjusting the luminous brightness of the light source according to the characteristic value of the image and the target distance between the camera and the recognition target, wherein the characteristic value of the image and the target distance satisfy the following linear function: y=ax+b, where y is the characteristic value of the image, x is the target distance, a is the light sensitivity coefficient, the light sensitivity coefficient changes with the luminous brightness of the light source, and b is a preset base gray value.
6. The pretreatment method according to claim 3, characterized in that, The aforementioned entry into energy-saving mode specifically includes: reducing the luminous brightness of the light source and reducing the processor frequency.
7. The pretreatment method according to claim 1, characterized in that, In step S2, the motion trajectory of the camera is acquired, and it is determined whether the motion trajectory of the camera meets the second preset condition, specifically including: Obtain the characteristic value of the invalid image, and use the characteristic value of the invalid image as the characteristic value at the current time. Obtain the characteristic values of the image from the previous time step; Calculate the difference between the characteristic value at the current moment and the characteristic value of the image at the previous moment, and determine whether the difference meets the second preset condition; if yes, enter performance mode and discard the invalid image; if no, enter power saving mode and discard the invalid image. The second preset condition includes: the difference is greater than 0; or, the difference is not equal to 0.
8. The pretreatment method according to claim 1, characterized in that, It also includes the step of: obtaining the target distance between the camera and the identified target based on the characteristic values of the image.
9. The preprocessing method according to any one of claims 2, 3, 7, and 8, characterized in that, The characteristic values include brightness values or grayscale values.
10. An image recognition system, characterized in that, The image recognition system is used to implement the image recognition preprocessing method according to any one of claims 1 to 9. The image recognition system includes a camera and a processor. The camera is used to acquire images of the target to be recognized. The processor includes a receiving module, a preprocessing module and an algorithm recognition module connected in sequence. The receiving module is connected to the camera. The preprocessing module is used to recognize the image as a valid image or an invalid image, and to send the valid image to the algorithm processing module and discard the invalid image. The algorithm recognition module is used to process the valid image using algorithms to parse the valid image into data information.