A method and system for upper and lower limit of rolling shutter machine based on image recognition
By setting a circular indicator light and a camera on the roller shutter, combined with simple image processing, the problems of high hardware cost and insufficient real-time performance in the prior art are solved, and efficient and low-cost roller shutter limit control is achieved.
Patent Information
- Application Number
- CN202510151842.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-02-12
AI Technical Summary
When existing image recognition technology recognizes the position of the roller shutter in real time, it requires high performance hardware support, resulting in high hardware cost and insufficient real-time performance, affecting control accuracy and efficiency.
The upper and lower limit method of the roller shutter machine based on image recognition is adopted. By setting a circular indicator light and a greenhouse top camera on the surface of the main motor of the roller shutter machine, the light spot diameter is recorded, and the precise limit control of the roller shutter machine is achieved.
It reduces hardware cost and power consumption, improves the real-time and response speed of the system, and achieves high-precision limit control and ease of use.
Smart Images

Figure CN119624953B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of roller shutter machine identification, and in particular to an upper and lower limit method and system for a roller shutter machine based on image recognition. Background Art
[0002] In the existing field of roller shutter machine control technology, traditional limiting methods have long been dominant, mainly through mechanical limiting devices or sensors to achieve position control of the roller shutter machine. These traditional methods have many drawbacks that cannot be ignored, the most notable of which is the complexity of the installation process. When installing mechanical limiting devices or sensors, it is often necessary to make significant modifications to the mechanical structure of the roller shutter machine. This is not only cumbersome to operate, but also requires high professional skills of the installers. Any carelessness will affect the stability of the entire roller shutter machine system. At the same time, because it is in a mechanical motion environment for a long time, it is extremely susceptible to wear and damage, and the subsequent maintenance costs should not be underestimated. More importantly, they have obvious limitations in limiting accuracy, making it difficult to meet high-precision control requirements.
[0003] In recent years, with the rapid development of image recognition technology, a new method for roller shutter limit control has emerged. This method uses image recognition to determine the position of the roller shutter or roller shutter rod. This method has shown significant theoretical advantages and has brought new development ideas to the field of roller shutter control.
[0004] However, in practical applications, the implementation of this technology faces numerous challenges. Existing image recognition technologies rely heavily on complex image processing algorithms and deep learning models to identify the position of roller shutters in real time. These technologies require extensive image processing and computation, placing extremely high demands on hardware performance. Conventional hardware struggles to meet these computational requirements, forcing the use of high-performance hardware, which significantly increases hardware costs. Furthermore, the complex image processing process takes a long time, which can cause delays in roller shutter control scenarios where real-time performance is crucial, impacting the control accuracy and operational efficiency of the roller shutters. Summary of the Invention
[0005] The purpose of the present invention is to provide a method and system for upper and lower limit of a roller shutter machine based on image recognition to solve the following technical problems:
[0006] Existing image recognition technologies often require high computing power to identify the position of roller shutter machines in real time, such as complex image processing algorithms and deep learning models. This places extremely high demands on hardware performance, increasing hardware costs and power consumption. Furthermore, the complex image processing process can lead to insufficient real-time performance, impacting the control accuracy and efficiency of roller shutter machines.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A method for upper and lower limit of a roller shutter machine based on image recognition, applied to a self-propelled greenhouse roller shutter machine, includes the following steps:
[0009] A camera is set up just above the top of the greenhouse, and a circular indicator light is set on the surface of the main motor of the roller shutter. When the roller shutter is at the upper limit, the distance L between the circular indicator light and the lens is recorded. The distance between the camera's focal plane and the lens is set to u, u < La, where a represents the depth of field range of the lens.
[0010] Record the diameter d of the circular spot of the circular indicator light on the camera sensor when the roller shutter is at the upper limit position;
[0011] Record the diameter D of the circular spot of the circular indicator light on the camera sensor when the roller shutter is at the lower limit position;
[0012] When the greenhouse insulation curtain is opened or closed, video image frames are obtained from the camera in real time, and the image frames are preprocessed to identify the circular light spots in the image frames and obtain the diameter of the circular light spots. When the insulation curtain is opened, if the diameter of the circular light spot is equal to d, it is determined that the roller shutter is at the upper limit and the power of the roller shutter is turned off; when the insulation curtain is closed, if the diameter of the circular light spot is equal to D, it is determined that the roller shutter is at the lower limit and the power of the roller shutter is turned off.
[0013] As a further solution of the present invention: record the corresponding opening area ratio of the greenhouse insulation curtain at different distances between the circular indicator light and the camera, generate a mapping relationship between the distance and the area ratio, and set the opening ratio of the greenhouse insulation curtain to k i When , the corresponding mapping distance L is obtained from the mapping relationship i , then the mapping distance L i Corresponding spot diameter D i The calculation formula is:
[0014] ;
[0015] Where f represents the focal length of the lens, D0 represents the actual diameter of the circular indicator light, then when the opening ratio of the greenhouse insulation curtain is received, i When the diameter of the circular indicator light in the video image frame is equal to D i , turn off the power of the roller shutter machine.
[0016] As a further solution of the present invention: the upper limit position is the position of the roller shutter when the greenhouse thermal insulation curtain is fully rolled up; the lower limit position is the position of the roller shutter when the greenhouse thermal insulation curtain is fully unfolded.
[0017] As a further solution of the present invention: obtain the minimum circumscribed rectangle of the light spot of the circular indicator light in the camera sensor when the roller shutter is at the lower limit position, set the area within the minimum circumscribed rectangle as the detection area, and when the roller shutter is running, only perform light spot recognition within the detection area.
[0018] As a further solution of the present invention: the pretreatment process is:
[0019] The image frame is converted into a grayscale image. Based on the matrix template of the Laplace operator, each pixel point and adjacent pixel points in the grayscale image are multiplied by the values in the matrix template respectively, and the sum of all products is calculated. The sum value is marked as the new grayscale value of the intermediate pixel point, and the grayscale values of all pixels in the image frame are updated respectively.
[0020] As a further solution of the present invention, the process of identifying the circular light spot in the image frame and obtaining the diameter of the circular light spot is as follows:
[0021] Perform Gaussian filtering on the grayscale image and perform edge detection on the grayscale image using the Canny algorithm. Use the Sobel operator to calculate the gradient amplitude and direction, suppress non-edge points, retain the local maximum on the edge, and distinguish strong and weak edges through high and low thresholds. Obtain a complete edge image through connectivity analysis.
[0022] The edge points are mapped to the parameter space using the Hough circle transform. The center and radius range are determined according to the gradient direction and voted in the accumulator. When the accumulator value exceeds the set threshold, the circle corresponding to the center and radius within the edge is determined to be a valid circle, and the diameter of the circular spot is detected.
[0023] As a further solution of the present invention: the camera and the circular indicator light are turned on only when the roller shutter machine is in operation.
[0024] The present invention also includes an upper and lower limit system for a roller shutter machine based on image recognition, which is used to implement the above-mentioned upper and lower limit method for a roller shutter machine based on image recognition, including a camera, a camera setting module, a memory, a circular indicator light, an image processing module and a data processing module, wherein:
[0025] A camera is used to capture video of the circular indicator light during the operation of the roller shutter machine;
[0026] The camera setting module is used to record the distance L between the circular indicator light and the lens when the roller shutter is at the upper limit position, and set the distance between the camera's focal plane and the lens to u, u<La, where a represents the depth of field range of the lens;
[0027] The circular indicator light is used to turn on when the roller shutter machine is in operation and to indicate the position of the roller shutter machine;
[0028] The memory is used to record the diameter d of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the upper limit position; and to record the diameter D of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the lower limit position;
[0029] The image processing module is used to obtain video image frames from the camera in real time when the greenhouse insulation curtain is opened or closed, and pre-process the image frames, identify the circular light spots in the image frames, and obtain the diameter of the circular light spots;
[0030] The data processing module is used to determine that the roller shutter machine is at the upper limit position when the diameter of the circular light spot is equal to d during the process of opening the thermal insulation curtain, and output a power-off command for the roller shutter machine; when the diameter of the circular light spot is equal to D during the process of closing the thermal insulation curtain, it is used to determine that the roller shutter machine is at the lower limit position and output a power-off command for the roller shutter machine.
[0031] Beneficial effects of the present invention:
[0032] The present invention avoids complex deep learning models or advanced image processing algorithms by optimizing the image processing process and using only simple image preprocessing and spot diameter detection based on geometric relationships. This method significantly reduces the performance requirements for hardware equipment, reduces hardware costs and power consumption, and makes the system more suitable for operation in resource-constrained environments. By directly detecting the spot diameter of the circular indicator light to determine the position of the roller shutter, the complex image analysis process is avoided, thereby improving the real-time performance and response speed of the system. At the same time, by accurately recording the correspondence between the spot diameter and the position of the roller shutter, high-precision limit control can be achieved. The present invention does not require complex sensors or mechanical devices. This simplified design not only reduces installation costs, but also improves the reliability and ease of use of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention will be further described below with reference to the accompanying drawings.
[0034] Figure 1 This is a flow chart of an upper and lower limit method for a roller shutter machine based on image recognition according to the present invention;
[0035] Figure 2 It is a module schematic diagram of an upper and lower limit system of a roller shutter machine based on image recognition of the present invention. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0037] Please refer to Figure 1 As shown, a method for upper and lower limit positions of a rolling machine based on image recognition is applied to a self-propelled greenhouse rolling machine, and includes the following steps:
[0038] 1. In order to achieve precise control of the upper and lower limit positions of the rolling machine, an innovative method based on image recognition is proposed. Specifically, a camera is installed directly above the top of the greenhouse to monitor the operating state of the rolling machine in real time. At the same time, a circular indicator light is set on the surface of the main motor of the rolling machine to mark the position of the rolling machine. For energy conservation and improving system efficiency, the camera and the circular indicator light are only turned on during the operation of the rolling machine. <00000]]
[0039] When the rolling machine is at the upper limit position, the distance between the circular indicator light and the camera lens is recorded as L at this time. In order to ensure that the camera can capture the blurred light spot of the circular indicator light, the focusing plane of the camera needs to be precisely set. Specifically, the distance between the focusing plane of the camera and the lens is set as u, and it is required that u < L - a, where a represents the rear depth of field range of the lens. This setting can ensure that during the operation of the rolling machine, the circular indicator light is always outside the imaging depth of field of the camera and always appears as a blurred light spot, thereby providing recognizable image data for subsequent image recognition.
[0040] In addition, the upper limit position refers to the position where the rolling machine is located when the greenhouse heat preservation curtain is completely rolled up, and the lower limit position refers to the position where the rolling machine is located when the greenhouse heat preservation curtain is completely unfolded. Through this definition, the operating range of the rolling machine can be clearly defined, and a clear basis can be provided for subsequent limit control.
[0041] 2. During the operation of the rolling machine, in order to achieve precise detection of its upper and lower limit positions, the imaging characteristics of the circular indicator light in the camera sensor need to be recorded in detail. The specific steps are as follows:
[0042] When the rolling machine is at the upper limit position, that is, when the greenhouse heat preservation curtain is completely rolled up, the position of the circular indicator light is fixed at this time. The camera takes a picture at this time and analyzes the picture to accurately measure the diameter of the light spot formed by the circular indicator light in the camera sensor, denoted as d. This diameter d is the characteristic size of the light spot in the upper limit state and will be an important basis for subsequent judgment of whether the rolling machine reaches the upper limit position.
[0043] Similarly, when the roller shutter is at its lower limit—that is, when the greenhouse insulation curtain is fully extended—the position of the circular indicator light also changes accordingly. At this point, the camera captures and analyzes the image again, accurately measuring the diameter of the light spot formed by the circular indicator light on the camera sensor, recorded as D. This diameter, D, is the characteristic size of the light spot in the lower limit state and serves as an important basis for subsequent judgment of whether the roller shutter has reached its lower limit.
[0044] By recording the spot diameters (d and D) at these two key locations, a clear image feature reference is provided for limit detection of the roller shutter. During subsequent operation, simply monitoring the spot diameter of the circular indicator light in real time and comparing it with the pre-recorded diameters d and D can accurately determine whether the roller shutter has reached its upper and lower limits, thereby achieving precise control of the roller shutter's operation.
[0045] 3. During the operation of the roller shutter machine, in order to accurately detect the position of the roller shutter machine, the present invention adopts an efficient image processing and recognition method. The specific steps are as follows:
[0046] During the process of opening or closing the greenhouse thermal curtain, the camera captures video image frames in real time. To improve detection efficiency and reduce the consumption of computing resources, the present invention specifically designs a method for setting the detection area. Specifically, when the roller shutter is at the lower limit (i.e., when the greenhouse thermal curtain is fully extended), the light spot formed by the circular indicator light in the camera sensor is recorded, and the minimum circumscribed rectangle of the light spot is calculated. The range of this minimum circumscribed rectangle is defined as the detection area. During the operation of the roller shutter, the image processing system will only analyze and identify the image content within this detection area, thereby avoiding indiscriminate processing of the entire image frame and significantly improving the operating efficiency of the system.
[0047] In order to ensure that the light spot features in the image can be accurately identified, the present invention performs a special preprocessing operation on the collected image frames. The specific steps of preprocessing are as follows:
[0048] Grayscale processing: First, the color image frame is converted into a grayscale image. Grayscale processing can remove the color information in the image while retaining the brightness information, thereby simplifying subsequent processing and reducing the amount of data.
[0049] Laplace sharpening: Based on the Laplace operator matrix template, an operation is performed on each pixel in the grayscale image and its neighboring pixels. Specifically, each pixel and its surrounding pixels are multiplied by the value in the Laplace operator matrix template and the sum of all products is calculated. This sum is marked as the new grayscale value of the pixel. In this way, the grayscale values of all pixels in the image frame are updated, achieving image sharpening. Laplace sharpening can enhance the edge features of the image, making the outline of the light spot clearer, facilitating subsequent identification and analysis.
[0050] After the above preprocessing steps, the light spot features in the image are more prominent, providing a high-quality image basis for subsequent light spot recognition and roller shutter position detection.
[0051] 4. After completing the image preprocessing, in order to accurately identify the circular light spot and determine its diameter, the specific steps of the present invention are as follows:
[0052] 4.1. Gaussian filtering and edge detection:
[0053] First, the grayscale image is Gaussian filtered. Gaussian filtering is a smoothing filter based on the Gaussian function that can effectively remove noise from the image while retaining important image features, providing a clearer image foundation for subsequent edge detection.
[0054] Subsequently, the Canny edge detection algorithm is used to detect edges in the filtered grayscale image. The Canny algorithm is a classic edge detection method that achieves high-precision edge extraction through the following steps:
[0055] The Sobel operator is used to calculate the gradient magnitude and gradient direction of each pixel in the image. The gradient magnitude indicates the edge strength of the image at that point, while the gradient direction indicates the direction of the edge.
[0056] Through non-maximum suppression, the gradient amplitude of non-edge points is suppressed, and only the local maximum on the edge is retained. This step can remove redundant information in edge detection and make the edge clearer.
[0057] Set high and low thresholds to distinguish strong edges from weak edges. A high threshold is used to determine obvious strong edges, while a low threshold is used to detect weak edges that may be connected to strong edges.
[0058] Finally, through connectivity analysis, weak edges are connected to strong edges to obtain a complete edge image.
[0059] 4.2. Circular spot detection:
[0060] After obtaining the complete edge image, the edge points are mapped to the parameter space using the Hough circle transform. The Hough circle transform is an algorithm based on a voting mechanism, specifically used to detect circular features:
[0061] According to the gradient direction of the edge point, the center position and radius range of each edge point are determined.
[0062] In the parameter space, an accumulator is set for each possible circle center position and radius. For each edge point, a vote is performed in the accumulator based on its corresponding circle center position and radius.
[0063] The accumulator value represents the number of edge points of the circle corresponding to the center position and radius. When the value of an accumulator exceeds the set threshold, the circle corresponding to the center position and radius is considered to be a valid circular light spot. Through the above steps, the center position and diameter of the circular light spot are finally determined.
[0064] 4.3. Roller shutter machine position judgment and control:
[0065] After detecting the diameter of the circular light spot, the system will determine the current state of the roller shutter machine based on the pre-recorded correspondence between the light spot diameter and the roller shutter machine position:
[0066] When the detected circular light spot diameter is equal to d (the light spot diameter at the upper limit), it is determined that the roller shutter has reached the upper limit. At this time, the power supply of the roller shutter is turned off and the operation of the roller shutter is stopped to prevent the roller shutter from over-rolling.
[0067] When the detected circular light spot diameter is equal to D (the light spot diameter at the lower limit), it is determined that the roller shutter machine has reached the lower limit. At this time, the power supply of the roller shutter machine is also turned off and the operation of the roller shutter machine is stopped to prevent the roller shutter machine from over-expanding.
[0068] Through this image recognition-based method, the present invention can achieve precise control of the upper and lower limits of the rolling machine, avoid the shortcomings of traditional mechanical limit devices, and improve the operating efficiency and reliability of the rolling machine.
[0069] 5. In order to achieve precise control of the opening ratio of the greenhouse insulation curtain, the present invention further expands its functions, not only being able to detect the upper and lower limits of the roller shutter, but also being able to precisely control the opening ratio of the insulation curtain according to the user's settings. The specific implementation method is as follows:
[0070] During the operation of the roller shutter, the distance between the circular indicator light and the camera changes with the roller shutter's position. Through experiments and measurements, we recorded the percentage of the greenhouse thermal curtain open area corresponding to the circular indicator light at different distances. For example, when the roller shutter is in a specific position, the thermal curtain might be 30%, 50%, or 70% open. This method generates a mapping table between distance and area ratio. This mapping table details the correspondence between the roller shutter position (indicated by the distance between the circular indicator light and the camera) and the percentage of the thermal curtain open area.
[0071] Based on the above mapping relationship, when the user needs to set the opening ratio of the greenhouse insulation curtain to a specific value (denoted as k i ), the corresponding mapping distance L can be obtained from the mapping relationship table i According to optical principles, the diameter of the light spot formed by the circular indicator light in the camera sensor is D i It can be calculated by the following formula:
[0072] ;
[0073] Where f is the focal length of the lens, and D0 is the actual diameter of the circular indicator light.
[0074] In the actual operation process, when receiving the greenhouse insulation curtain opening ratio k set by the user i When the system calculates the corresponding spot diameter D according to the above formula i The system then acquires the video image frames in real time, processes and analyzes the image frames, and identifies the spot diameter of the circular indicator light. The system will continue to monitor the changes in the spot diameter until its value is equal to the calculated D i At this point, the system determines that the thermal insulation curtain has reached the opening ratio k set by the user. i , and immediately turn off the power of the roller shutter machine and stop the operation of the roller shutter machine, thereby achieving precise control of the opening ratio of the thermal insulation curtain.
[0075] This method not only enables upper and lower limit control of the roller shutter, but also allows for flexible adjustment of the opening ratio of the thermal curtain according to user needs. This expanded functionality makes roller shutter control more intelligent and user-friendly, meeting the needs of different scenarios. For example, when partial daylight is needed during the day, the user can set the thermal curtain to open 50%; at night or in cold weather, the curtain can be completely closed to maintain the temperature inside the greenhouse. This precise control not only improves greenhouse efficiency but also effectively saves energy and reduces operating costs.
[0076] See also Figure 2As shown, the present invention also includes an upper and lower limit system for a roller shutter machine based on image recognition, which is used to implement the above-mentioned upper and lower limit method for a roller shutter machine based on image recognition, including a camera, a camera setting module, a memory, a circular indicator light, an image processing module and a data processing module, wherein:
[0077] A camera is used to capture video of the circular indicator light during the operation of the roller shutter machine;
[0078] The camera setting module is used to record the distance L between the circular indicator light and the lens when the roller shutter is at the upper limit position, and set the distance between the camera's focal plane and the lens to u, u<La, where a represents the depth of field range of the lens;
[0079] The circular indicator light is used to turn on when the roller shutter machine is in operation and to indicate the position of the roller shutter machine;
[0080] The memory is used to record the diameter d of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the upper limit position; and to record the diameter D of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the lower limit position;
[0081] The image processing module is used to obtain video image frames in real time when the greenhouse insulation curtain is opened or closed, and pre-process the image frames to identify the circular light spots in the image frames and obtain the diameter of the circular light spots;
[0082] The data processing module is used to determine that the roller shutter machine is at the upper limit when the diameter of the circular light spot is equal to d, and output a power-off command for the roller shutter machine; when the diameter of the light spot is equal to D, it is determined that the roller shutter machine is at the lower limit and output a power-off command for the roller shutter machine.
[0083] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters and thresholds in the formulas are set by technicians in this field according to actual conditions.
[0084] The above embodiments can be implemented in whole or in part via software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in the embodiments of this application are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0085] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0086] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules 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 this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as 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 interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0088] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0089] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0090] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. 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. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute 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] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0092] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for upper and lower position limiting of a rolling curtain machine based on image recognition, applied to a self-propelled greenhouse rolling curtain machine, characterized in that: The following steps are involved: A camera is set up just above the top of the greenhouse, and a circular indicator light is set on the surface of the main motor of the roller shutter. When the roller shutter is at the upper limit, the distance L between the circular indicator light and the lens is recorded. The distance between the camera's focal plane and the lens is set to u, u < La, where a represents the depth of field range of the lens. Record the diameter d of the circular spot of the circular indicator light on the camera sensor when the roller shutter is at the upper limit position; Record the diameter D of the circular spot of the circular indicator light on the camera sensor when the roller shutter is at the lower limit position; When opening or closing the greenhouse insulation curtain, video image frames are acquired from the camera in real time, pre-processed, and the circular light spot in the image frame is identified and its diameter is obtained. When the insulation curtain is opened, if the diameter of the circular light spot is equal to d, the roller is determined to be at the upper limit and the power of the roller is turned off. When the insulation curtain is closed, if the diameter of the circular light spot is equal to D, the roller is determined to be at the lower limit and the power of the roller is turned off. Obtain the minimum circumscribed rectangle of the light spot of the circular indicator light in the camera sensor when the roller shutter is at the lower limit position, set the area within the minimum circumscribed rectangle as the detection area, and when the roller shutter is running, only perform light spot recognition in the detection area.
2. The method for upper and lower position limiting of a roller shutter machine based on image recognition according to claim 1, characterized in that: Record the corresponding opening area ratio of the greenhouse insulation curtain at different distances between the circular indicator light and the camera, and generate a mapping relationship between distance and area ratio. When the opening ratio of the greenhouse insulation curtain is set to k i When , the corresponding mapping distance L is obtained from the mapping relationship i , then the mapping distance L i Corresponding spot diameter D i The calculation formula is: ; Where f represents the focal length of the lens, D0 represents the actual diameter of the circular indicator light, then when the opening ratio of the greenhouse insulation curtain is received, i When the diameter of the circular indicator light in the video image frame is equal to D i , turn off the power of the roller shutter machine.
3. The method for upper and lower position limiting of a roller shutter machine based on image recognition according to claim 1, characterized in that: The upper limit position is the position of the roller shutter when the greenhouse thermal insulation curtain is fully rolled up; the lower limit position is the position of the roller shutter when the greenhouse thermal insulation curtain is fully unfolded.
4. The method for upper and lower position limiting of a roller shutter machine based on image recognition according to claim 1, characterized in that: The pre-processing process is as follows: The image frame is converted into a grayscale image. Based on the matrix template of the Laplace operator, each pixel point and adjacent pixel points in the grayscale image are multiplied by the values in the matrix template respectively, and the sum of all products is calculated. The sum value is marked as the new grayscale value of the intermediate pixel point, and the grayscale values of all pixels in the image frame are updated respectively.
5. The method for upper and lower position limiting of a roller shutter machine based on image recognition according to claim 1, characterized in that: The process of identifying the circular light spot in the image frame and obtaining the diameter of the circular light spot is as follows: Perform Gaussian filtering on the grayscale image and perform edge detection on the grayscale image using the Canny algorithm. Use the Sobel operator to calculate the gradient amplitude and direction, suppress non-edge points, retain the local maximum on the edge, and distinguish strong and weak edges through high and low thresholds. Obtain a complete edge image through connectivity analysis. The edge points are mapped to the parameter space using the Hough circle transform. The center and radius range are determined according to the gradient direction and voted in the accumulator. When the accumulator value exceeds the set threshold, the circle corresponding to the center and radius within the edge is determined to be a valid circle, and the diameter of the circular spot is detected.
6. The method for upper and lower position limiting of a roller shutter machine based on image recognition according to claim 1, characterized in that: The camera and the circular indicator light are only turned on during the operation of the roller shutter machine.
7. An upper and lower limit system for a roller shutter machine based on image recognition, used to implement an upper and lower limit method for a roller shutter machine based on image recognition according to any one of claims 1 to 6, characterized in that: It includes a camera, a camera setting module, a memory, a circular indicator light, an image processing module and a data processing module, wherein: A camera is used to capture video of the circular indicator light during the operation of the roller shutter machine; The camera setting module is used to record the distance L between the circular indicator light and the lens when the roller shutter is at the upper limit position, and set the distance between the camera's focal plane and the lens to u, u<La, where a represents the depth of field range of the lens; The circular indicator light is used to turn on when the roller shutter machine is in operation and to indicate the position of the roller shutter machine; The memory is used to record the diameter d of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the upper limit position; and to record the diameter D of the circular spot of the circular indicator light in the camera sensor when the roller shutter is at the lower limit position; The image processing module is used to obtain video image frames from the camera in real time when the greenhouse insulation curtain is opened or closed, and pre-process the image frames, identify the circular light spots in the image frames, and obtain the diameter of the circular light spots; The data processing module is used to determine that the roller shutter machine is at the upper limit position when the diameter of the circular light spot is equal to d during the process of opening the thermal insulation curtain, and output a power-off command for the roller shutter machine; when the diameter of the circular light spot is equal to D during the process of closing the thermal insulation curtain, it is used to determine that the roller shutter machine is at the lower limit position and output a power-off command for the roller shutter machine.
Citation Information
Patent Citations
Device and method for virtually processing depth image
CN105163042A
Lens parameter calibration method based on equivalent coaxial spherical optical system
CN111862233A
Warmhouse booth rolls up curtain stroke measurement and control device and warmhouse booth
CN207543801U