Film-following guiding control system and method based on opencv
Through opencv technology, the image information on the ridge is collected in real time and the attitude of the transplanter is automatically adjusted, which solves the problem of ridge damage caused by traditional guidance methods, and achieves a high-precision and low-destruction automatic guidance effect.
Patent Information
- Application Number
- CN202411367758.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The well-cellar transplanter is prone to destroy the ridge shape when the offset direction is controlled. Especially when the length of the single ridge increases, it is difficult to effectively avoid deviation and damage by the traditional rubber wheel guide method.
The opencv-based film-oriented control system is adopted to collect black and white film image information on the ridge in real time through the camera, and use the control system and servo motor to adjust the posture to achieve automatic ridge-oriented guidance and reduce offset and damage.
It effectively reduces the deviation direction of the transplanter and damage to the ridge shape, improves the guidance accuracy and safety, is suitable for shading scenarios such as indoors or greenhouses, and reduces labor demand.
Smart Images

Figure CN119302091A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent manufacturing equipment design, and in particular to an OpenCV-based film-following guiding control system. Background Art
[0002] The well-cellar transplanter is a semi-automatic transplanting machine developed based on the well-cellar transplanting agronomy of tobacco. After the tobacco seedlings are cultivated, they need to be transplanted into the well-cellar in the ridge. The well-cellar transplanter can greatly reduce the labor required for this agronomic process. During the transplanting process, the transplanter moves along the ridge for transplanting. At this time, two people are required to operate, one to control the steering wheel of the transplanter and the other to place the seedlings.
[0003] In the past, pit-type transplanters used two fixed rubber wheels for direction control. When the transplanter deviated from the direction, the rubber wheel installed in the front of the transplanter would first collide with the ridge. At this time, the two obliquely arranged rubber wheels would exert a component force on the transplanter in the opposite direction of the deviation, causing it to be unable to continue to deviate, but to move along the ridge. This method can reduce the deviation to a certain extent, but the rubber wheel will come into contact with the ridge, causing damage to the ridge shape, and as the length of the single ridge increases, the situation becomes more serious and may even completely destroy the ridge. Summary of the invention
[0004] The purpose of the present invention is to provide a film-following guidance control system and method based on OpenCV, which can reduce the deviation direction of the transplanter and the damage to the ridge shape.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A film-following guidance control system based on OpenCV includes: a tobacco seedling transplanter, a gear transmission, a servo motor, a control system and a camera. The control system is installed in front of the tobacco seedling transplanter. The servo motor is connected to the front wheel steering system of the tobacco seedling transplanter through the gear transmission. When the tobacco seedling transplanter is working, the camera collects black and white film image information on the ridge in real time and transmits the image information to the control system at the same time. The control system adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance.
[0007] Optionally, a servo driver is further included, and the servo driver is connected to the servo motor.
[0008] Optionally, a power supply is further included, and the power supply is connected to the servo drive and the control system respectively.
[0009] Optionally, the control system adopts Raspberry Pi 5b.
[0010] Optionally, the power of the servo motor is 400w and the voltage is 48v.
[0011] Optionally, the control system adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance, specifically including:
[0012] According to the image information, a pulse width modulation signal is obtained through a film-guided control algorithm;
[0013] Controlling the rotation of the servo motor according to the pulse width modulation signal;
[0014] The servo motor is rotated to drive the gear transmission, so as to adjust the posture of the transplanter and realize ridge-following guidance.
[0015] To achieve the above object, the present invention also provides the following solution:
[0016] A membrane-following guidance control method based on OpenCV includes:
[0017] Obtain black and white film image information;
[0018] According to the image information, the driving result of the tobacco seedling transplanter is obtained, and the driving result includes the tobacco seedling transplanter driving to the left, the tobacco seedling transplanter driving normally, and the tobacco seedling transplanter driving to the right;
[0019] According to the driving result of the tobacco seedling transplanter, a film-following guidance control algorithm is adopted to obtain a pulse width modulation signal;
[0020] The control servo motor and the driving gear are controlled to work according to the pulse width modulation signal, and the tobacco seedling transplanter is controlled to automatically turn right or left to adjust its posture when it deviates to the left or right, so as to achieve ridge-following guidance.
[0021] Optionally, obtaining the driving result of the tobacco seedling transplanter according to the image information specifically includes:
[0022] Set a midpoint in the middle of the entire image;
[0023] The positions of the two identified white membrane boundary points are transformed and vertical lines are drawn as the left boundary and the right boundary;
[0024] Determine the positional relationship between the middle point and the left boundary and the right boundary to obtain a driving result;
[0025] When the middle point is greater than the right boundary, it is determined that the tobacco seedling transplanter deviates to the right;
[0026] When the middle point is between the left boundary and the right boundary, it is determined that the tobacco seedling transplanter is running normally;
[0027] When the middle point is smaller than the left boundary, it is determined that the tobacco seedling transplanter is moving to the left.
[0028] To achieve the above object, the present invention also provides the following solution:
[0029] An electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a film-following guiding control method based on OpenCV.
[0030] To achieve the above object, the present invention also provides the following solution:
[0031] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, an OpenCV-based film-following guiding control method is implemented.
[0032] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0033] The present invention provides a film-following guidance control system based on OpenCV, the system comprises: a tobacco seedling transplanter, a gear transmission, a servo motor, a control system and a camera, the control system is installed in front of the tobacco seedling transplanter, the servo motor is connected to the front wheel steering system of the tobacco seedling transplanter through the gear transmission, when the tobacco seedling transplanter is working, the camera collects the black and white film image information on the ridge in real time and transmits the image information to the control system, the control system adjusts the posture of the transplanter according to the image information, and realizes the ridge-following guidance. The present invention can reduce the situation of the transplanter deviating from the direction and damaging the ridge shape. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 The film-following guiding control system structure based on opencv of the present invention Figure 1 ;
[0036] Figure 2 The film-following guiding control system structure based on opencv of the present invention Figure 2 .
[0037] Figure 3 It is the black and white film image information;
[0038] Figure 4 The average color gradient of each pixel in the horizontal direction of the black and white film
[0039] Figure 5This is a schematic diagram of the driving results of the tobacco seedling transplanter;
[0040] Figure 6 This is a flow chart of the membrane-following guidance control system method based on OpenCV of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] The purpose of the present invention is to provide a film-following guidance control system and method based on OpenCV, which can reduce the deviation direction of the transplanter and the damage to the ridge shape.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] Figure 1 The film-following guiding control system structure based on opencv of the present invention Figure 1 ; Figure 2 The film-following guiding control system structure based on opencv of the present invention Figure 2 .like Figure 1 and Figure 2 As shown, a film-following guidance control system based on OpenCV includes: a tobacco seedling transplanter 1, a gear transmission 2, a servo motor 3, a servo driver 4, a power supply 5, a control system 6 and a camera 7. The control system 6 is installed in front of the tobacco seedling transplanter 1. The servo motor 3 is connected to the front wheel steering system of the tobacco seedling transplanter 1 through the gear transmission 2, and can directly control the front wheel steering. When the tobacco seedling transplanter 1 is working, the camera 7 collects the black and white film image information on the ridge in real time and transmits the image information to the control system 6 at the same time. The control system 6 adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance. The servo driver 5 is connected to the servo motor 3. The power supply 5 is connected to the servo driver 3 and the control system respectively. Figure 3 It is the black and white film image information.
[0045] The control system 6 adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance, specifically including:
[0046] According to the image information, a pulse width modulation signal is obtained through a film-guided control algorithm;
[0047] Control the servo motor 3 to rotate according to the pulse width modulation signal;
[0048] The servo motor 3 rotates and drives the gear transmission 2 to adjust the posture of the transplanter to achieve ridge-following guidance.
[0049] The control system uses a Raspberry Pi 5b. The power of the servo motor 3 is 400w and the voltage is 48v. The camera 7 captures the image of the black and white film on the ridge in real time. Figure 3 Right, the image information is transmitted to the Raspberry Pi at the same time. In the Raspberry Pi, the vertical large prewitt operator is used to first obtain the white film boundary position on the black and white film, such as Figure 3 The black dot on the right, the code is as follows:
[0050] defbj(img,s=101,bj1=0,bj2=0):
[0051] h,w=img.shape
[0052] he = np.zeros((h / / 2,s))
[0053] pjtd=np.zeros((2,w),np.float32)
[0054] s1=s / / 2
[0055] he[:,:s1]=1
[0056] he[:,s1+1:s]=-1
[0057] img1 = np.zeros((h,w+s1*2))
[0058]
[0059] This vertical large prewitt operator uses the unique characteristics of black and white films to accurately locate the boundary of the white film in the presence of large noises, such as Figure 4 It reflects the maximum gradient change and the gradient change caused by some noise. The horizontal positions of the two boundaries of the white film in the whole image can reflect the traveling state of the tobacco seedling transplanter 1, which further concretizes this reflection:
[0060] 1. Set a point in the middle of the entire image;
[0061] 2. Transform the positions of the two identified white film boundary points and draw vertical lines as the left and right boundaries;
[0062] Thus, when the middle point is larger than the right boundary, it can be considered that the tobacco seedling transplanter 1 is biased to the right; when the middle point is between the left boundary and the right boundary, it can be considered that the tobacco seedling transplanter 1 is running normally; when the middle point is smaller than the left boundary, it can be considered that the tobacco seedling transplanter 1 is biased to the left. Figure 5 .
[0063] At this time, the judgment of the driving state of the transplanter is completed, and this judgment information is converted into a PWM signal to control the servo motor 3, so that the transplanter can automatically turn right or left to adjust its posture when it deviates to the left or right, thereby achieving ridge-following guidance.
[0064] Compared with the prior art, the present invention has the following advantages:
[0065] 1. This control system can automatically guide along the ridge. Compared with the traditional mechanical guidance, it has no contact with the ridge, so it will not damage the ridge. Compared with the manual guidance, it can reduce the labor.
[0066] 2. Compared with the chassis guidance of GPS navigation, this control system can be used in scenes with obstructions such as indoors or greenhouses, and normal operation will not be affected by signal obstruction
[0067] 3. Compared with the infrared navigation system, this control system can work under the influence of outdoor light and has better adaptability to environmental influences.
[0068] 4. This control system can be configured on other agricultural machinery chassis that work on black and white film ridges, and has a certain degree of versatility.
[0069] Embodiment 2:
[0070] Figure 6 This is a flow chart of a film-following guidance control method based on OpenCV in the present invention, such as Figure 6 As shown, a membrane-following guidance control method based on OpenCV includes:
[0071] Step 101: Acquire black and white film image information;
[0072] Step 102: obtaining a driving result of the tobacco seedling transplanter according to the image information, wherein the driving result includes the tobacco seedling transplanter driving to the left, the tobacco seedling transplanter driving normally, and the tobacco seedling transplanter driving to the right;
[0073] Step 103: using a film-following guidance control algorithm according to the driving result of the tobacco seedling transplanter to obtain a pulse width modulation signal;
[0074] Step 104: Control the control servo motor and the driving gear to work according to the pulse width modulation signal, and control the tobacco seedling transplanter to automatically turn right or left to adjust its posture when it deviates to the left or right, so as to achieve ridge-following guidance.
[0075] The step 102 specifically includes:
[0076] Step 1021: setting a middle point in the middle of the entire image;
[0077] Step 1022: transform the positions of the two identified white membrane boundary points and draw vertical lines as the left boundary and the right boundary;
[0078] Step 1023: Determine the positional relationship between the middle point and the left boundary and the right boundary to obtain a driving result;
[0079] When the middle point is greater than the right boundary, it is determined that the tobacco seedling transplanter deviates to the right;
[0080] When the middle point is between the left boundary and the right boundary, it is determined that the tobacco seedling transplanter is running normally;
[0081] When the middle point is smaller than the left boundary, it is determined that the tobacco seedling transplanter is moving to the left.
[0082] Embodiment three:
[0083] This embodiment provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the film-following guidance control method based on OpenCV in the second embodiment.
[0084] Optionally, the above-mentioned electronic device may be a server.
[0085] In addition, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the film-following guide control method based on OpenCV in the second embodiment.
[0086] Embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0090] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0091] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A film-following guidance control system based on opencv, characterized in that: The system includes: a tobacco seedling transplanter, a gear transmission, a servo motor, a control system and a camera. The control system is installed in front of the tobacco seedling transplanter. The servo motor is connected to the front wheel steering system of the tobacco seedling transplanter through the gear transmission. When the tobacco seedling transplanter is working, the camera collects the black and white film image information on the ridge in real time and transmits the image information to the control system at the same time. The control system adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance.
2. The film-following guidance control system based on OpenCV according to claim 1 is characterized in that: It also includes a servo driver, which is connected to the servo motor.
3. The film-following guidance control system based on OpenCV according to claim 2 is characterized in that: It also includes a power supply, which is connected to the servo drive and the control system respectively.
4. The film-following guiding control system based on OpenCV according to claim 3 is characterized in that: The control system adopts Raspberry Pi 5b.
5. The film-following guidance control system based on opencv according to claim 1, characterized in that: The power of the servo motor is 400w and the voltage is 48v.
6. The film-following guidance control system based on opencv according to claim 1, characterized in that: The control system adjusts the posture of the transplanter according to the image information to achieve ridge-following guidance, specifically including: According to the image information, a pulse width modulation signal is obtained through a film-guided control algorithm; Controlling the rotation of the servo motor according to the pulse width modulation signal; The servo motor is rotated to drive the gear transmission, so as to adjust the posture of the transplanter and realize ridge-following guidance.
7. A film-following guidance control method based on opencv, characterized in that: The method comprises: Obtain black and white film image information; According to the image information, the driving result of the tobacco seedling transplanter is obtained, and the driving result includes the tobacco seedling transplanter driving to the left, the tobacco seedling transplanter driving normally, and the tobacco seedling transplanter driving to the right; According to the driving result of the tobacco seedling transplanter, a film-following guidance control algorithm is adopted to obtain a pulse width modulation signal; The control servo motor and the driving gear are controlled to work according to the pulse width modulation signal, and the tobacco seedling transplanter is controlled to automatically turn right or left to adjust its posture when it deviates to the left or right, so as to achieve ridge-following guidance.
8. The film-following guidance control method based on OpenCV according to claim 1 is characterized in that: The step of obtaining the driving result of the tobacco seedling transplanter according to the image information specifically includes: Set a midpoint in the middle of the entire image; The positions of the two identified white membrane boundary points are transformed and vertical lines are drawn as the left boundary and the right boundary; Determine the positional relationship between the middle point and the left boundary and the right boundary to obtain a driving result; When the middle point is greater than the right boundary, it is determined that the tobacco seedling transplanter deviates to the right; When the middle point is between the left boundary and the right boundary, it is determined that the tobacco seedling transplanter is running normally; When the middle point is smaller than the left boundary, it is determined that the tobacco seedling transplanter is moving to the left.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the film-following guidance control method based on OpenCV as described in any one of claims 7-8.
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 film-following guiding control method based on OpenCV according to any one of claims 7 to 8 is implemented.
Citation Information
Patent Citations
Calculation method for driving area of tour inspection robot of transformer station
CN106599760A
Real-time field robot visual navigation method based on FPGA and real-time field robot visual navigation system based on FPGA
CN110196053A
Self-adaptive control method for peanut harvester
CN110881305A
Tobacco ridge profiling mechanism of flue-cured tobacco transplanter and control method of tobacco ridge profiling mechanism
CN116686433A
Self-propelled ridge-following direction changing method
CN116746348A