Detection method and detection system for grain unloading of granary
Patent Information
- Application Number
- CN202411556112.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-21
AI Technical Summary
The fullness detection of the corn harvester's granary is difficult to accurately identify, resulting in missing observation by the machine and causing food loss. Traditional photoelectric detection devices are costly, complex in structure, and are susceptible to ambient light, resulting in false alarms and missed alarms.
Granary images are taken in real time through the camera, and image processing technology is used to calculate the accumulated grayscale value and change rate to judge the fullness status of the granary. When the accumulated grayscale value reaches the threshold and lasts for a certain period of time, the alarm is triggered.
It improves the accuracy of full alarms in the cabin, reduces the situation of missing and false alarms, avoids food overflow and waste, and reduces system costs and complexity.
Smart Images

Figure CN119495056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of agricultural machinery, and in particular to a detection method and a detection system for grain unloading in a granary. Background Art
[0002] At present, when a corn harvester harvests grains, the granary is at the rear. Even if some cabs are equipped with video surveillance, human observation is required. Therefore, it is difficult for the operator to detect in time when the granary is full, and there will always be times when it is forgotten.
[0003] Since corn is different from other grains such as wheat and rice, the grain full sensors of traditional wheat harvesters and rice harvesters cannot be used for corn silo detection. To solve this problem, in addition to installing silo monitoring cameras, photoelectric detection has also appeared on the market: a photoelectric transceiver is installed on the upper part of the silo, and light passes across the silo. When corn cobs are piled up to the full grain alarm position, the light is blocked by the corn cobs. The photoelectric transceiver detects this signal and sends out a warning signal in time to prompt the operator to unload the grain in time.
[0004] However, the operator may easily miss the camera, which may cause food loss. Since the corn cobs are piled in the granary in a scattered and random manner with gaps in the middle, it is easy for the detection light to be transmitted directly to the receiving end through the gaps. The system will not be able to detect the full grain signal, resulting in huge losses. In addition, the photoelectric detection device is expensive and has a complex structure. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a method and system for detecting grain unloading in a granary to overcome at least one of the above-mentioned defects.
[0006] In the first aspect, an embodiment of the present application provides a method for detecting grain unloading in a granary, and whenever a granary image is received, the following processing steps are performed: determining the cumulative grayscale value of the granary image, wherein the granary image is an image including a preset position of the granary, and the preset position of the granary indicates the position of the paint sprayed on the inner wall of the granary; judging whether the cumulative grayscale value is less than a grayscale threshold, wherein the cumulative grayscale value is determined based on the grayscale value of the granary image at a current moment and the grayscale value of the granary image at a historical moment; if the cumulative grayscale value is less than the grayscale threshold, then it is determined that the granary is in a not full state; if the cumulative grayscale value is not less than the grayscale threshold, then it is determined that the granary is in a state of about to be full, and the duration of the granary being in the state of about to be full is counted to judge whether the duration reaches the time threshold; if the duration reaches the time threshold, a full cabin alarm is triggered.
[0007] In an optional embodiment of the present application, before determining the cumulative grayscale value of the granary image, it includes: calculating the rate of change of the grayscale value of the granary image according to the grayscale value of the granary image at the current moment, the rate of change being used to indicate the change between the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the previous moment; judging whether the rate of change corresponding to the grayscale value of the granary image at the current moment is greater than a rate of change threshold; if the rate of change is not greater than the rate of change threshold, it indicates that the granary image is not affected by the ambient light, and determining the cumulative grayscale value of the granary image; if the rate of change is greater than the rate of change threshold, reacquiring the granary image at the next moment.
[0008] In an optional embodiment of the present application, the cumulative grayscale value of each granary image is determined in the following manner: obtaining the grayscale values of all historical granary images and the number of images of all historical granary images, wherein all historical granary images refer to all granary images received from the camera before the current moment; calculating the sum of the grayscale value of the current granary image and the grayscale values of all historical granary images; and obtaining the cumulative grayscale value of the granary image at the current moment based on the sum and the number of images.
[0009] In an optional embodiment of the present application, the rate of change of the grayscale value of each granary image is calculated in the following manner: the historical grayscale value of the granary image corresponding to the moment before the current moment is retrieved; based on the grayscale value at the current moment and the historical grayscale value, a numerical differential calculation is performed to determine the difference between the grayscale value and the historical grayscale value; based on the time interval between the current moment and the historical moment and the difference, the rate of change of the grayscale value of the granary image at the current moment is calculated.
[0010] In an optional embodiment of the present application, before determining that the granary is in a state of being about to be full, it also includes: if the cumulative grayscale value is not less than the grayscale threshold, judging whether there is a timing for the granary to be in a state of being about to be full; if there is a timing for the granary to be in a state of being about to be full, continuing to determine the cumulative grayscale value of the granary image at the next moment; if there is no timing for the granary to be in a state of being about to be full, controlling the granary to be in a state of being about to be full, starting the timing for the granary to be in a state of being about to be full, and continuing to determine the cumulative grayscale value of the granary image at the next moment.
[0011] In an optional embodiment of the present application, the granary image is a photo of the position of paint sprayed on the inner wall of the granary received from a camera at a preset frequency, and the camera is arranged relative to the paint position.
[0012] In an optional embodiment of the present application, the paint is sprayed at a position close to the upper edge of the inner wall of the granary, and the paint is sprayed in a strip shape, which is parallel to the upper edge of the inner wall of the granary.
[0013] In a second aspect, an embodiment of the present application further provides a detection system, which includes: a camera, for capturing a granary image and sending the granary image to a processor; a processor, for executing the following processing steps whenever a granary image is received: receiving a granary image from a camera, and determining a cumulative grayscale value of the granary image, wherein the granary image is an image including a preset position of the granary, and the preset position of the granary indicates a position of paint sprayed on the inner wall of the granary; judging whether the cumulative grayscale value is less than a grayscale threshold, wherein the cumulative grayscale value is determined based on the grayscale value of the granary image at a current moment and the grayscale value of the granary image at a historical moment; if the cumulative grayscale value is less than the grayscale threshold, then it is determined that the granary is in a not full state; if the cumulative grayscale value is not less than the grayscale threshold, then it is determined that the granary is in a state of about to be full, and the duration of the granary being in the state of about to be full is counted to judge whether the duration reaches a time threshold; if the duration reaches the time threshold, then a full cabin alarm is triggered; an alarm, for receiving an alarm signal from the processor and sounding an alarm.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are executed.
[0016] The detection method and system for grain unloading in a granary provided in the embodiment of the present application execute the following processing steps whenever a granary image is received: determining the cumulative grayscale value of the granary image, the granary image being an image including a preset position of the granary, the preset position of the granary indicating the position of the paint sprayed on the inner wall of the granary; judging whether the cumulative grayscale value is less than the grayscale threshold, the cumulative grayscale value is determined based on the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment; if the cumulative grayscale value is less than the grayscale threshold, it is determined that the granary is in a state of not being full; if the cumulative grayscale value is not less than the grayscale threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to judge whether the duration reaches the time threshold; if the duration reaches the time threshold, a full-tank alarm is triggered. Through the present application, the accuracy of the full-tank alarm is improved.
[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] Figure 1 A flow chart of a method for detecting grain unloading in a granary provided in an embodiment of the present application;
[0020] Figure 2 This is one of the structural schematic diagrams of the interior of a granary provided in an embodiment of the present application;
[0021] Figure 3 The second schematic diagram of the structure inside the granary provided in the embodiment of the present application;
[0022] Figure 4 A schematic diagram of the structure of the detection system provided in the embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] 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. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different 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, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0025] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of agricultural machinery technology.
[0026] Research has found that when a corn harvester harvests grain, the granary is at the rear. Although a camera is installed in the granary, the operator may easily miss the camera, which may cause grain loss. Since the corn cobs are piled up in the granary in a scattered and random manner with gaps in the middle, it is easy for the photoelectric detection light to be transmitted directly to the receiving end through the gaps. The system will not be able to detect the full grain signal, resulting in huge losses. In addition, the photoelectric detection device is expensive and has a complex structure.
[0027] Based on this, the embodiment of the present application provides a method and system for detecting grain unloading in a granary. Whenever a granary image is received, the following processing steps are performed: determining the cumulative grayscale value of the granary image, the granary image is an image containing a preset position of the granary, and the preset position of the granary indicates the position of the paint sprayed on the inner wall of the granary; judging whether the cumulative grayscale value is less than the grayscale threshold, the cumulative grayscale value is determined according to the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment; if the cumulative grayscale value is less than the grayscale threshold, it is determined that the granary is in a state of not being full; if the cumulative grayscale value is not less than the grayscale threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to judge whether the duration reaches the time threshold; if the duration reaches the time threshold, the full tank alarm is triggered. Through this application, the accuracy of the full tank alarm is improved.
[0028] See also Figure 1 , Figure 1 This is a flow chart of the method for detecting grain unloading in a granary provided in an embodiment of the present application. Figure 1 As shown in the embodiment of the present application, the method for detecting grain unloading in a grain silo is performed whenever a grain silo image is received:
[0029] S101, determining the cumulative gray value of the granary image.
[0030] The granary image is an image including a preset position of the granary, and the preset position of the granary indicates a position of paint sprayed on the inner wall of the granary.
[0031] See also Figure 2 , Figure 2 This is one of the schematic diagrams of the structure inside the granary provided in the embodiment of the present application. Figure 2 As shown in , one of the structural schematic diagrams of the interior of the granary provided in an embodiment of the present application includes a camera 21.
[0032] like Figure 2 As shown, the granary image is a photo of the position of the paint sprayed on the inner wall of the granary received from the camera at a preset frequency, and the camera is set relative to the paint position.
[0033] See also Figure 3 , Figure 3This is the second schematic diagram of the structure inside the granary provided in the embodiment of the present application. Figure 3 As shown in , the second structural schematic diagram of the interior of the granary provided in the embodiment of the present application includes a bright paint position 31 and a dark area 32 of the bulkhead.
[0034] like Figure 3 As shown, the paint is sprayed at a position close to the upper edge of the inner wall of the granary, and the paint is sprayed in a strip shape, which is parallel to the upper edge of the inner wall of the granary.
[0035] Spray a bright color paint on the inner side of the granary near the upper edge, such as Figure 3 As shown, a monitoring camera 21 is installed at the upper edge of the side wall relative to the side wall, which is different from the dark tones of other areas. The center line of the camera is aimed at the sprayed paint position, that is, the bright area, to capture the image of the granary with the bright paint position. As the corn harvest continues, the corn cobs in the granary gradually rise, and the bright area will be completely blocked by the corn cobs.
[0036] In this step, before determining the cumulative grayscale value of the granary image, the following steps are performed:
[0037] According to the grayscale value of the granary image at the current moment, the change rate of the grayscale value of the granary image is calculated, and the change rate is used to indicate the change between the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the previous moment;
[0038] Determine whether the change rate corresponding to the gray value of the granary image at the current moment is greater than the change rate threshold;
[0039] If the change rate corresponding to the grayscale value of the granary image at the current moment is not greater than the change rate threshold, it means that the granary image is not affected by the ambient light, and the cumulative grayscale value of the granary image is determined; if the change rate corresponding to the grayscale value of the granary image at the current moment is greater than the change rate threshold, the granary image at the next moment is re-acquired.
[0040] Here, as the corn harvest continues, the corn cobs in the granary gradually rise, and the granary image is acquired in real time. By recognizing the granary image, the grayscale value of the granary image is obtained. Under constant light intensity, the grayscale value should change as the paint area is gradually blocked by corn cobs. It is a function of time Gi(t). When the paint area is completely blocked, the first-order derivative of the grayscale value (Gi)' at this time will have a sudden change. Therefore, when it is detected that the first-order derivative of the grayscale value (Gi)'≥k, it means that the granary image taken by the camera is affected by the ambient light and is inaccurate. This situation should be eliminated. When it is detected that (Gi)'<k, it means that the granary image taken by the camera is normal. Here, k is a fixed constant. The value of k is determined according to actual needs and is not specifically limited here.
[0041] Preferably, the gray value derivative may be obtained by obtaining the gray value change rate, which reflects the brightness change of the image in space and is of great significance for image edge detection, feature extraction and other processing.
[0042] Specifically, after receiving the granary image, the granary image is identified, the grayscale value of the granary image object is determined, and stored for subsequent retrieval when calculating the cumulative grayscale value.
[0043] The rate of change of the grayscale value of each granary image is calculated as follows:
[0044] Retrieve the historical grayscale value of the granary image corresponding to the moment before the current moment;
[0045] According to the grayscale value at the current moment and the historical grayscale value, a numerical differential calculation is performed to determine the difference between the grayscale value and the historical grayscale value;
[0046] According to the time interval and difference between the current moment and the historical moment, the change rate of the grayscale value of the granary image at the current moment is calculated.
[0047] For example, i=5, the change rate A5=(G5-G4)÷(T5-54), where A5 represents the change rate corresponding to G5, T5 represents the time when the camera takes the granary image corresponding to G5, and T4 represents the time when the camera takes the granary image corresponding to G4.
[0048] S102: Determine whether the accumulated gray value is less than the gray threshold.
[0049] The cumulative grayscale value is determined according to the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment.
[0050] Specifically, the cumulative grayscale value of each granary image is determined in the following way:
[0051] Obtain the grayscale values of all historical granary images and the number of images of all historical granary images. All historical granary images refer to all granary images received from the camera before the current moment.
[0052] Calculate the grayscale value of the current granary image and the sum of the grayscale values of all historical granary images;
[0053] According to the sum and the number of images, the cumulative grayscale value of the granary image at the current moment is obtained.
[0054] For example, i=5, G5=(G5+G4+G3+G2+G1)÷5.
[0055] Here, G5 represents the cumulative grayscale value of the granary image at the current moment.
[0056] As the grain unloading in the granary continues, the bright area will be blocked by the corn cobs from being unblocked to partially blocked and finally completely blocked. A grayscale threshold is determined in advance based on the bright area. The grayscale threshold refers to the critical value at which the corn cobs begin to block the bright area.
[0057] For example, taking pure white as an example, its grayscale value is 0% (pure black is 100%). Since the image captured at the beginning of harvest is bright colors such as pure white (to be clearly distinguished from the color of corn when the grain is full), false alarms are not likely to occur.
[0058] S103: If the accumulated gray value is less than the gray threshold, it is determined that the granary is not full.
[0059] In this step, if it is detected that the cumulative gray value is less than the gray threshold, it means that the bright color area is not blocked by the corn cobs, and the granary is set to be in a not full state.
[0060] S104. If the accumulated gray value is not less than the gray threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to determine whether the duration reaches the time threshold.
[0061] In this step, if it is detected that the cumulative gray value is less than the gray threshold, it means that the bright color area begins to be blocked by the corn cobs, and the granary is set to be in a state of being about to be full.
[0062] Specifically, before determining that the granary is about to be full, it also includes:
[0063] If the accumulated gray value is not less than the gray threshold, determine whether there is a timer for the granary to be full;
[0064] If there is a timing for the granary to be in a state of being about to be full, then continue to determine the cumulative grayscale value of the granary image at the next moment; if there is no timing for the granary to be in a state of being about to be full, then control the granary to be in a state of being about to be full, and start timing for the granary to be in a state of being about to be full, and continue to determine the cumulative grayscale value of the granary image at the next moment.
[0065] In an optional embodiment, i=5, if it is detected that the change rate of the grayscale value of the granary image at the current moment is not greater than the change rate threshold, it means that the granary image is not affected by the ambient light, and the detection is continued. If it is detected that the cumulative grayscale value G5 is not less than the grayscale threshold, it means that the corn cobs have begun to block the bright area at the current moment, and the granary should be in a state of being about to be full, and the control timer starts timing; when i=6, the change rate of the grayscale value at the current moment is continued to be detected. If it is detected that the change rate of the grayscale value of the granary image at the current moment is not greater than the change rate threshold, the detection is continued. If When it is detected that the cumulative grayscale value G6 is not less than the grayscale threshold, the state of the timer is identified. If the timer is not turned on, the timer is turned on. If the timer is already turned on, the state of the timer remains unchanged, and the process returns to continue receiving the granary image when i=7. If it is detected that the cumulative grayscale value G6 is less than the grayscale threshold, it means that the corn cobs are not blocking the bright area at the current moment, so the granary should be in a state of not being full. Similarly, the state of the timer is detected. If the timer is already turned on, the timer is turned off. If the timer is not turned on, the state of the timer remains unchanged, and the process returns to continue receiving the granary image when i=8, and so on.
[0066] S105: If the duration reaches a time threshold, a full tank alarm is triggered.
[0067] When it is detected that the duration of the warehouse being about to be full reaches the time threshold, an alarm signal is triggered.
[0068] In an optional embodiment, the alarm includes a light-triggered alarm, an electric-triggered alarm, and a sound-triggered alarm, wherein the light-triggered alarm usually relies on a photoelectric sensor, such as a photoresistor or an infrared light-emitting diode combined with an infrared phototransistor. When the granary is not full, the photoelectric sensor can receive light (which may be natural light or light emitted by a specific light source) and maintain a specific on or off state. Once the granary is full and blocks the photoelectric sensor, the light received by the sensor decreases or disappears, causing its state to change (such as from on to off), thereby triggering the alarm circuit. This alarm method usually has the characteristics of fast response speed and high accuracy; the electric-triggered alarm relies more on the logic judgment and signal processing of the circuit. In the granary full alarm system, the electric trigger is usually combined with the output signal of the photoelectric sensor. When the photoelectric sensor detects that the granary is full and changes state, it generates an electrical signal (such as a change in voltage or current), which is input into the alarm circuit for processing. If the signal meets the preset alarm conditions (such as exceeding a certain threshold), the alarm circuit will be triggered, and then an audible and visual alarm will be generated; the sound-triggered alarm usually refers to the detection of sounds in the environment by an acoustic sensor (such as a microphone or sound detector), and judging whether the alarm needs to be triggered based on the characteristics of the sound (such as volume, frequency, etc.). However, in the granary full alarm system, the sound-triggered alarm is not the main alarm method. On the contrary, it is more of a part of the sound and light alarm system, combined with light triggering and electrical triggering to provide a full range of alarm prompts. When the photoelectric sensor detects that the granary is full and triggers the alarm circuit, the sound trigger part will emit a loud alarm sound (such as the sound of a buzzer) to alert the operator.
[0069] In summary, the photoelectric and acoustic alarms triggered by the corn silo when the silo is full are interrelated and complementary. The photoelectric sensor is responsible for detecting the state of the silo through the camera, the electrical trigger part is responsible for processing the signal output by the sensor and judging whether the alarm conditions are met, and the acoustic trigger part is responsible for providing an audible alarm prompt. This design can ensure that the alarm signal is issued in a timely and accurate manner when the silo is full, thereby avoiding grain overflow and waste.
[0070] The granary grain unloading detection method and detection system provided in the embodiment of the present application, whenever a granary image is received, executes the following processing steps: determining the cumulative grayscale value of the granary image, the granary image is an image including a preset position of the granary, the preset position of the granary indicates the position of the paint sprayed on the inner wall of the granary; judging whether the cumulative grayscale value is less than the grayscale threshold, the cumulative grayscale value is determined based on the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment; if the cumulative grayscale value is less than the grayscale threshold, it is determined that the granary is in a not full state; if the cumulative grayscale value is not less than the grayscale threshold, it is determined that the granary is in a state of about to be full, and the duration of the granary being in the state of about to be full is counted to judge whether the duration reaches the time threshold; if the duration reaches the time threshold, the full tank alarm is triggered. Through the present application, the accuracy of the full tank alarm is improved, and the occurrence of missed alarms and false alarms is avoided.
[0071] Based on the existing cameras, this application uses image processing methods to achieve high-reliability corn machine grain bin full grain detection without increasing costs. After eliminating the interference of changes in ambient light intensity and detection errors, it compares with the change rate threshold and grayscale threshold. When the change rate threshold and grayscale threshold are met, an alarm signal is promptly issued to remind the operator to unload the grain in time.
[0072] The solution of the present application has a simple structure and is easy to install and maintain; it is low-cost and utilizes the original vehicle camera and control chip to achieve a high-reliability full-grain alarm only through algorithm optimization; it avoids missed alarms of photoelectric sensor solutions and missed alarms of pure image monitoring solutions.
[0073] Based on the same inventive concept, a detection system corresponding to the detection method for grain unloading in a granary is also provided in the embodiment of the present application. Since the principle of solving the problem by the system in the embodiment of the present application is similar to the above-mentioned detection method for grain unloading in the granary in the embodiment of the present application, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be repeated.
[0074] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of the detection system provided in the embodiment of the present application. Figure 4 As shown in , the detection system 400 includes:
[0075] The camera 41 is used to capture the granary image and send the granary image to the processor;
[0076] The processor 42 performs the following processing steps whenever receiving a granary image:
[0077] Receiving a granary image from a camera and determining a cumulative grayscale value of the granary image, wherein the granary image is an image including a preset position of the granary, and the preset position of the granary indicates a position of paint sprayed on an inner wall of the granary;
[0078] Determine whether the cumulative grayscale value is less than a grayscale threshold, wherein the cumulative grayscale value is determined according to the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment;
[0079] If the accumulated gray value is less than the gray threshold, it is determined that the granary is not full;
[0080] If the accumulated gray value is not less than the gray threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to determine whether the duration reaches the time threshold;
[0081] If the duration reaches the time threshold, a full tank alarm is triggered;
[0082] The alarm 43 is used to receive an alarm signal from the processor and generate an alarm.
[0083] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 5 As shown in , the electronic device 300 includes a processor 310 , a memory 320 and a bus 330 .
[0084] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 via the bus 330. When the machine-readable instructions are executed by the processor 310, the above-mentioned Figure 1 The specific implementation of the steps of the method for detecting grain unloading in a granary in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0085] 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 computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the method for detecting grain unloading in a granary in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0086] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0087] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units 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, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0088] The units described as separate components may or may not be physically separated, and the components shown as units 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.
[0089] 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.
[0090] 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 can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. 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 application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0091] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting grain unloading in a granary, characterized in that: Whenever a granary image is received, the following processing steps are performed: Determine the cumulative gray value of the granary image, wherein the granary image is an image including a preset position of the granary, and the preset position of the granary indicates a position of the paint sprayed at a position on the inner wall of the granary; Determine whether the cumulative grayscale value is less than a grayscale threshold, wherein the cumulative grayscale value is determined according to the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment; If the accumulated gray value is less than the gray threshold, it is determined that the granary is not full; If the accumulated gray value is not less than the gray threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to determine whether the duration reaches the time threshold; If the duration reaches the time threshold, a full tank alarm is triggered.
2. The method according to claim 1, characterized in that: Before determining the cumulative grayscale value of the granary image, the method includes: According to the grayscale value of the granary image at the current moment, calculating the change rate of the grayscale value of the granary image, the change rate is used to indicate the change between the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the previous moment; Determine whether the change rate corresponding to the gray value of the granary image at the current moment is greater than the change rate threshold; If the change rate is not greater than the change rate threshold, it means that the granary image is not affected by the ambient light, and the cumulative grayscale value of the granary image is determined; If the change rate is greater than the change rate threshold, the granary image at the next moment is reacquired.
3. The method according to claim 2, characterized in that The cumulative grayscale value of each granary image is determined as follows: Obtaining the grayscale values of all historical granary images and the number of images of all historical granary images, wherein all historical granary images refer to all granary images received from the camera before the current moment; Calculate the grayscale value of the current granary image and the sum of the grayscale values of all historical granary images; According to the sum and the number of images, the cumulative grayscale value of the granary image at the current moment is obtained.
4. The method according to claim 2, characterized in that: The rate of change of the grayscale value of each granary image is calculated as follows: Retrieve the historical grayscale value of the granary image corresponding to the moment before the current moment; Performing numerical differential calculation based on the grayscale value at the current moment and the historical grayscale value to determine the difference between the grayscale value and the historical grayscale value; According to the time interval between the current moment and the historical moment and the difference, the rate of change of the grayscale value of the granary image at the current moment is calculated.
5. The method according to claim 1, characterized in that Before determining that the granary is about to be full, the method further includes: If the accumulated gray value is not less than the gray threshold, determining whether there is a timer for the granary to be in a full state; If there is a timer for the granary to be full, continue to determine the cumulative grayscale value of the granary image at the next moment; If there is no timing for the granary to be in a state of being almost full, the granary is controlled to be in a state of being almost full, and the timing for the granary to be almost full begins, and the accumulated grayscale value of the granary image at the next moment is continuously determined.
6. The method according to claim 3, characterized in that The granary image is a photo of the paint position sprayed on the inner wall of the granary received from a camera at a preset frequency, and the camera is arranged relative to the paint position.
7. The method according to claim 1, characterized in that The paint is sprayed at a position close to the upper edge of the inner wall of the granary, and the paint is sprayed in a strip shape, which is parallel to the upper edge of the inner wall of the granary.
8. A detection system, characterized in that: include: A camera, used for capturing images of the granary and sending the images of the granary to a processor; The processor is configured to perform the following processing steps whenever a grain silo image is received: Receiving a granary image from a camera and determining a cumulative grayscale value of the granary image, wherein the granary image is an image including a preset position of the granary, and the preset position of the granary indicates a position of paint sprayed on an inner wall of the granary; Determine whether the cumulative grayscale value is less than a grayscale threshold, wherein the cumulative grayscale value is determined according to the grayscale value of the granary image at the current moment and the grayscale value of the granary image at the historical moment; If the accumulated gray value is less than the gray threshold, it is determined that the granary is not full; If the accumulated gray value is not less than the gray threshold, it is determined that the granary is in a state of being about to be full, and the duration of the granary being in the state of being about to be full is counted to determine whether the duration reaches the time threshold; If the duration reaches the time threshold, a full tank alarm is triggered; The alarm is used to receive an alarm signal from the processor and issue an alarm.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of any method as claimed in 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 method according to any one of claims 1 to 7 are executed.