Counting method and device of photoelectric seed sensor, electronic equipment and medium
By acquiring and updating the reference threshold voltage and pulse width reference range of the photoelectric seed sensor, the problem of low accuracy in small seed counting is solved, and accurate counting of various types of seeds is achieved.
Patent Information
- Application Number
- CN202411286720.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-31
AI Technical Summary
When facing small seeds such as sorghum, the counting accuracy is low, making it difficult to accurately detect and count.
By obtaining the reference threshold voltage and pulse width reference range of the target seed type, it is determined whether the pulses in the voltage signal meet the threshold and width range, and then accurately count the seed number. The method includes an updating mechanism for determining a reference threshold voltage and a pulse width reference range, and adjusting according to the voltage signal and pulse width difference relationship of the sample seed.
Improves the counting accuracy of small seeds, ensuring accurate detection and counting of various types of seeds.
Smart Images

Figure CN119227719A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural engineering technology, and in particular to a counting method, device, electronic equipment and medium of a photoelectric seed sensor. Background Art
[0002] Photoelectric seed sensor is an important device in modern agriculture, used to detect and count seeds. The core principle of this sensor is to use photoelectric detection technology to determine the number of seeds by detecting changes in photoelectric signals.
[0003] However, this technology has the problem of low counting accuracy when dealing with small-grain seeds such as sorghum. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a counting method, device, electronic equipment and medium for a photoelectric seed sensor, which can count various types of seeds and improve the counting accuracy of small-grain seeds.
[0005] In a first aspect, an embodiment of the present application provides a counting method of a photoelectric seed sensor, and the counting method of the photoelectric seed sensor includes:
[0006] Obtaining a reference threshold voltage corresponding to the target seed type and the latest pulse width reference range, as well as a voltage signal corresponding to the target seed type currently collected by the photoelectric seed sensor; the pulse width reference range is updated based on the target pulse width of the target seeds corresponding to the target seed type and the latest collected preset number;
[0007] Determine whether the voltage peak value of the pulse in the voltage signal is greater than or equal to a reference threshold voltage;
[0008] If the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, then determining whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within a pulse width reference range;
[0009] If the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one.
[0010] In a possible implementation manner, the pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value, and the pulse width reference range is updated by the following steps, including:
[0011] Obtaining the target pulse width of a preset number of target seeds corresponding to the target seed type that have been recently collected;
[0012] The maximum pulse width reference value or the minimum pulse width reference value is updated according to a first difference between each target pulse width and a maximum pulse width reference value and a second difference between each target pulse width and a minimum pulse width reference value.
[0013] In a possible implementation, updating the maximum pulse width reference value or the minimum pulse width reference value according to a first difference between each target pulse width and a maximum pulse width reference value, and a second difference between each target pulse width and a minimum pulse width reference value, includes:
[0014] Counting the number of target pulse widths whose first difference is smaller than the second difference to obtain a first number;
[0015] Counting the number of target pulse widths whose first difference is greater than the second difference to obtain a second number;
[0016] According to the numerical relationship between the first quantity and the second quantity, the pulse width maximum reference value or the pulse width minimum reference value is updated according to all target pulse widths.
[0017] In a possible implementation, according to the numerical relationship between the first quantity and the second quantity, the maximum pulse width reference value or the minimum pulse width reference value is updated according to all target pulse widths:
[0018] If the first number is greater than the second number, updating the pulse width maximum reference value according to all target pulse widths whose first difference is less than the second difference;
[0019] If the first number is smaller than the second number, the minimum pulse width reference value is updated according to all target pulse widths whose first difference is larger than the second difference.
[0020] In a possible implementation, before counting the seeds corresponding to the target seed type by using the photoelectric seed sensor, the reference threshold voltage corresponding to the target seed type is determined by the following steps:
[0021] Acquire a voltage signal of a sample seed corresponding to a target seed type acquired by an oscilloscope;
[0022] The reference threshold voltage is determined according to the voltage peak values of all pulses in the voltage signals of all sample seeds.
[0023] In a possible implementation, before counting the seeds corresponding to the target seed type by using the photoelectric seed sensor, the method further includes:
[0024] Determine the maximum value of the pulse widths of all pulses in the voltage signals of all sample seeds whose voltage values are greater than or equal to the reference threshold voltage as the maximum reference value of the pulse width in the first pulse width reference range;
[0025] The minimum value of the pulse width whose voltage value is greater than or equal to the reference threshold voltage among all the pulses in the voltage signal of all the sample seeds is determined as the minimum reference value of the pulse width in the first pulse width reference range.
[0026] In a second aspect, an embodiment of the present application further provides a counting device of a photoelectric seed sensor, the counting device of the photoelectric seed sensor comprising:
[0027] An acquisition module is used to acquire a reference threshold voltage and a latest pulse width reference range corresponding to the target seed type, and a voltage signal corresponding to the target seed type currently collected by the photoelectric seed sensor; the pulse width reference range is updated based on the target pulse width of a preset number of target seeds corresponding to the target seed type collected the latest;
[0028] A judgment module, used to judge whether the voltage peak value of the pulse in the voltage signal is greater than or equal to a reference threshold voltage;
[0029] The judging module is further used to judge whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range if the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage;
[0030] The statistical module is used to add one to the number of seeds corresponding to the target seed type if the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range.
[0031] In a possible implementation, the pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value, and the device further includes: an updating module;
[0032] The acquisition module is also used to acquire the target pulse width of the target seeds corresponding to the target seed type of the preset number of the most recently collected target seeds;
[0033] The updating module is used to update the maximum pulse width reference value or the minimum pulse width reference value according to the first difference between each target pulse width and the maximum pulse width reference value and the second difference between each target pulse width and the minimum pulse width reference value.
[0034] In one possible implementation, the update module is specifically used to count the number of target pulse widths whose first difference is less than the second difference to obtain a first number; count the number of target pulse widths whose first difference is greater than the second difference to obtain a second number; and update the maximum pulse width reference value or the minimum pulse width reference value according to all target pulse widths based on the numerical relationship between the first number and the second number.
[0035] In one possible implementation, the update module is specifically used to update the maximum pulse width reference value according to the target pulse width where all first differences are smaller than the second difference if the first number is greater than the second number; and to update the minimum pulse width reference value according to the target pulse width where all first differences are larger than the second difference if the first number is less than the second number.
[0036] In a possible implementation manner, the device further includes: a determination module; the determination module is configured to:
[0037] Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the voltage signal of the sample seeds corresponding to the target seed type collected by the oscilloscope is obtained; and the reference threshold voltage is determined according to the voltage peak values of all pulses in the voltage signals of all sample seeds.
[0038] In a possible implementation manner, the determination module is further configured to:
[0039] Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the method further includes:
[0040] Determine the maximum value of the pulse widths of all pulses in the voltage signals of all sample seeds whose voltage values are greater than or equal to the reference threshold voltage as the maximum reference value of the pulse width in the first pulse width reference range;
[0041] The minimum value of the pulse width whose voltage value is greater than or equal to the reference threshold voltage among all the pulses in the voltage signals of all the sample seeds is determined as the minimum reference value of the pulse width in the first pulse width reference range.
[0042] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the counting method of the photoelectric seed sensor as described in any one of the first aspects.
[0043] In a fourth aspect, 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 counting method of the photoelectric seed sensor as described in any one of the first aspects are executed.
[0044] The embodiments of the present application provide a counting method, device, electronic device and medium of a photoelectric seed sensor, which obtains a reference threshold voltage and the latest pulse width reference range corresponding to the target seed type, as well as a voltage signal corresponding to the target seed type currently collected by the photoelectric seed sensor; determines whether the voltage peak of the pulse in the voltage signal is greater than or equal to the reference threshold voltage; if the voltage peak of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, determines whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range; if the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one. The present application counts various types of seeds by referring to the threshold voltage and the pulse width reference range, thereby improving the counting accuracy of small-grain seeds. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] 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.
[0046] Figure 1 A flow chart of a counting method of a photoelectric seed sensor provided in an embodiment of the present application is shown;
[0047] Figure 2 A schematic diagram of a voltage signal provided by an embodiment of the present application is shown;
[0048] Figure 3 A flow chart showing another counting method of a photoelectric seed sensor provided in an embodiment of the present application is shown;
[0049] Figure 4 A schematic structural diagram of a counting device of a photoelectric seed sensor provided in an embodiment of the present application is shown;
[0050] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] 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.
[0052] 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.
[0053] In order to enable those skilled in the art to use the content of this application, the following implementation is provided in conjunction with the specific application scenario "agricultural engineering technology field". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "agricultural engineering technology field", it should be understood that this is only an exemplary embodiment.
[0054] 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.
[0055] A counting method of a photoelectric seed sensor provided in an embodiment of the present application is described in detail below.
[0056] Reference Figure 1 As shown, it is a flow chart of a counting method of a photoelectric seed sensor provided in an embodiment of the present application. The specific execution process of the counting method of the photoelectric seed sensor is as follows:
[0057] S101, obtaining a reference threshold voltage and a latest pulse width reference range corresponding to a target seed type, and a voltage signal corresponding to the target seed type currently collected by a photoelectric seed sensor.
[0058] S102: Determine whether the voltage peak value of the pulse in the voltage signal is greater than or equal to a reference threshold voltage.
[0059] S103 . If the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, determine whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within a pulse width reference range.
[0060] S104: If the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one.
[0061] The embodiment of the present application provides a counting method of a photoelectric seed sensor, which obtains a reference threshold voltage and the latest pulse width reference range corresponding to the target seed type, as well as a voltage signal corresponding to the target seed type currently collected by the photoelectric seed sensor; determines whether the voltage peak of the pulse in the voltage signal is greater than or equal to the reference threshold voltage; if the voltage peak of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, determines whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range; if the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one. The present application counts various types of seeds by referring to the threshold voltage and the pulse width reference range, thereby improving the counting accuracy of small-grain seeds.
[0062] The following is a description of the exemplary steps of the present application embodiment:
[0063] S101, obtaining a reference threshold voltage and a latest pulse width reference range corresponding to a target seed type, and a voltage signal corresponding to the target seed type currently collected by a photoelectric seed sensor.
[0064] In the implementation mode of the present application, the target seed type refers to the seed type that the photoelectric seed sensor is currently counting, which may be sorghum, corn, etc. When the seed passes through the detection area of the photoelectric seed sensor, it will cause a change in the detection voltage, and the photoelectric seed sensor will collect the voltage signal of the seed corresponding to the target seed type. And set the corresponding reference threshold voltage and the latest pulse width reference range for the target seed type to determine whether the pulse in the voltage signal is caused by the seed corresponding to the target seed type, or by impurities other than the seed (such as stones, dust, etc.). One or more pulses may be included in a voltage signal within a period of time.
[0065] The pulse width reference range is updated based on the target pulse widths of the target seeds corresponding to the target seed type and the preset number of the most recently collected ones; the pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value.
[0066] Furthermore, before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the reference threshold voltage corresponding to the target seed type is determined by the following steps:
[0067] Step 1: Obtain the voltage signal of the sample seed corresponding to the target seed type collected by the oscilloscope.
[0068] In the implementation mode of the present application, an oscilloscope is a widely used electronic measuring instrument, which can transform invisible electrical signals into visible images, making it easier for people to study the changing process of various electrical phenomena. The voltage signal of the sample seed corresponding to the target seed type is collected by the oscilloscope, and the sample seed refers to the seed used to determine the reference threshold voltage corresponding to the target seed type.
[0069] For example, if the target seed type is sorghum, the voltage signals of multiple sample sorghum seeds are collected through an oscilloscope.
[0070] Step 2: Determine the reference threshold voltage according to the voltage peak values of all pulses in the voltage signals of all sample seeds.
[0071] In an embodiment of the present application, the average value of the voltage peaks of all pulses in the voltage signals of all sample seeds can be determined as the reference threshold voltage; the minimum value of the voltage peaks of all pulses in the voltage signals of all sample seeds can be determined as the reference threshold voltage.
[0072] Furthermore, before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the method further includes:
[0073] Step 1: Determine the maximum value of the pulse widths whose voltage values in all pulses in the voltage signals of all sample seeds are greater than or equal to the reference threshold voltage as the maximum pulse width reference value in the first pulse width reference range.
[0074] In an embodiment of the present application, a pulse includes a rising edge and a falling edge. The time point at which the voltage value in the falling edge is the reference threshold voltage is subtracted from the time point at which the voltage value in the rising edge is the reference threshold voltage to obtain the pulse width when the voltage value in the pulse is greater than or equal to the reference threshold voltage.
[0075] Reference Figure 2 As shown, it is a schematic diagram of the voltage signal provided in an embodiment of the present application; in this figure, the pulse width of the first pulse can be obtained by subtracting time point 1 from time 2.
[0076] Step 2: Determine the minimum value of the pulse width whose voltage value is greater than or equal to the reference threshold voltage among all pulses in the voltage signals of all sample seeds as the minimum reference value of the pulse width in the first pulse width reference range.
[0077] Furthermore, the pulse width reference range is updated by the following steps:
[0078] Step 1: Obtain the target pulse widths of the latest collected preset number of target seeds corresponding to the target seed type.
[0079] In the embodiment of the present application, when the number of seeds corresponding to the target seed type increases by a preset number, the target pulse width of the preset number of target seeds corresponding to the target seed type collected the most recently is obtained. The target pulse width refers to the pulse width of the voltage value in the pulse caused by the target seed being greater than or equal to the reference threshold voltage.
[0080] The target pulse width of the target seed is obtained by subtracting the time point when the voltage value of the falling edge of the pulse caused by the target seed is the reference threshold voltage from the time point when the voltage value of the rising edge of the pulse caused by the target seed is the reference threshold voltage.
[0081] Step 2: updating the maximum pulse width reference value or the minimum pulse width reference value according to the first difference between each target pulse width and the maximum pulse width reference value and the second difference between each target pulse width and the minimum pulse width reference value.
[0082] In an embodiment of the present application, the number of target pulse widths whose first difference is less than the second difference is counted to obtain a first number; the number of target pulse widths whose first difference is greater than the second difference is counted to obtain a second number; and based on the numerical relationship between the first number and the second number, the maximum reference value of the pulse width or the minimum reference value of the pulse width is updated based on all target pulse widths.
[0083] The first difference is obtained by subtracting the absolute value of the difference between the target pulse width and the maximum reference value of the pulse width, and the second difference is obtained by subtracting the absolute value of the difference between the target pulse width and the minimum reference value of the pulse width.
[0084] For example, if the target pulse width is 5 s and the maximum pulse width reference value is 8 s, then the first difference between the target pulse width and the maximum pulse width reference value is |5-8|=3 s.
[0085] Specifically, if the first number is greater than the second number, the pulse width maximum reference value is updated according to all target pulse widths whose first difference is less than the second difference.
[0086] In the embodiment of the present application, if the first number is greater than the second number, it means that there are more target pulse widths closer to the maximum reference value of the pulse width, so the maximum reference value of the pulse width is updated. The average value of all target pulse widths whose first difference is less than the second difference can be determined as the updated maximum reference value of the pulse width. It is also possible to perform a weighted summation on all target pulse widths whose first difference is less than the second difference to obtain the updated maximum reference value of the pulse width.
[0087] Specifically, if the first number is smaller than the second number, the minimum pulse width reference value is updated according to all target pulse widths whose first difference is larger than the second difference.
[0088] In the embodiment of the present application, if the first number is less than the second number, it means that there are more target pulse widths closer to the minimum reference value of the pulse width, so the minimum reference value of the pulse width is updated. The average value of all target pulse widths whose first difference is greater than the second difference can be determined as the updated minimum reference value of the pulse width. It is also possible to perform a weighted summation on all target pulse widths whose first difference is greater than the second difference to obtain the updated minimum reference value of the pulse width.
[0089] S102: Determine whether the voltage peak value of the pulse in the voltage signal is greater than or equal to a reference threshold voltage.
[0090] In the embodiment of the present application, whether the voltage signal is caused by a seed is determined by judging whether the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage. For each pulse in each voltage signal, it is judged whether the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage.
[0091] S103 . If the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, determine whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within a pulse width reference range.
[0092] In an embodiment of the present application, if the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, it means that the voltage signal may be caused by a seed, so it is further determined whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range.
[0093] S104: If the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one.
[0094] In an embodiment of the present application, if the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range, it means that the voltage signal is caused by the seed, so the number of seeds corresponding to the target seed type is increased by one.
[0095] Reference Figure 3 As shown, it is a flow chart of a counting method of a photoelectric seed sensor provided in an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0096] S301 : Obtain the target pulse widths of the preset number of target seeds corresponding to the target seed type that are collected most recently.
[0097] In the embodiment of the present application, when the number of seeds corresponding to the target seed type increases by a preset number, the target pulse width of the preset number of target seeds corresponding to the target seed type collected the most recently is obtained. The target pulse width refers to the pulse width of the voltage value in the pulse caused by the target seed being greater than or equal to the reference threshold voltage.
[0098] The target pulse width of the target seed is obtained by subtracting the time point when the voltage value of the falling edge of the pulse caused by the target seed is the reference threshold voltage from the time point when the voltage value of the rising edge of the pulse caused by the target seed is the reference threshold voltage.
[0099] S302 , updating the maximum pulse width reference value or the minimum pulse width reference value according to a first difference between each target pulse width and a maximum pulse width reference value and a second difference between each target pulse width and a minimum pulse width reference value.
[0100] In an embodiment of the present application, the number of target pulse widths whose first difference is less than the second difference is counted to obtain a first number; the number of target pulse widths whose first difference is greater than the second difference is counted to obtain a second number; and based on the numerical relationship between the first number and the second number, the maximum reference value of the pulse width or the minimum reference value of the pulse width is updated based on all target pulse widths.
[0101] The first difference is obtained by subtracting the absolute value of the difference between the target pulse width and the maximum reference value of the pulse width, and the second difference is obtained by subtracting the absolute value of the difference between the target pulse width and the minimum reference value of the pulse width.
[0102] For example, if the target pulse width is 5 s and the maximum pulse width reference value is 8 s, then the first difference between the target pulse width and the maximum pulse width reference value is |5-8|=3 s.
[0103] Specifically, if the first number is greater than the second number, the pulse width maximum reference value is updated according to all target pulse widths whose first difference is less than the second difference.
[0104] In the embodiment of the present application, if the first number is greater than the second number, it means that there are more target pulse widths closer to the maximum reference value of the pulse width, so the maximum reference value of the pulse width is updated. The average value of all target pulse widths whose first difference is less than the second difference can be determined as the updated maximum reference value of the pulse width. It is also possible to perform a weighted summation on all target pulse widths whose first difference is less than the second difference to obtain the updated maximum reference value of the pulse width.
[0105] Specifically, if the first number is smaller than the second number, the minimum pulse width reference value is updated according to all target pulse widths whose first difference is larger than the second difference.
[0106] In the embodiment of the present application, if the first number is less than the second number, it means that there are more target pulse widths closer to the minimum reference value of the pulse width, so the minimum reference value of the pulse width is updated. The average value of all target pulse widths whose first difference is greater than the second difference can be determined as the updated minimum reference value of the pulse width. It is also possible to perform a weighted summation on all target pulse widths whose first difference is greater than the second difference to obtain the updated minimum reference value of the pulse width.
[0107] Based on the same inventive concept, an information processing device corresponding to the counting method of the photoelectric seed sensor is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the counting method of the photoelectric seed sensor in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0108] Reference Figure 4 FIG. 1 is a schematic diagram of a counting device of a photoelectric seed sensor provided in an embodiment of the present application. The counting device of the photoelectric seed sensor includes:
[0109] The acquisition module 401 is used to acquire the reference threshold voltage and the latest pulse width reference range corresponding to the target seed type, and the voltage signal corresponding to the target seed type currently collected by the photoelectric seed sensor; the pulse width reference range is updated based on the target pulse width of the target seeds corresponding to the target seed type collected by the latest preset number;
[0110] A determination module 402 is used to determine whether a voltage peak value of a pulse in a voltage signal is greater than or equal to a reference threshold voltage;
[0111] The judgment module 402 is further used to judge whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range if the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage;
[0112] The statistical module 403 is used to add one to the number of seeds corresponding to the target seed type if the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range.
[0113] In a possible implementation, the pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value, and the device further includes: an updating module 404;
[0114] The acquisition module 401 is further used to acquire the target pulse widths of the target seeds corresponding to the target seed type and the preset number of the most recently collected ones;
[0115] The updating module 404 is used to update the maximum pulse width reference value or the minimum pulse width reference value according to the first difference between each target pulse width and the maximum pulse width reference value and the second difference between each target pulse width and the minimum pulse width reference value.
[0116] In one possible implementation, the update module 404 is specifically used to count the number of target pulse widths whose first difference is less than the second difference to obtain a first number; count the number of target pulse widths whose first difference is greater than the second difference to obtain a second number; and update the maximum pulse width reference value or the minimum pulse width reference value according to all target pulse widths based on the numerical relationship between the first number and the second number.
[0117] In one possible implementation, the update module 404 is specifically used to update the maximum pulse width reference value according to the target pulse width where all first differences are smaller than the second difference if the first number is greater than the second number; and to update the minimum pulse width reference value according to the target pulse width where all first differences are larger than the second difference if the first number is less than the second number.
[0118] In a possible implementation manner, the device further includes: a determination module 405; the determination module 405 is configured to:
[0119] Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the voltage signal of the sample seeds corresponding to the target seed type collected by the oscilloscope is obtained; and the reference threshold voltage is determined according to the voltage peak values of all pulses in the voltage signals of all sample seeds.
[0120] In a possible implementation, the determination module 405 is further configured to:
[0121] Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the method further includes:
[0122] Determine the maximum value of the pulse widths of all pulses in the voltage signals of all sample seeds whose voltage values are greater than or equal to the reference threshold voltage as the maximum reference value of the pulse width in the first pulse width reference range;
[0123] The minimum value of the pulse width whose voltage value is greater than or equal to the reference threshold voltage among all the pulses in the voltage signals of all the sample seeds is determined as the minimum reference value of the pulse width in the first pulse width reference range.
[0124] The present application provides a counting device of a photoelectric seed sensor, wherein an acquisition module 401 is used to acquire a reference threshold voltage and a latest pulse width reference range corresponding to a target seed type, and a voltage signal corresponding to a target seed type currently collected by the photoelectric seed sensor; the pulse width reference range is updated based on a target pulse width of a preset number of target seeds corresponding to the target seed type collected the latest; a judgment module 402 is used to judge whether a voltage peak value of a pulse in a voltage signal is greater than or equal to a reference threshold voltage; the judgment module 402 is also used to judge whether a pulse width in which a voltage value in a pulse is greater than or equal to a reference threshold voltage is within a pulse width reference range if a voltage peak value of a pulse in a voltage signal is greater than or equal to a reference threshold voltage; a statistics module 403 is used to add one to the number of seeds corresponding to the target seed type if a pulse width in which a voltage value in a pulse is greater than or equal to a reference threshold voltage is within a pulse width reference range. The present application counts various types of seeds by referring to the threshold voltage and the pulse width reference range, thereby improving the counting accuracy of small-grain seeds.
[0125] like Figure 5 As shown, an electronic device 500 provided in an embodiment of the present application includes: a processor 501, a memory 502 and a bus, the memory 502 stores machine-readable instructions executable by the processor 501, when the electronic device is running, the processor 501 and the memory 502 communicate through the bus, and the processor 501 executes the machine-readable instructions to perform the steps of the counting method of the above-mentioned photoelectric seed sensor.
[0126] Specifically, the memory 502 and the processor 501 can be general-purpose memories and processors, which are not specifically limited here. When the processor 501 runs the computer program stored in the memory 502, the counting method of the photoelectric seed sensor can be executed.
[0127] Corresponding to the counting method of the above-mentioned photoelectric seed sensor, an embodiment of the present application also 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 counting method of the above-mentioned photoelectric seed sensor are executed.
[0128] 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.
[0129] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0131] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0132] The above are only specific implementations 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 included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A counting method for a photoelectric seed sensor, characterized in that: The counting method of the photoelectric seed sensor includes: Obtaining a reference threshold voltage and a latest pulse width reference range corresponding to a target seed type, and a voltage signal corresponding to the target seed type currently collected by a photoelectric seed sensor; the pulse width reference range is updated based on a target pulse width of a preset number of target seeds corresponding to the target seed type collected most recently; Determining whether a voltage peak value of a pulse in the voltage signal is greater than or equal to the reference threshold voltage; If the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage, determining whether the pulse width of the pulse whose voltage value is greater than or equal to the reference threshold voltage is within the pulse width reference range; If the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range, the number of seeds corresponding to the target seed type is increased by one.
2. The counting method of the photoelectric seed sensor according to claim 1, characterized in that: The pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value. The pulse width reference range is updated by the following steps, including: Obtaining the target pulse widths of a preset number of target seeds corresponding to the target seed type that have been recently collected; The maximum pulse width reference value or the minimum pulse width reference value is updated according to a first difference between each of the target pulse widths and the maximum pulse width reference value and a second difference between each of the target pulse widths and the minimum pulse width reference value.
3. The counting method of the photoelectric seed sensor according to claim 2, characterized in that: The updating of the maximum pulse width reference value or the minimum pulse width reference value according to a first difference between each of the target pulse widths and the maximum pulse width reference value and a second difference between each of the target pulse widths and the minimum pulse width reference value comprises: Counting the number of target pulse widths whose first difference is smaller than the second difference to obtain a first number; Counting the number of target pulse widths whose first difference is greater than the second difference to obtain a second number; According to the numerical relationship between the first number and the second number, the pulse width maximum reference value or the pulse width minimum reference value is updated according to all target pulse widths.
4. The counting method of the photoelectric seed sensor according to claim 3, characterized in that: According to the numerical relationship between the first quantity and the second quantity, the pulse width maximum reference value or the pulse width minimum reference value is updated according to all target pulse widths: If the first number is greater than the second number, updating the pulse width maximum reference value according to all target pulse widths whose first difference is less than the second difference; If the first number is smaller than the second number, the pulse width minimum reference value is updated according to all target pulse widths whose first difference is larger than the second difference.
5. The counting method of the photoelectric seed sensor according to any one of claims 1 to 4, characterized in that: Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the reference threshold voltage corresponding to the target seed type is determined by the following steps: Acquire a voltage signal of a sample seed corresponding to the target seed type collected by an oscilloscope; The reference threshold voltage is determined according to the voltage peak values of all pulses in the voltage signals of all the sample seeds.
6. The counting method of the photoelectric seed sensor according to claim 5, characterized in that: Before counting the seeds corresponding to the target seed type by the photoelectric seed sensor, the method further includes: Determine the maximum value of the pulse widths of all pulses in the voltage signals of all the sample seeds whose voltage values are greater than or equal to the reference threshold voltage as the maximum reference value of the pulse width in the first pulse width reference range; The minimum value of the pulse width whose voltage value in all pulses in the voltage signal of all the sample seeds is greater than or equal to the reference threshold voltage is determined as the minimum pulse width reference value in the first pulse width reference range.
7. A counting device for a photoelectric seed sensor, characterized in that: The counting device of the photoelectric seed sensor comprises: An acquisition module, used to acquire a reference threshold voltage and a latest pulse width reference range corresponding to a target seed type, and a voltage signal corresponding to the target seed type currently collected by a photoelectric seed sensor; the pulse width reference range is updated based on a target pulse width of a preset number of target seeds corresponding to the target seed type collected most recently; A judging module, used to judge whether the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage; The judgment module is further configured to judge whether a pulse width in which the voltage value of the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range if the voltage peak value of the pulse in the voltage signal is greater than or equal to the reference threshold voltage; A statistical module is used to add one to the number of seeds corresponding to the target seed type if the pulse width in which the voltage value in the pulse is greater than or equal to the reference threshold voltage is within the pulse width reference range.
8. The counting device of the photoelectric seed sensor according to claim 7, characterized in that: The pulse width reference range includes a maximum pulse width reference value and a minimum pulse width reference value, and the device further includes: an updating module; The acquisition module is further used to acquire the target pulse widths of the target seeds corresponding to the target seed type of the preset number of the most recently collected target seeds; The updating module is used to update the maximum pulse width reference value or the minimum pulse width reference value according to a first difference between each target pulse width and the maximum pulse width reference value and a second difference between each target pulse width and the minimum pulse width reference value.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the counting method of the photoelectric seed sensor as described in any one of claims 1 to 6.
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 counting method of the photoelectric seed sensor according to any one of claims 1 to 6 are executed.
