Test strip image acquisition method and system, test pen control device and storage medium
By adjusting the position of the test strip test pen according to the image width in the test strip test pen control device, making it perpendicular to the image acquisition device, the problem of unclear image acquisition and low reliability of the test strip is solved, and efficient Automated image acquisition process.
Patent Information
- Application Number
- CN202411028554.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, the image acquisition of the test strip is not clear and has low reliability, so it is impossible to accurately obtain the detection line and quality control line information, mainly due to the inaccuracy of the test strip is not perpendicular to the camera and the interpolation method correction.
In the test strip test pen control device, the test strip test pen is controlled to rotate according to the preset angle and direction, to obtain the width of the target line in the current image, and to adjust the position of the test strip test pen according to the image width after the previous rotation , so that it is perpendicular to the image acquisition device, thereby realizing clear image acquisition.
It ensures the integrity and clarity of the test strip image, improves the reliability of the test results, frees manpower, and realizes the automated collection process.
Smart Images

Figure CN118937225A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of test strip image acquisition, and in particular to a test strip image acquisition method, system, test pen control device and storage medium. Background Art
[0002] Colloidal gold test strips are a new rapid detection technology in recent years. Users can obtain test results based on the test line and quality control line on the test strip. Therefore, how to clearly obtain the test line and quality control line on the test strip has become a technical problem that needs to be solved urgently.
[0003] At present, it is usually necessary to make the test surface of the test strip perpendicular to the camera, so that the camera can capture the test strip image of the test surface of the test strip, and use the software correction method to correct the test strip image. Specifically, the width of the preset line in the test strip image is compared with the preset width to determine the deflection angle, and then the test strip image is corrected by the interpolation method based on the deflection angle, so as to accurately obtain the information of the detection line and quality control line in the test strip.
[0004] However, there is an error between the preset width and the actual width of the preset line in the test strip image, which may lead to inaccurate correction of the test strip image, and thus make it impossible to clearly obtain the test strip detection line and quality control line information. In addition, the reliability of calibrating the test strip image using the interpolation method is low. Summary of the invention
[0005] The purpose of the present application is to provide a test strip image acquisition method, system, test pen control device and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the test strip images collected in the prior art are unclear and have low reliability.
[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0007] In a first aspect, the present application provides a test strip image acquisition method, which is applied to a test pen control device in a test strip test system, wherein the test strip test system comprises: a test strip test pen, the test pen control device, and an image acquisition device, wherein the test pen control device is respectively connected to the test strip test pen and the image acquisition device for communication, wherein the test strip test pen is used to insert a test strip, and the method comprises:
[0008] Control the test strip test pen to rotate in sequence according to a preset angle and a preset direction;
[0009] Acquire a current image of the test strip test pen captured by the image acquisition device after the test strip test pen rotates this time;
[0010] Performing image analysis on the current image to determine whether there is a target line in the current image;
[0011] If so, determine the width of the target line, and control the test strip test pen to rotate to the target position based on the width of the target line in the current image and the width of the target line in the previous image captured after the previous rotation, and control the image acquisition device to capture the test strip image, wherein, when the test strip test pen rotates to the target position, the test strip inserted in the test strip test pen is perpendicular to the image acquisition device.
[0012] Optionally, controlling the test strip test pen to rotate to a target position according to the width of the target line in the current image and the width of the target line in a previous image acquired after the previous rotation includes:
[0013] If the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by the preset angle so that the test strip test pen is located at the target position.
[0014] Optionally, controlling the test strip test pen to rotate to a target position according to the width of the target line in the current image and the width of the target line in a previous image acquired after the previous rotation includes:
[0015] If the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue to rotate along the preset direction by the preset angle, and the width of the target line in the new current image is reacquired, and the width of the target line in the new current image and the width of the target line in the new previous image are judged, and the execution is repeated until the width of the target line in the current image is less than the width of the target line in the previous image.
[0016] Optionally, after determining whether there is a target line in the current image, the method further includes:
[0017] If the target line does not exist in the current image, the test pen of the test strip is controlled to rotate according to the width of the target line in the previous image.
[0018] Optionally, controlling the test strip test pen to rotate according to the width of the target line in the previous image includes:
[0019] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 is less than the preset number, the test strip test pen is controlled to rotate along the preset direction by a first target angle, and the first target angle is greater than the preset angle;
[0020] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches a preset number, a prompt message is output, and the prompt message is used to prompt that the test strip is not detected.
[0021] Optionally, controlling the test strip test pen to rotate according to the width of the target line in the previous image includes:
[0022] If the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate in the opposite direction of the preset direction to a second target angle, and the second target angle is greater than the preset angle.
[0023] Optionally, the test strip test system further comprises: a driving device, one end of which is connected to the test pen control device, and the other end of which is connected to the test strip test pen;
[0024] The controlling the test strip test pen to rotate sequentially according to a preset angle and a preset direction comprises:
[0025] Control instructions are sent to the driving device in sequence, so that the driving device controls the test paper strip test pen to rotate in sequence according to a preset angle and a preset direction according to the control instructions, wherein the control instructions are used to indicate the preset angle and the preset direction.
[0026] In a second aspect, the present application provides a test strip test system, which includes: a test strip test pen, a test pen control device and an image acquisition device, wherein the test pen control device is communicatively connected to the test strip test pen and the image acquisition device respectively, the test strip test pen is used to insert a test strip, and the test pen control device is used to execute the steps of the test strip image acquisition method described in the first aspect.
[0027] In a third aspect, the present application provides a test strip image acquisition device, the device comprising:
[0028] A control module, used to control the test strip test pen to rotate in sequence according to a preset angle and a preset direction;
[0029] An acquisition module, used for acquiring a current image of the test strip test pen acquired by the image acquisition device after the test strip test pen rotates this time;
[0030] A determination module, used for performing image analysis on the current image to determine whether there is a target line in the current image;
[0031] an acquisition module, for determining the width of the target line if so, and controlling the test strip test pen to rotate to the target position according to the width of the target line in the current image and the width of the target line in the previous image acquired after the previous rotation, and controlling the image acquisition device to acquire the test strip image, wherein, when the test strip test pen rotates to the target position, the test strip inserted in the test strip test pen is perpendicular to the image acquisition device.
[0032] Optionally, the acquisition module is specifically used for:
[0033] If the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by the preset angle so that the test strip test pen is located at the target position.
[0034] Optionally, the acquisition module is specifically used for:
[0035] If the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue to rotate along the preset direction by the preset angle, and the width of the target line in the new current image is reacquired, and the width of the target line in the new current image and the width of the target line in the new previous image are judged, and the execution is repeated until the width of the target line in the current image is less than the width of the target line in the previous image.
[0036] Optionally, the determining module is further used for:
[0037] If the target line does not exist in the current image, the test pen of the test strip is controlled to rotate according to the width of the target line in the previous image.
[0038] Optionally, the determining module is specifically used to:
[0039] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 is less than the preset number, the test strip test pen is controlled to rotate along the preset direction by a first target angle, and the first target angle is greater than the preset angle;
[0040] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches a preset number, a prompt message is output, and the prompt message is used to prompt that the test strip is not detected.
[0041] Optionally, the determining module is specifically used to:
[0042] If the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate in the opposite direction of the preset direction to a second target angle, and the second target angle is greater than the preset angle.
[0043] Optionally, the test strip test system further comprises: a driving device, one end of which is connected to the test pen control device, and the other end of which is connected to the test strip test pen;
[0044] Optionally, the control module is specifically used for:
[0045] Control instructions are sent to the driving device in sequence, so that the driving device controls the test paper strip test pen to rotate in sequence according to a preset angle and a preset direction according to the control instructions, wherein the control instructions are used to indicate the preset angle and the preset direction.
[0046] In a fourth aspect, the present application provides a test pen control device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the test pen control device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the test strip image acquisition method as described above.
[0047] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned test strip image acquisition method are executed.
[0048] The beneficial effects of the present application are: the test pen control device controls the test strip test pen to rotate sequentially according to a preset angle and a preset direction, and controls the test strip test pen to rotate to a target position according to the width of the target line in the acquired current image and the width of the target line in the previous image acquired after the previous rotation, so that the test strip inserted in the test strip test pen is perpendicular to the image acquisition device. In this embodiment, during the process of acquiring the test strip image, the test strip test pen placed at any angle is rotated sequentially, and based on the judgment of the target line width in the graphics acquired during each rotation, the test strip can be completely perpendicular to the image acquisition device, so that the image acquisition device can obtain a complete and clear test strip image, ensuring the reliability of subsequent test results. And the entire processing process frees the hands of the staff without human intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 It is a structural schematic diagram of a test strip testing system provided in an embodiment of the present application;
[0051] Figure 2 It is a top view schematic diagram of a test strip test pen provided in an embodiment of the present application;
[0052] Figure 3 It is a flow chart of a test strip image acquisition method provided in an embodiment of the present application;
[0053] Figure 4 It is a flow chart of another test strip image acquisition method provided in an embodiment of the present application;
[0054] Figure 5 is a structural schematic diagram of another test strip testing system provided in an embodiment of the present application;
[0055] Figure 6 It is a structural schematic diagram of a test strip image acquisition device provided in an embodiment of the present application;
[0056] Figure 7 It is a structural schematic diagram of a test pen control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0058] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0059] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0060] In the prior art, a camera is usually used to capture an image of a vertically fixed test strip on a test strip test pen, and an image correction method such as interpolation is used on the test strip image to identify the detection line in the test strip image. However, since the test strip in the test strip test pen may not be able to remain perpendicular to the camera, the camera cannot clearly capture the image of the test strip. In addition, when using an image correction method to identify the detection line, if an interpolation method is used, the data points compensated during the image correction are inferred from the existing pixel points according to a linear expression. Therefore, the reliability of the recognition result is not high.
[0061] Based on this, the present application proposes a test strip image acquisition method, which is applied to a test pen control device in a test strip test system, the test pen control device controls the test strip test pen to rotate in sequence according to a preset angle and a preset direction, and obtains the target line in the current image of the test strip test pen after this rotation, and determines the width of the target line and the target line in the previous image acquired after the previous rotation to control the test strip test pen to rotate to the target position, at which time the test strip is perpendicular to the image acquisition device. During the rotation of the test strip test pen, the method proposed in the present application controls the rotation of the test strip test pen in real time according to the width of the target line in the acquired current image and the width of the target line in the previous image, so that the test strip test pen rotates to a position where the test strip is perpendicular to the image acquisition device, at which time the image of the test strip acquired by the image acquisition device is clear and complete, and the test result analysis is performed based on the image, with high reliability.
[0062] Next, before introducing the test strip image acquisition method, the test strip testing system to which the method is applied is described. Figure 1 is a schematic diagram of the structure of a test strip testing system provided in an embodiment of the present application, such as Figure 1As shown, the test strip test system includes: a test strip test pen, a test pen control device and an image acquisition device. Among them, the test pen control device is respectively connected to the test strip test pen and the image acquisition device for communication, and the test strip test pen is used to insert the test strip. The image acquisition device is fixed and acquires the image of the test strip test pen according to the acquisition control instruction sent by the test pen control device.
[0063] Specifically, the test strip test pen can be inserted into multiple test strips, and then turn them toward the image acquisition device in sequence, so that the image acquisition device can capture images of the test strip area. Figure 2 Schematic diagram of a top view of a test strip test pen provided in an embodiment of the present application. Figure 2 As shown, the test strip test pen includes a shell and a test strip fixing device, the shell is a cylinder, the test strip fixing device is a triangular prism, and a test strip can be fixed on each of the three sides of the triangular prism, and the test strip test pen rotates along the central axis.
[0064] Figure 3 is a flow chart of a test strip image acquisition method provided in an embodiment of the present application. Next, refer to Figure 3 The method is described in detail. Optionally, the test strip image acquisition method is applied to a test pen control device.
[0065] S301, controlling the test strip test pen to rotate in sequence according to a preset angle and a preset direction.
[0066] Optionally, during the rotation of the test strip test pen, each time the test strip test pen rotates along a preset direction by a preset angle, the following steps S302 to S304 are performed until the test strip test pen is controlled to rotate to a target position.
[0067] Exemplarily, the preset angle may be a smaller degree such as 0.5 degree or 1 degree, so that a complete and clear image of the test strip can be accurately obtained by successively rotating and judging in smaller degrees.
[0068] S302: Obtain a current image of the test strip test pen captured by the image capture device after the test strip test pen rotates this time.
[0069] Optionally, after the test pen control device controls the test paper strip test pen to rotate according to a preset angle, the image acquisition device is controlled to acquire a current image of the test paper strip test pen. Specifically, the image acquisition device acquires a current image of the test paper strip area.
[0070] S303: Perform image analysis on the current image to determine whether there is a target line in the current image.
[0071] Optionally, an image recognition algorithm may be used to analyze the current image to determine whether a target line exists in the current image. The target line may be a quality control line in a test strip or a label line on a test strip. It should be understood that each test strip will be labeled or printed before use. When capturing the image of the test strip, the upper edge or lower edge of the label is used as the target line, so that the test strip captured by the image capture device can be clearer and more complete.
[0072] Optionally, when there is a target line in the current image, it means that a test strip is fixed on the test strip test pen and the test strip is facing the image acquisition device.
[0073] S304. If yes, determine the width of the target line, and control the test strip test pen to rotate to the target position according to the width of the target line in the current image and the width of the target line in the previous image captured after the previous rotation, and control the image acquisition device to capture the test strip image, wherein, when the test strip test pen rotates to the target position, the test strip inserted in the test strip test pen is perpendicular to the image acquisition device.
[0074] As an optional implementation, the width of the target line in the current image can be compared with the width of the target line in the previous image captured after the previous rotation. If the width of the target line in the current image is greater than the width of the target line in the previous image, it means that the current rotation direction is getting closer to the target position. If the width of the target line in the current image is less than the width of the target line in the previous image, it means that the test strip test pen will be moved away from the target position according to the current rotation direction.
[0075] Optionally, when the test strip image acquisition method starts, the test strip test pen is first controlled to rotate once, and the width of the target line in the previous image acquired after the previous rotation is set to 0, then the width of the target line in the current image acquired after the rotation must be greater than the width of the target line in the previous image, and the test strip test pen is then controlled to rotate according to the preset direction and preset angle. After the new rotation, if the width of the target line in the new current image is less than the width of the target line in the new front wheel image, it means that the preset direction is the direction away from the target position, and the test strip test pen is controlled to rotate in the opposite direction of the preset direction, so that the test strip test pen rotates to the target position.
[0076] It should be understood that when the test strip inserted in the test strip test pen is perpendicular to the image acquisition device, the current image captured by the image acquisition device is clearest relative to the previously captured image. Therefore, the result obtained by capturing the image of the test strip in the test strip test pen at the target position and analyzing the captured image is the most reliable.
[0077] It is worth noting that if the shape of the test strip fixing device in the test strip test pen is determined, such as an equilateral triangular prism, then after the test strip test pen is rotated to the target position, one of the test strips in the test strip test pen will be perpendicular to the image acquisition device. After the image acquisition device acquires the image of the test strip perpendicular to it, the test pen control device directly rotates the test strip test pen 60 degrees to a position perpendicular to the adjacent test strip, and directly controls the image acquisition device to acquire images of the adjacent test strips. It can be seen that for a test strip test pen, the test pen control device only needs to pass through the preset angle and preset direction once, such as the steps in steps S301-S304 above, until one test strip is perpendicular to the image acquisition device, and can quickly acquire images of all inserted test strips in the test strip test pen through a few rotations.
[0078] If the shape of the test strip fixing device in the test strip test pen cannot be determined, it is necessary to sequentially perform the steps S301 to S304 for each test strip of the test strip test pen to obtain an image of each test strip.
[0079] It is worth mentioning that in the actual operation, although the preset angle of rotation of the test strip test pen is very small, it may still be impossible to fully rotate the test strip test pen to the target position. Therefore, the following two operations can be performed: the first is to continue to reduce the preset angle so that the test strip in the test strip test pen can be completely perpendicular to the image acquisition device. The second is to use the position that is closest to the vertical position of the image acquisition device as the target position according to the preset angle, so that the image acquisition device can capture the test strip image to the greatest extent.
[0080] In this embodiment, the test pen control device controls the test strip test pen to rotate in sequence according to a preset angle and a preset direction, and controls the test strip test pen to rotate to a target position according to the width of the target line in the acquired current image and the width of the target line in the previous image acquired after the previous rotation, so that the test strip inserted in the test strip test pen is perpendicular to the image acquisition device. In this embodiment, during the process of collecting the test strip image, the test strip test pen placed at any angle is rotated in sequence, and based on the judgment of the target line width in the graphics collected during each rotation, the test strip can be completely perpendicular to the image acquisition device, so that the image acquisition device can obtain a complete and clear test strip image, ensuring the reliability of subsequent test results. And the entire processing process frees the hands of the staff without human intervention.
[0081] Furthermore, the following describes how to control the test strip test pen to rotate to the target position according to the width of the target line in the current image and the width of the target line in the previous image collected after the previous rotation in the above step S304:
[0082] If the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by a preset angle so that the test strip test pen is located at the target position.
[0083] Optionally, if the width of the target line in the current image is smaller than the width of the target line in the previous image, it means that the current rotation direction of the test strip test pen is away from the target position. Therefore, the test strip test pen is controlled to rotate a preset angle in the opposite direction of the preset direction so that the test strip test pen is located at the target position.
[0084] As an optional implementation, since the width of the target line in the current image is smaller than the width of the target line in the previous image, which is a direction away from the target position, the rotation speed can be accelerated, that is, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by a preset multiple of the preset angle, so that the test strip test pen quickly approaches the target position, thereby improving the test strip image acquisition efficiency.
[0085] In this embodiment, if the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate a preset angle in the opposite direction of the preset direction, so that the test strip can be rotated to a position perpendicular to the image acquisition device, so that the image acquisition device can capture a complete and clear image of the test strip.
[0086] If the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue to rotate along the preset direction by a preset angle, and the width of the target line in the new current image is re-acquired, and the width of the target line in the new current image and the width of the target line in the new previous image are judged, and the execution is repeated until the width of the target line in the current image is less than the width of the target line in the previous image.
[0087] Among them, if the width of the target line in the current image is greater than the width of the target line in the previous image, the preset direction of the current rotation of the test strip test pen is the direction close to the target position. At this time, the test strip test pen continues to be controlled to continue to rotate along the preset direction at a preset angle, and judges according to the above width until the width of the target line in the current image is less than the width of the target line in the previous image. At this time, the position of the test strip test pen before the current rotation is the target position. At this time, it is only necessary to rotate the test strip test pen once in the opposite direction of the preset direction according to the preset angle to make the test strip in the test strip test pen perpendicular to the image acquisition device.
[0088] From the above analysis, it can be seen that the smaller the preset angle, the lower the image acquisition efficiency, but the test strip test pen can be completely perpendicular to the image acquisition device, or even completely perpendicular. The larger the preset angle, although the image acquisition efficiency will be improved accordingly, the test strip test pen may not be able to be fully rotated to the position where the test strip is perpendicular to the image acquisition device.
[0089] In this embodiment, when the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue rotating in a preset direction and at a preset angle until the width of the target line in the current image is less than the width of the target line in the previous image, thereby finding the position where the test strip test pen just exceeds the target position during the rotation process, and then rotating in the opposite direction based on the current position to obtain the test strip image.
[0090] As an optional implementation, if at least two test strips are inserted into the test strip test pen, and the target line is a line that exists in all the test strips in the test strip test pen and has the same width, such as the upper edge of the label mentioned above, the test strip inserted in the test strip test pen can also be made perpendicular to the image acquisition device in the following manner: control the test strip test pen to rotate in sequence according to a preset angle and a preset direction, and obtain the current image of the test strip test pen collected by the image acquisition device after the test strip test pen rotates this time. Analyze the current image to determine whether there is a target line in the current image. If so, determine the width of the target line, and determine whether the width of the target line in the current image is greater than the width of the target line in the previous image collected after the previous rotation. If so, store the width of the target line in the current image as the maximum width information in the memory, and continue to rotate according to the preset angle and preset direction, and the maximum width information is continuously updated. If not, continue to rotate according to the preset angle and preset direction until the width of the target line in the new current image is greater than the width of the target line in the new previous image. Then, store the width of the target line in the current image in the maximum width and continuously update the maximum width information. During the above rotation process, the maximum width of the target line is obtained through the rotation process of the test strip test pen. Next, rotate the test strip test pen and capture the image of the test strip test pen to determine whether the width of the target line in the image is equal to the maximum width. If so, the current position of the test strip test pen is the target position, that is, the position where the test strip is perpendicular to the image acquisition device. At this time, perform image acquisition on the test strip in the test strip test pen to obtain a clear and complete image of the test strip.
[0091] Next, the situation in which there is no target line in step 303, i.e., when determining whether there is a target line in the current image, is described as follows:
[0092] Optionally, if the target line does not exist in the current image, the test pen of the test strip is controlled to rotate according to the width of the target line in the previous image.
[0093] If the target line does not exist in the current image, it means that the test strip is not fixed on the test strip test pen, or the test strip is not facing the image acquisition device. Figure 2 As shown, if the test strip test pen is rotated to a certain angle, at which the edge of the test strip fixing device faces the image acquisition device, the target line does not exist in the current image captured by the image acquisition device. At this time, the test strip test pen is controlled to rotate so that the image acquisition device can capture an image with the target line. If it still cannot be captured, it means that the test strip is not fixed on the test strip test pen.
[0094] In this embodiment, the rotation of the test strip test pen is controlled according to the width of the target line in the previous image, thereby determining whether there is a test strip in the test strip test pen.
[0095] Further, if the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 is less than the preset number, the test strip test pen is controlled to rotate a first target angle along a preset direction, and the first target angle is greater than the preset angle.
[0096] If the width of the target line in the previous image is 0, it means that the image acquisition device has not yet acquired an image with the target line.
[0097] Optionally, when the number of rotations corresponding to the width of the target line in the current image being 0 is less than a preset number, the target line of the current image collected continues to be found by rotating the test strip test pen. Specifically, the test strip test pen is controlled to rotate a first target angle along a preset direction. The first target angle is greater than the preset angle, so that it can be quickly determined whether the test strip test pen is inserted into the test strip.
[0098] Exemplarily, the preset angle may be 0.5 degrees or 1 degree, and the first target angle may be 30 degrees or 60 degrees.
[0099] As an optional implementation, the product of the preset number of times and the first target angle can be 360 degrees, so that the test strip test pen rotates 1 circle and collects images to determine whether the test strip exists. Exemplarily, when the preset number of times is 6 times, the first target angle can be set to 60 degrees, so as to quickly determine whether the test strip test pen is inserted into the test strip.
[0100] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches a preset number, a prompt message is output, and the prompt message is used to prompt that the test strip is not detected.
[0101] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches the preset number, it means that the test strip is not inserted into the test strip test pen. Therefore, a prompt message indicating that the test strip is not detected is output.
[0102] In this embodiment, if the width of the target line in the previous image is 0, the test strip test pen is rotated the number of times corresponding to the width of 0, or a prompt message is output to quickly find the test strip in the test strip test pen and start image acquisition, or a prompt message is output that the test strip is not detected, thereby improving the processing efficiency of image acquisition.
[0103] As an optional implementation, if there is no target line in the current image, if the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate a second target angle in the opposite direction of the preset direction, and the second target angle is greater than the preset angle.
[0104] It should be understood that this situation is that there is a test strip in the test strip test pen, but the image captured by the image acquisition device happens to have no target line. At this time, it means that the rotation direction of the test strip test pen is far from the target position of the test strip test pen, so it is necessary to control the test strip test pen to rotate in the opposite direction of the preset direction to a second target angle. Among them, the second target angle is greater than the preset angle, so that the test strip test pen rotates back to the target position at a faster speed, thereby improving the image acquisition efficiency.
[0105] In this embodiment, when there is no target line in the current image and the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate in the opposite direction of the preset direction to a second target angle greater than the preset angle, thereby quickly capturing an image with the target line.
[0106] As an optional implementation, Figure 4 is a flow chart of another test strip image acquisition method provided in an embodiment of the present application. Figure 4 The test strip image acquisition method is generally introduced as follows: the test pen control device obtains the current image of the test strip test pen acquired by the image acquisition device after the test strip test pen rotates this time, performs image analysis on the current image, determines whether there is a target line in the current image, and if there is a target line, determines the width of the target line, and determines whether the width of the target line in the current image is less than the width of the target line in the previous image. If less than, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by a preset angle, so that the test strip test pen is located at the target position. If greater than, the test strip test pen is controlled to continue to rotate in the preset direction by a preset angle until the width of the target line in the current image is less than the width of the target line in the previous image.
[0107] If the target line does not exist in the current image, determine whether the width of the target line in the previous image is 0. If it is 0, determine whether the number of rotations corresponding to the width of 0 is less than the preset number. If so, control the test strip test pen to rotate the first target angle along the preset direction. If the number of rotations corresponding to the width of 0 reaches the preset number, output a prompt message for prompting that the test strip is not detected. If the width of the target line in the previous image is greater than 0, control the test strip test pen to rotate the second target angle in the opposite direction of the preset direction. Until the test strip test pen is rotated to the target position, the image acquisition device can capture a clear and complete image of the test strip.
[0108] As an optional implementation, Figure 5 As shown, the test strip test system also includes: a driving device, one end of the driving device is connected to the test pen control device, and the other end of the driving device is connected to the test strip test pen.
[0109] In the above steps, the specific implementation method of controlling the test strip test pen to rotate in sequence according to the preset angle and the preset direction can be as follows:
[0110] Optionally, control instructions are sent to the driving device in sequence, so that the driving device controls the test strip test pen to rotate in sequence according to a preset angle and a preset direction according to the control instructions, wherein the control instructions are used to indicate the preset angle and the preset direction.
[0111] The driving device of this embodiment rotates the test strip test pen, thereby rotating the test strip test pen to a target position, so that the test strip image captured by the image capture device is clear and complete.
[0112] Based on the same inventive concept, the present application also provides a test strip image acquisition device corresponding to the test strip image acquisition method. Since the principle of solving the problem by the device in the present application is similar to the test strip image acquisition method in the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated. Figure 6 , which is a schematic diagram of the structure of a test strip image acquisition device provided in an embodiment of the present application, the device comprises: a control module 601, an acquisition module 602, a determination module 603 and an acquisition module 604, wherein:
[0113] The control module 601 is used to control the test strip test pen to rotate in sequence according to a preset angle and a preset direction;
[0114] An acquisition module 602 is used to acquire a current image of the test strip test pen acquired by the image acquisition device after the test strip test pen rotates this time;
[0115] A determination module 603 is used to perform image analysis on the current image to determine whether there is a target line in the current image;
[0116] The acquisition module 604 is used to determine the width of the target line, and control the test strip test pen to rotate to the target position according to the width of the target line in the current image and the width of the target line in the previous image acquired after the previous rotation, and control the image acquisition device to acquire the test strip image, wherein, when the test strip test pen rotates to the target position, the test strip inserted in the test strip test pen is perpendicular to the image acquisition device.
[0117] Optionally, the acquisition module 604 is specifically used for:
[0118] If the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by the preset angle so that the test strip test pen is located at the target position.
[0119] Optionally, the acquisition module 604 is specifically used for:
[0120] If the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue to rotate along the preset direction by the preset angle, and the width of the target line in the new current image is reacquired, and the width of the target line in the new current image and the width of the target line in the new previous image are judged, and the execution is repeated until the width of the target line in the current image is less than the width of the target line in the previous image.
[0121] Optionally, the determining module 603 is further configured to:
[0122] If the target line does not exist in the current image, the test pen of the test strip is controlled to rotate according to the width of the target line in the previous image.
[0123] Optionally, the determining module 603 is specifically configured to:
[0124] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 is less than the preset number, the test strip test pen is controlled to rotate along the preset direction by a first target angle, and the first target angle is greater than the preset angle;
[0125] If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches a preset number, a prompt message is output, and the prompt message is used to prompt that the test strip is not detected.
[0126] Optionally, the determining module 603 is specifically configured to:
[0127] If the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate in the opposite direction of the preset direction to a second target angle, and the second target angle is greater than the preset angle.
[0128] Optionally, the test strip test system further comprises: a driving device, one end of which is connected to the test pen control device, and the other end of which is connected to the test strip test pen;
[0129] Optionally, the control module 601 is specifically used for:
[0130] Control instructions are sent to the driving device in sequence, so that the driving device controls the test paper strip test pen to rotate in sequence according to a preset angle and a preset direction according to the control instructions, wherein the control instructions are used to indicate the preset angle and the preset direction.
[0131] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0132] The present application also provides a test pen control device, such as Figure 7 , which is a schematic diagram of the structure of the test pen control device provided in the embodiment of the present application, includes: a processor 701, a memory 702 and a bus. The memory 702 stores machine-readable instructions executable by the processor 701 (for example, Figure 6 The machine-readable instructions correspond to the control module 601, the acquisition module 602, the determination module 603 and the acquisition module 604 in the device, etc.), when the test pen control device is running, the processor 701 communicates with the memory 702 through the bus, and when the machine-readable instructions are executed by the processor 701, the above-mentioned test strip image acquisition method is executed.
[0133] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned test strip image acquisition method are executed.
[0134] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0135] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or 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 several 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, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0136] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A test strip image acquisition method, characterized in that: A test pen control device applied to a test strip test system, the test strip test system comprising: a test strip test pen, the test pen control device and an image acquisition device, the test pen control device being respectively connected to the test strip test pen and the image acquisition device for communication, the test strip test pen being used to insert a test strip, the method comprising: Control the test strip test pen to rotate in sequence according to a preset angle and a preset direction; Acquire a current image of the test strip test pen captured by the image acquisition device after the test strip test pen rotates this time; Performing image analysis on the current image to determine whether there is a target line in the current image; If so, determine the width of the target line, and control the test strip test pen to rotate to the target position based on the width of the target line in the current image and the width of the target line in the previous image captured after the previous rotation, and control the image acquisition device to capture the test strip image, wherein, when the test strip test pen rotates to the target position, the test strip inserted in the test strip test pen is perpendicular to the image acquisition device.
2. The test strip image acquisition method according to claim 1, characterized in that: The step of controlling the test strip test pen to rotate to a target position according to the width of the target line in the current image and the width of the target line in the previous image acquired after the previous rotation comprises: If the width of the target line in the current image is smaller than the width of the target line in the previous image, the test strip test pen is controlled to rotate in the opposite direction of the preset direction by the preset angle so that the test strip test pen is located at the target position.
3. The test strip image acquisition method according to claim 1, characterized in that: The step of controlling the test strip test pen to rotate to a target position according to the width of the target line in the current image and the width of the target line in the previous image acquired after the previous rotation comprises: If the width of the target line in the current image is greater than the width of the target line in the previous image, the test strip test pen is controlled to continue to rotate along the preset direction by the preset angle, and the width of the target line in the new current image is reacquired, and the width of the target line in the new current image and the width of the target line in the new previous image are judged, and the execution is repeated until the width of the target line in the current image is less than the width of the target line in the previous image.
4. The test strip image acquisition method according to claim 1, characterized in that: After determining whether there is a target line in the current image, the method further includes: If the target line does not exist in the current image, the test pen of the test strip is controlled to rotate according to the width of the target line in the previous image.
5. The test strip image acquisition method according to claim 4, characterized in that: The step of controlling the test pen on the test strip to rotate according to the width of the target line in the previous image includes: If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 is less than the preset number, the test strip test pen is controlled to rotate along the preset direction by a first target angle, and the first target angle is greater than the preset angle; If the width of the target line in the previous image is 0, and the number of rotations corresponding to the width of 0 reaches a preset number, a prompt message is output, and the prompt message is used to prompt that the test strip is not detected.
6. The test strip image acquisition method according to claim 4, characterized in that: The step of controlling the test pen on the test strip to rotate according to the width of the target line in the previous image includes: If the width of the target line in the previous image is greater than 0, the test strip test pen is controlled to rotate in the opposite direction of the preset direction to a second target angle, and the second target angle is greater than the preset angle.
7. The test strip image acquisition method according to any one of claims 1 to 6, characterized in that: The test strip test system further comprises: a driving device, one end of which is connected to the test pen control device, and the other end of which is connected to the test strip test pen; The controlling the test strip test pen to rotate sequentially according to a preset angle and a preset direction comprises: Control instructions are sent to the driving device in sequence, so that the driving device controls the test paper strip test pen to rotate in sequence according to a preset angle and a preset direction according to the control instructions, wherein the control instructions are used to indicate the preset angle and the preset direction.
8. A test strip testing system, characterized in that: The test strip test system includes: a test strip test pen, the test pen control device and an image acquisition device, the test pen control device is respectively communicated with the test strip test pen and the image acquisition device, the test strip test pen is used to insert a test strip, and the test pen control device is used to execute the steps of the test strip image acquisition method as described in any one of claims 1-7.
9. A test pen control device, characterized in that: The test pen control device comprises: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the test pen control device is running, the processor executes the machine-readable instructions to perform the steps of the test strip image acquisition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the test strip image acquisition method according to any one of claims 1 to 7 are executed.
