Equipment control method and device, electronic equipment and storage medium

By using image acquisition and processing technology in drinking water equipment, identifying the water inlet of the container and monitoring the water level in real time, the water overflow problem caused by users' inattention is solved, and the safety and user experience of the equipment are improved.

CN118892269APending Publication Date: 2024-11-05WUHU MIDEA KITCHEN & BATH APPLIANCES MFG CO LTD

Patent Information

Application Number
CN202411024594.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

Existing drinking water equipment can easily cause water overflow when users are not focused, reducing user experience.

Method used

The image below the water outlet device is captured by the image acquisition device, a grayscale image is generated, the water inlet of the container is identified, and the water level is monitored in real time. If the distance between the water level and the water inlet is less than the preset threshold, the water outlet will be stopped to prevent liquid from overflowing.

Benefits of technology

Effectively prevent liquid from overflowing, improve user experience, improve the efficiency of identifying water inlets in different containers, and enhance the safety of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118892269A_ABST
    Figure CN118892269A_ABST
Patent Text Reader

Abstract

The invention provides an equipment control method and device, electronic equipment and a storage medium, the method is applied to the field of drinkers, and the method comprises the following steps: when it is detected that a container exists at a water outlet of water outlet equipment, obtaining a grayscale image for the container; determining a water inlet of the container from the grayscale image; controlling the water outlet equipment to discharge water to the container, and acquiring the real-time water level of the liquid in the container; and when the distance between the real-time water level and the water inlet is smaller than the preset distance threshold value, the water outlet equipment is controlled to stop discharging water to the container, so that potential safety hazards caused by liquid overflow are effectively prevented, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of water dispensers, and in particular to a device control method, device, electronic device and storage medium. Background Art

[0002] In daily life, drinking water equipment is widely used as a device for heating or cooling water. In related technologies, users are often required to manually control the water output or water output duration of the drinking water equipment. However, when the user is not concentrating, water will overflow and cause harm to the user, thereby reducing the user's experience. Summary of the invention

[0003] This application provides a device control method, apparatus, electronic device and storage medium, aiming to perform real-time dynamic control of water outlet equipment, thereby improving the user experience. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a device control method, which is applied to a water outlet device, and the method includes:

[0005] When it is detected that there is a container at the water outlet of the water outlet device, a grayscale image of the container is acquired;

[0006] Determine the water inlet of the container from the grayscale image;

[0007] Control the water outlet device to discharge water into the container and obtain the real-time water level of the liquid in the container;

[0008] When the distance between the real-time water level and the water inlet is less than a preset distance threshold, the water outlet device is controlled to stop discharging water to the container.

[0009] In a second aspect, an embodiment of the present application provides a device control apparatus, including:

[0010] A detection unit, configured to obtain a grayscale image of the container when detecting that there is a container at the water outlet of the water outlet device;

[0011] a water inlet identification unit, configured to determine the water inlet of the container from the grayscale image;

[0012] A water level acquisition unit, configured to control the water outlet device to discharge water into the container and obtain the real-time water level of the liquid in the container;

[0013] The control unit is configured to control the water outlet device to stop discharging water to the container when the distance between the real-time water level and the water inlet is less than a preset distance threshold.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, any of the above device control methods is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, any of the above device control methods is implemented.

[0016] In the embodiment of the present application, when a container is detected to be placed at the water outlet of the water outlet device, the image of the container is automatically captured by the image acquisition device of the water outlet device and a grayscale image is generated, and the position of the water inlet of the container is accurately identified by image processing technology, thereby improving the recognition efficiency of the water inlets of different containers. By starting to discharge water into the container after identifying the water inlet of the container and monitoring the real-time changes of the water level in the container at the same time, once the distance between the water level and the water inlet of the container reaches the preset safety distance threshold, the water outlet device will be controlled to stop automatically, thereby effectively preventing the safety hazards caused by liquid overflow, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 It is a scene schematic diagram of a device control method provided in an embodiment of the present application;

[0019] Figure 2 It is a flow chart of a device control method provided in an embodiment of the present application;

[0020] Figure 3 It is a scene schematic diagram of a device control method provided in an embodiment of the present application;

[0021] Figure 4 It is a flow chart of a device control method provided in an embodiment of the present application;

[0022] Figure 5 It is a flow chart of a device control method provided in an embodiment of the present application;

[0023] Figure 6 It is a scene schematic diagram of a device control method provided in an embodiment of the present application;

[0024] Figure 7 It is a flow chart of a device control method provided in an embodiment of the present application;

[0025] Figure 8 It is a flow chart of a device control method provided in an embodiment of the present application;

[0026] Fig. 9 It is a scene schematic diagram of a device control method provided in an embodiment of the present application;

[0027] Fig.10 It is a structural schematic diagram of a device control device provided in an embodiment of the present application;

[0028] Fig.11 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0030] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0031] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0032] In order to improve the safety of the use of water outlet equipment, the embodiment of the present application provides a device control method, the execution subject of the device control method is the water outlet equipment, wherein the water outlet equipment can be a water dispenser, a faucet, a water purifier, etc. The following are described in detail. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Figure 1 , Figure 1This is a system architecture diagram of a device control method provided in an embodiment of the present application. The specific process of the device control method can be as follows:

[0033] Figure 1 It is a scenario diagram of a device control method provided in an embodiment of the present application.

[0034] The water outlet device includes an image acquisition device and a water outlet, wherein the image acquisition device is used to capture the image of the area below the water outlet in real time. The shooting angle of the image acquisition device is determined according to the actual use scenario and is not specifically limited here. The image of the area below the water outlet includes a foreground image and a background image, wherein the foreground image is an image taken when any container is detected, and the background image is an image that does not contain a container. In order to facilitate the calculation of the real-time water level of the liquid in the container, it is necessary to convert the foreground image and the background image into grayscale images, and further determine the water inlet of the container and the real-time water level in the container from the grayscale image. When the relative distance between the real-time water level and the water inlet is less than the preset distance, the water outlet of the water outlet device is controlled to stop discharging water.

[0035] Specifically, when the water outlet device is in the standby state, the image acquisition device will monitor the image at the water outlet in real time by using the difference frame method, wherein the difference frame method is a method for obtaining the contour of a moving target by performing a difference operation on two adjacent frames in a video image sequence, and is applicable to monitoring whether a new object appears between the current frame image and the previous frame image in the monitoring scene. In this solution, the user monitors whether there is a container in the current frame image at the water outlet compared with the previous frame image. When it is detected that there is a container in the current frame, the current frame image containing the container is used as the foreground image. Since the foreground image contains part of the background image, in order to filter the part of the image, the background image is converted into a background grayscale image and the foreground image is converted into a foreground grayscale image respectively. For the background grayscale image and the foreground grayscale image, the sliding window processing is used to subtract the average grayscale value of each area of ​​the pixel in the foreground grayscale image from the average grayscale value of each area of ​​the pixel in the background grayscale image to eliminate the difference in pixel grayscale values, so as to generate a grayscale image for the container.

[0036] The grayscale image of the container is divided into a preset number of regional grayscale images, and the target feature points in each regional grayscale image are extracted respectively. The target feature points are randomly combined according to the preset number to obtain a plurality of feature circle sets, wherein each feature circle is composed of at least three target feature points. Each feature circle in the feature circle set is analyzed, and the feature circle containing the largest number is determined as the water inlet of the container. After the water inlet is determined, the water outlet device is controlled to start discharging water into the container. At the same time, since the water level in the container is in a dynamic change process during the water outlet process, at this time, in order to prevent the liquid from overflowing, the inter-frame difference method is used to continuously obtain multiple frames of grayscale images to generate a water level feature map of the container, wherein the water level feature map is used to display the real-time change data of the liquid inside the container. The pixels in different areas of the water level characteristic map have different grayscale values. In order to balance the pixel values ​​of each area in the water level characteristic map, a fixed threshold binarization is used to fix the pixel values ​​in the water level characteristic map to further improve the accuracy of real-time liquefaction. The fixed threshold binarization is to set the grayscale value of the pixel on the grayscale image to 0 or 255, and classify it according to the preset grayscale threshold, that is, the pixels greater than the grayscale threshold are set to white, and the pixels less than or equal to the grayscale threshold are set to black. Afterwards, the frame difference method is used to continuously obtain multiple water level characteristic maps to determine the real-time water level of the liquid in the container, and when the relative distance between the real-time water level and the water inlet is less than the preset distance threshold, the water outlet of the water outlet device is controlled to stop discharging water into the container.

[0037] It should be noted that, from the experimental data, it can be seen that when the binarized pixels in the water level feature map are converted into a histogram for representation, it can be seen that the pixel values ​​of the water level area are continuous in the histogram, while the pixel values ​​of the interference pixels are discontinuous in the histogram. The pixels showing discontinuity are specifically interference pixels, namely, the pixels of the falling liquid when the water outlet is discharging water and the interference pixels formed on the container wall due to the reflection caused by the container material.

[0038] based on Figure 1 The scene diagram shown below will be combined with Figure 2-Figure 7 , a device control method provided in an embodiment of the present application is introduced in detail.

[0039] Based on the above situation, the present application embodiment proposes a device control method. Figure 2 , Figure 2 is a flow chart of a device control method provided in an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps S101-S104.

[0040] S101, when it is detected that there is a container at the water outlet of the water outlet device, a grayscale image of the container is obtained.

[0041] In this embodiment, an image acquisition device is installed at the water outlet of the water outlet device, and the image acquisition device is used to collect image data of a preset viewing range at the water outlet in real time when the water outlet device is in a standby state, wherein the collected image data includes a background image and a foreground image of the water outlet device, wherein the background image is image data when there is no container placed under the water outlet, and the foreground image is image data when there is a container placed under the water outlet.

[0042] Specifically, when the water outlet device is in the standby state, the image acquisition device is controlled to use the difference frame method to obtain the current frame image below the water outlet in real time and compare it with the background image, and the current frame image is determined as the foreground image when the container feature is detected in the current frame. After the foreground image is determined, the water outlet device will enter the pre-water outlet state. In the pre-water outlet state, in order to determine that the water outlet of the water outlet device corresponds to the water inlet of the container, the background image is converted into a background grayscale image, and the foreground image is converted into a foreground grayscale image. The pixel average values ​​of each area of ​​the background grayscale image and the foreground grayscale image are determined respectively to perform pixel averaging processing, and finally a grayscale image for the container is obtained, in which the interference area outside the area where the container is located relative to the background image is removed.

[0043] Please also read Figure 3 , Figure 3 It is a scenario diagram of a device control method provided in an embodiment of the present application.

[0044] like Figure 3 As shown, the image acquisition device captures the image data below the water outlet in real time at a certain shooting angle, and uses the image data of any container not included as the background image. When in the standby state, the water outlet device uses the difference frame method to continuously obtain the image data below the water outlet, and compares the image data of the current frame with the background image to monitor whether there is a container under the water outlet. If it is determined that there is a container in the current frame image after comparing and analyzing the current frame image with the background image, the current frame image is determined as the foreground image. The background image is converted into a background grayscale image, and the foreground image is converted into a foreground grayscale image. The pixel average values ​​of each area of ​​the background grayscale image and the foreground grayscale image are determined respectively to perform pixel averaging processing, and finally a grayscale image for the container is obtained, in which the interference area outside the area where the container is located is removed.

[0045] S102, determining the water inlet of the container from the grayscale image.

[0046] In this embodiment, since there are a large number of interfering pixels in the grayscale image, in order to determine the water inlet of the container from the grayscale image, it is necessary to perform circle fitting on the grayscale image.

[0047] Specifically, the grayscale image is evenly divided into a preset number of regional images along the x direction, and for each regional image, the position information of the pixels in each regional image is obtained to generate a regional pixel coordinate map. The position of each pixel in each regional image is marked in the form on the left in the regional pixel coordinate map, and the pixel with the largest y-axis in each regional pixel coordinate map is determined as the target feature point.

[0048] A preset number of regional images are randomly selected using a random algorithm, and target feature points of the regional images in the selected state are obtained, and the target feature points of the regional images in the selected state are connected to generate a feature circle set, wherein each feature circle in the feature circle set is composed of at least three target feature points. Each feature circle in the feature circle set is traversed and analyzed, that is, the number of target feature points contained in each feature circle is determined, and the feature circle containing the last number of target feature points is determined as the water inlet of the container.

[0049] S103, controlling the water outlet device to outlet water to the container, and obtaining the real-time water level of the liquid in the container.

[0050] In an embodiment of the present application, after the water inlet of the container is determined, the water outlet device is switched from the pre-water outlet state to the water outlet state, and the real-time water level inside the container is obtained at the same time to prevent the liquid inside the container from overflowing.

[0051] Specifically, when the water discharge device starts to discharge water into the container, a grayscale image of the container is obtained at a preset time interval through the difference frame method, and the grayscale image of the current frame is compared with the grayscale image obtained in the previous frame to generate a water level characteristic map of the liquid inside the container. The characteristic pixels represented in the water level characteristic map are pixels with grayscale values ​​greater than the grayscale threshold. All pixels in the water level characteristic map that are greater than the grayscale threshold are obtained, and the pixels are binarized with a fixed threshold at the same time, wherein the fixed threshold binarization is an image processing method that can set the grayscale value of the pixel point to 0 or 255, so that the entire grayscale image presents a visual effect of only black and white. The coordinate position of each pixel after the fixed threshold binarization process is obtained, and the pixel with the largest coordinate position in the water level characteristic map of the current frame is determined as the real-time water level of the container.

[0052] S104, when the distance between the real-time water level and the water inlet is less than a preset distance threshold, controlling the water outlet device to stop outlet water to the container.

[0053] Specifically, a water level feature map corresponding to the grayscale image of the current frame is obtained to determine the real-time water level inside the container. Since the water inlet of the container has been determined in the above step S102, it is necessary to determine the pixel with the largest coordinate position in the water level feature map, that is, the relative distance between the real-time water level and the water inlet of the container. If the distance between the real-time water level and the water inlet is monitored to be less than the preset distance threshold, the water outlet of the water outlet device is controlled to stop discharging water.

[0054] As can be seen from the above, when a container is detected to be placed at the water outlet of the water outlet device, the image acquisition device of the water outlet device automatically captures the image of the container and generates a grayscale image, and accurately identifies the position of the water inlet of the container through image processing technology, thereby improving the recognition efficiency of the water inlets of different containers. By starting to discharge water into the container after identifying the water inlet of the container, and monitoring the real-time changes of the water level in the container at the same time, once the distance between the water level and the water inlet of the container reaches the preset safety distance threshold, the water outlet device will be controlled to stop automatically, thereby effectively preventing the safety hazards caused by liquid overflow, thereby improving the user experience.

[0055] Since there is a lot of redundant data in the background image and foreground image, it is necessary to filter the redundant data to improve the data processing speed. Figure 4 , Figure 4 is a flow chart of a device control method provided in an embodiment of the present application. Figure 4 As shown, the method of the embodiment of the present application may include the following steps S201-S205.

[0056] S201, respectively acquiring a background image at a water outlet and a foreground image at a water outlet.

[0057] S202, generating a grayscale image based on the background image and the foreground image.

[0058] Specifically, in S201-S202, when the water outlet device is in the standby state, the image acquisition device is controlled to use the difference frame method to obtain the current frame image below the water outlet in real time and compare it with the background image, and the current frame image is determined as the foreground image when the container feature is detected in the current frame. After determining the foreground image, the water outlet device will enter the pre-water outlet state, in which the background image is converted into a background grayscale image, and the foreground image is converted into a foreground grayscale image, and the pixel average values ​​of each area of ​​the background grayscale image and the foreground grayscale image are determined respectively to perform pixel averaging processing, and finally a grayscale image for the container is obtained.

[0059] S203, converting the background image into a background grayscale image, and converting the foreground image into a first foreground grayscale image.

[0060] Specifically, the image processing algorithms are used for the acquired background image and foreground image in a time-sharing manner, such as the weighted average method and the simple average method, which are not specifically limited here, wherein the weighted average method assigns weights according to the sensitivity of the human eye to different colors, while the simple average method averages the values ​​of the three color channels of RGB for each pixel in the background image and the foreground image. Then, the corresponding conversion formula is applied according to the selected image processing algorithm, for example, the formula of the weighted average method is gray value = 0.299*R + 0.587*G + 0.114*B, and the formula of the simple average method is gray value = (R + G + B) / 3, and the calculated gray value is applied to each pixel in the original image of the background image and the foreground image to create a new gray image, wherein the size of the gray image corresponding to the background image and the foreground image is the same as the original image, but each pixel has only one gray value.

[0061] S204, obtaining a first local pixel average value of the background grayscale image, and obtaining a second local pixel average value of the first foreground grayscale image.

[0062] Specifically, the background grayscale image and the first foreground grayscale image are further divided into local area images of the same size, and the pixel average values ​​of each local area image are traversed in a sliding window processing manner.

[0063] S205, determining a grayscale image based on the local pixel average value difference.

[0064] Specifically, the local pixel average values ​​of each area obtained from the background grayscale image and the local pixel average values ​​of each area of ​​the first foreground grayscale image are sequentially difference-calculated to generate new local pixel values, and a grayscale image is generated based on the local pixel values.

[0065] It should be noted that when the difference in local pixel average values ​​is large, it means that the contrast between the background grayscale image and the first foreground grayscale image is high, and the outline of the container can be more clearly represented. When the difference in local pixel average values ​​is small, it means that the contrast between the background grayscale image and the first foreground grayscale image is low. For example, the average pixel value of the first local area in the acquired background grayscale image is 13.33, and the second local pixel average value of the first foreground grayscale image is 10.67. At this time, the difference between the two local pixel average values ​​is subtracted to obtain a new pixel value of 13.33-10.67=2.66, and the difference between the average values ​​of all local pixels in the background grayscale image and the first foreground grayscale image is obtained to generate the grayscale image.

[0066] As can be seen from the above, by capturing the background image and foreground image at the water outlet respectively, the background image is a pure image without a container, and the foreground image contains the actual container. By converting the background image and the foreground image into grayscale images, respectively, the pixel averages of the background grayscale image and the foreground grayscale image in the local area are further calculated, and the pixel difference, that is, the local pixel average difference, is obtained. Thereby, the outline and details of the container are presented more clearly. Based on this optimized grayscale image, the water inlet of the container can be accurately located, providing an accurate reference for subsequent water discharge operations, thereby improving the accuracy of water inlet recognition.

[0067] Since there are a large number of pixels in a grayscale image, it is necessary to divide the grayscale image into granularities to improve the accuracy of determining the grayscale value of each pixel in the grayscale image. Figure 5 , Figure 5 is a flow chart of a device control method provided in an embodiment of the present application. Figure 5 As shown, the method of the embodiment of the present application may include the following steps S301-S307.

[0068] S301, dividing the grayscale image into regions to obtain a plurality of region images.

[0069] Specifically, the grayscale image is evenly divided into a preset number of regional images along the x direction. For example, the grayscale image is evenly divided into 20 regional images along the x direction.

[0070] S302, combining feature points of each area image to determine the water inlet.

[0071] Specifically, the pixel points whose pixel grayscale values ​​in each regional image are greater than the grayscale threshold are determined as the feature points, wherein each regional image includes at least one feature point. Then, the coordinate values ​​of the feature points in each regional image are obtained to determine the target feature points corresponding to each regional image, and then a preset number of regional images are selected by random calling, and the target feature points in the selected regional images are connected to determine the water inlet of the container.

[0072] S303, dividing the grayscale image into a preset number of region images, each region image containing at least one feature point.

[0073] S304, obtaining the coordinate value of each feature point in each region image.

[0074] Specifically, in S303-S304, the grayscale image is evenly divided into a preset number of regional images, for example, into 20 regional images, and then the pixel points in each regional image that are greater than a preset grayscale value threshold are marked as feature points, and a feature point coordinate map in each regional image is generated, in which the X-coordinate point and Y-axis coordinate point of each feature point are marked.

[0075] S305: Determine the feature point with the largest coordinate value in each region image as the target feature point, and generate a feature circle set based on the target feature point.

[0076] Specifically, based on the feature point coordinate map obtained in S304, the feature point with the largest Y axis in the feature point coordinate map corresponding to each regional image is determined as the target feature point. A preset number of regional images are selected by random calling, and the target feature points in the selected regional images are obtained and connected to generate a feature circle. The preset number of target feature points randomly selected from all regional images are randomly combined to obtain the feature circle set.

[0077] S306, obtaining the number of feature points of the target feature points contained in each feature circle in the feature circle set.

[0078] S307, determining the characteristic circle with the largest number of characteristic points in the characteristic circle set as the water inlet.

[0079] Specifically, in S306-S307, a traversal operation is performed on the feature circle set to determine the number of target feature points contained in the line segments of each feature circle in the feature circle set, and the feature circle containing the largest number of target feature points is determined as the water inlet. For example, there are 3 feature circles in the feature circle set, namely feature circle A, feature circle B and feature circle C, among which the line segments of feature circle A contain 5 target feature points, the line segments of feature circle B contain 10 target feature points and the line segments of feature circle C contain 20 target feature points. Since the line segments of feature circle C contain the most target feature points, feature circle C is determined as the water inlet of the container.

[0080] Please also read Figure 6 , Figure 6 It is a scenario diagram of a device control method provided in an embodiment of the present application.

[0081] like Figure 6As shown, the grayscale image is divided into a preset number of regional images, and the pixel coordinate map of each regional image is obtained respectively. The pixel coordinate map shows the feature points whose grayscale values ​​are greater than the grayscale threshold, and the feature points with the maximum value of the Y axis of the pixel coordinate image are determined as the target feature points. The target feature points of three regional images are randomly selected and connected to form a feature circle, and the number of other target feature points contained in each feature circle is determined to determine the water inlet of the container.

[0082] As can be seen from the above, by dividing the grayscale image into multiple smaller regional images, the processing accuracy of each region is improved. By identifying the pixel points whose grayscale values ​​exceed the preset threshold in each regional image, and determining the coordinate values ​​of the feature points in each regional image, and finding the feature point with the largest coordinate value in each region, it is defined as the target feature point, and a feature circle set is generated around these target feature points, and the number of target feature points contained in each feature circle in the feature circle set is calculated to determine the water inlet of the container, thereby ensuring the recognition accuracy and robustness of the water inlet of the container.

[0083] In order to improve the precise control of the water discharge equipment to the container. Figure 7 , Figure 7 is a flow chart of a device control method provided in an embodiment of the present application. Figure 7 As shown, the method of the embodiment of the present application may include the following steps S401-S405.

[0084] S401, obtaining continuous frame images of a water inlet during a period when a water outlet device is discharging water into a container.

[0085] S402: Obtain a first water level change image based on continuous frame images.

[0086] Specifically, in S401-S402, when the water outlet device is in the water outlet state, a plurality of continuous frame images at the water inlet of the container are acquired by using the difference frame method, and a first water level change image is determined based on the current frame image.

[0087] S403, performing equalization processing on the pixel points whose grayscale value is greater than the grayscale threshold in the first water level change image to obtain a second water level change image.

[0088] In an embodiment of the present application, the main purpose of equalizing the pixels greater than the grayscale threshold in the first water level change image is to enhance the image contrast, making the water level line more clearly visible in the image, thereby improving the accuracy and reliability of water level detection. The equalization processing adjusts the grayscale value distribution of the pixels in the image to make the brightness and contrast of the image more uniform, especially for important features such as the water level line, which can make it more prominent in the image and facilitate subsequent image analysis and processing.

[0089] Specifically, the first water level change image is preprocessed, including denoising and enhancement, to improve image quality. The pixels in the image are divided into two categories, greater than and less than the grayscale threshold, by threshold segmentation. For pixels greater than the grayscale threshold, an equalization processing algorithm (such as adaptive histogram equalization or deep learning technology) is used for optimization to reduce the influence of factors such as uneven light and reflection. Edge detection and refinement are then performed to obtain a more accurate water level edge. The water level line is optimized by connectivity processing and smoothing processing to generate a second water level change image.

[0090] S404: Fix the pixel values ​​of the pixels in the second water level change image to generate a water level feature map.

[0091] S405, determining the real-time water level of the liquid in the container based on the water level characteristic diagram.

[0092] Specifically, in S404-S405, a preset grayscale threshold is called, and the preset grayscale threshold will be used to set the pixel points in the image to the fixed value. Each pixel point in the second water level change image is traversed, and the pixel values ​​of the pixel points greater than or equal to the preset grayscale threshold are set to a fixed grayscale value, while the original pixel values ​​of other pixels are kept unchanged. Finally, a processed water level feature map is obtained, in which the area greater than or equal to the grayscale threshold presents a fixed pixel grayscale value, thereby highlighting the water level information. For example, there is a second water level change image with a grayscale range of 0 to 255 and a preset grayscale threshold of 128. A simple denoising process is performed on the second water level change image, such as using a median filter to remove salt and pepper noise in the image. Each pixel point in the second water level change image is traversed, and for each pixel point, its grayscale value is checked to see if it is greater than or equal to the preset grayscale threshold. If so, the pixel value of the pixel point is set to 255, otherwise, its original pixel value is kept unchanged.

[0093] As can be seen from the above, by continuously capturing continuous frame images at the water inlet of the container during the time period when the water outlet device discharges water to the container, the continuous frame images are processed to generate a first water level change image to obtain the liquefaction change data in the container in real time. The second water level change image is obtained by performing equalization processing on the pixels whose grayscale values ​​exceed the set threshold in the first water level change image to enhance the contrast of the water level change and make the water level boundary more obvious. The water level feature map is generated by fixing the pixels in the second water level change image to ensure the stability and reliability of the water level feature.

[0094] In order to further improve the precise control of water output of water output equipment. Figure 8 , Figure 8 is a flow chart of a device control method provided in an embodiment of the present application. Figure 8As shown, the method of the embodiment of the present application may include the following steps S501-S506.

[0095] It should be noted that containers of different materials have different transmittance and reflectivity, so there are large differences in the grayscale values ​​of pixels in their corresponding grayscale images, and the water level feature map is an image obtained by combining pixels of different grayscale values ​​inside the container. Therefore, in order to ensure the accuracy of the acquired water level feature map, it is necessary to filter the pixels in the water level feature map to equalize the pixels in the water level feature map.

[0096] S501, obtaining a second foreground grayscale image after a preset water outlet time, and performing a difference between the second foreground grayscale image and the background grayscale image to obtain a differential grayscale image.

[0097] Specifically, when the water outlet device is in the water outlet state and the water outlet time is greater than the preset time threshold, the image acquisition device is controlled to obtain a second foreground grayscale image, and a pixel-by-pixel difference operation is performed on the second foreground grayscale image and the background grayscale image obtained in advance to generate the differential grayscale image, wherein the pixel changes in the second foreground grayscale image will be highlighted in the differential grayscale image.

[0098] S502, obtaining a plurality of preset grayscale thresholds, and obtaining the grayscale value of each pixel in the differential grayscale image.

[0099] S503, determining the number of first pixels in the differential grayscale image whose grayscale values ​​are less than each preset grayscale threshold and whose grayscale values ​​are not zero, and obtaining the number of first pixels corresponding to each preset grayscale threshold.

[0100] Specifically, in S502-S503, in order to determine the preset grayscale depressive quality that meets the container collection, multiple preset grayscale thresholds are called respectively to test the number of first pixels in the differential grayscale image whose grayscale values ​​are less than each preset grayscale threshold and whose grayscale values ​​are not zero, and mark the pixel points as first pixels.

[0101] S504, obtaining the number of second pixel points whose grayscale values ​​are not zero in the differential grayscale image.

[0102] Specifically, all the pixels in the differential grayscale image are traversed and filtered to obtain the number of pixels whose grayscale values ​​are not zero in the differential grayscale image, and record them as the second pixel points.

[0103] S505, calculating the ratio of the number of first pixels to the number of second pixels corresponding to each preset gray threshold, and obtaining the pixel ratio corresponding to each preset gray threshold.

[0104] S506: If there is a target grayscale threshold whose pixel ratio is greater than the preset ratio threshold in the preset grayscale thresholds, the target grayscale threshold is determined as the preset grayscale threshold.

[0105] Specifically, in S505-S506, the second pixel point is a pixel point whose grayscale value in the differential grayscale image is not zero, and the first pixel point is a pixel point whose grayscale value in the differential grayscale image is less than each preset grayscale threshold and whose grayscale value is not zero. The total number of the first pixel points is obtained, and the ratio of the number of the second pixel points to the total number of the first pixel points is calculated to determine whether the tested preset grayscale threshold can match the material image of the container. For example, the grayscale threshold whose ratio of the number of the first pixel points to the number of the second pixel points is greater than 10% is used as the preset grayscale threshold. When the first preset grayscale threshold is 200, the number of the second pixel points in the differential grayscale image is 1000, and the number of the first pixel points is 500. At this time, the ratio is (500 / 1000)*100%=50%, that is, greater than 10%. Then, the first preset grayscale threshold is used as the target grayscale threshold, and the target grayscale threshold is determined as the preset grayscale threshold.

[0106] As can be seen from the above, after the water outlet device discharges water into the container for a preset time, a second foreground grayscale image is obtained, and it is differentially processed with the previous background grayscale image to obtain a differential grayscale image. This step effectively highlights the changing part of the liquid in the container. By selecting multiple preset grayscale thresholds, and analyzing the grayscale value of each pixel in the differential grayscale image. By comparing the grayscale value of each pixel with the preset grayscale threshold, it is possible to identify pixels whose grayscale values ​​are less than the threshold but not zero, and calculate the number of pixels whose grayscale values ​​are less than the threshold but not zero to determine the edge of the liquid. By calculating each preset grayscale threshold, the pixel ratio is obtained to evaluate the detection effect of the liquid under different thresholds. By screening out the target grayscale threshold whose pixel ratio exceeds the preset ratio threshold, and determining it as the final preset grayscale threshold, the accuracy and safety of the water outlet process can be ensured.

[0107] Optionally, when light shines on the container, strong reflections are generated. These reflective points may look like part of the water level line on the image, but they are not actually the real water level. At the same time, when liquid is input into the container, a water column is formed. This water column will also generate pixel values ​​on the image, which may interfere with the accurate detection of the water level. This means that it is necessary to identify which pixels are interfering pixels and exclude the interfering pixels from the water level feature map. By converting the pixel coordinate values ​​of each area in the water level feature map into a histogram, it is possible to monitor whether there are discontinuities in the pixel data in the histogram, where discontinuities are often caused by interference factors (such as reflections or water columns). In this case, it is believed that the discrete points below the discontinuity points are also caused by the same interference factors, so they should not be considered as part of the water level line. These points also need to be identified and excluded.

[0108] Please also read Fig. 9 , Fig. 9 is a schematic diagram of a scenario of a device control method provided in an embodiment of the present application, such as Fig. 9 As shown, the histogram image is obtained by data mapping the pixel coordinate values ​​of all pixel points in the water level feature map. The dotted line area in the histogram is the discrete data of the interference pixel points. Since the discrete pixel points and the aggregated pixel points in the liquid surface area are in different areas, the data presentation in the histogram is discrete. At this time, the pixel points in the discrete area are filtered to ensure the accuracy of the liquid surface data.

[0109] based on Figure 1 The system architecture will be combined with Fig.10 , the device control device provided in the embodiment of the present application is introduced in detail. It should be noted that, Fig.10 The device control device in the present application is used to execute Figure 2-Figure 8 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 2-Figure 8 In the embodiment shown, the equipment control device 600 may include a detection unit 601, a water inlet identification unit 602, a water level acquisition unit 603 and a control unit 604, as follows:

[0110] The detection unit 601 is configured to obtain a grayscale image of the container when detecting that there is a container at the water outlet of the water outlet device;

[0111] A water inlet identification unit 602, configured to determine the water inlet of the container from the grayscale image;

[0112] The water level acquisition unit 603 is configured to control the water outlet device to discharge water into the container and obtain the real-time water level of the liquid in the container;

[0113] The control unit 604 is configured to control the water outlet device to stop discharging water to the container when the distance between the real-time water level and the water inlet is less than a preset distance threshold.

[0114] In some embodiments, the receiving strategy detection unit 601 further includes an image acquisition unit and an image generation unit.

[0115] An acquisition unit, configured to respectively acquire a background image at the water outlet and a foreground image at the water outlet, wherein the background image is an image not including the container, and the foreground image is an image including the container;

[0116] The image generating unit is configured to generate a grayscale image based on the background image and the foreground image.

[0117] In some embodiments, the detection unit 601 further includes an image conversion unit, a pixel value acquisition unit, a pixel difference acquisition unit, and an image determination unit.

[0118] An image conversion unit, configured to convert the background image into a background grayscale image, and convert the foreground image into a first foreground grayscale image;

[0119] A pixel value acquisition unit, configured to acquire a first local pixel average value of the background grayscale image, and to acquire a second local pixel average value of the first foreground grayscale image;

[0120] A pixel difference acquisition unit, configured to acquire a difference between a first local pixel average value and a second local pixel average value, to obtain a local pixel average value difference;

[0121] The image determination unit is configured to determine a grayscale image based on a local pixel average value difference.

[0122] In some embodiments, the water inlet identification unit 602 further includes a first division unit and a feature combination unit.

[0123] A first division unit is configured to divide the grayscale image into regions to obtain a plurality of region images;

[0124] The feature combination unit is configured to combine feature points of each area image to determine the water inlet, wherein the feature points are pixels whose grayscale values ​​are greater than a preset grayscale threshold.

[0125] In some embodiments, the water inlet identification unit 602 further includes a second division unit, a coordinate value acquisition unit, a characteristic circle collection unit, a characteristic point quantity acquisition unit and a water inlet determination unit.

[0126] Dividing the grayscale image into a preset number of region images, each region image containing at least one feature point;

[0127] The second division unit is configured to combine the feature points of each area image to determine the water storage port, including:

[0128] A coordinate value acquisition unit, configured to acquire the coordinate value of each feature point in each regional image;

[0129] The feature circle set unit is configured to determine the feature point with the largest coordinate value in each region image as the target feature point, and generate a feature circle set based on the target feature point;

[0130] A feature point quantity acquisition unit, configured to acquire the number of feature points of target feature points contained in each feature circle in the feature circle set;

[0131] The water inlet determination unit is configured to determine the characteristic circle with the largest number of characteristic points in the characteristic circle set as the water inlet.

[0132] In some embodiments, the water inlet identification unit 602 further includes a frame image acquisition unit, a first water level image unit, a second water level image unit, a water level characteristic map generation unit, and a water level determination unit.

[0133] A frame image acquisition unit, configured to acquire continuous frame images of the water inlet of the water discharge device during a period of time when the water is discharged into the container;

[0134] A first water level image unit, configured to obtain a first water level change image based on continuous frame images;

[0135] A second water level image unit is configured to perform equalization processing on pixel points in the water level change image that are greater than a grayscale threshold to obtain a second water level change image;

[0136] a water level characteristic map generating unit, configured to fix the pixel values ​​of the pixels in the second water level change image to generate a water level characteristic map;

[0137] The water level determination unit is configured to determine the real-time water level of the liquid in the container based on the water level characteristic diagram.

[0138] In some embodiments, the water inlet identification unit 602 further includes a differential grayscale image unit, a grayscale value unit, a first pixel unit, a second pixel unit, a pixel ratio unit, and a calculation unit.

[0139] A differential grayscale image unit is configured to obtain a second foreground grayscale image after a preset water outlet time, and to differentiate the second foreground grayscale image from the background grayscale image to obtain a differential grayscale image;

[0140] A gray value unit, configured to obtain a plurality of preset gray thresholds and obtain a gray value of each pixel in the differential gray image;

[0141] A first pixel point unit is configured to determine the number of first pixel points whose grayscale values ​​of the pixel points in the differential grayscale image are less than each preset grayscale threshold and whose grayscale values ​​are not zero, and obtain the number of first pixel points corresponding to each preset grayscale threshold;

[0142] A second pixel point unit, configured to obtain the number of second pixel points whose grayscale values ​​are not zero in the differential grayscale image;

[0143] A pixel point ratio unit is configured to calculate the ratio of the first pixel point quantity to the second pixel point quantity corresponding to each preset grayscale threshold value, and obtain the pixel point ratio corresponding to each preset grayscale threshold value;

[0144] The calculation unit is configured to determine the target grayscale threshold as the preset grayscale threshold if there is a target grayscale threshold whose pixel ratio is greater than the preset ratio threshold in the preset grayscale threshold.

[0145] In the embodiment of the present application, when a container is detected to be placed at the water outlet of the water outlet device, the image of the container is automatically captured by the image acquisition device of the water outlet device and a grayscale image is generated, and the position of the water inlet of the container is accurately identified by image processing technology, thereby improving the recognition efficiency of the water inlets of different containers. By starting to discharge water into the container after identifying the water inlet of the container and monitoring the real-time changes of the water level in the container at the same time, once the distance between the water level and the water inlet of the container reaches the preset safety distance threshold, the water outlet device will be controlled to stop automatically, thereby effectively preventing the safety hazards caused by liquid overflow, thereby improving the user experience.

[0146] In addition, the device control apparatus provided in the above embodiment and a device control method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0147] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0148] See also Fig.11 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 700 includes a processor 601 and a memory 702. The processor 701 is electrically connected to the memory 702.

[0149] The processor 701 is the control center of the electronic device 700 and may include one or more processing cores. The processor 701 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or calling computer programs stored in the memory 702, and calling data stored in the memory 702, so as to control the electronic device as a whole. Optionally, the processor 701 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 701 can integrate one or a combination of CPU, graphics processing unit (GPU), modem, etc. Among them, the CPU mainly processes the operating system, user pages, and applications; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 701, and may be implemented separately through a communication chip.

[0150] The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by running computer programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc.

[0151] In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0152] In the embodiment of the present application, the processor 701 in the electronic device 700 loads instructions corresponding to the processes of one or more computer programs into the memory 702 according to the following steps, and the processor 701 runs the computer program stored in the memory 702 to implement various functions, as follows:

[0153] When a container is detected at the water outlet of the water outlet device, a grayscale image of the container is obtained; the water inlet of the container is determined from the grayscale image; the water outlet device is controlled to discharge water to the container, and the real-time water level of the liquid in the container is obtained; when the distance between the real-time water level and the water inlet is less than a preset distance threshold, the water outlet device is controlled to stop discharging water to the container.

[0154] Optionally, when the processor 701 executes to obtain a grayscale image for the container, specifically: respectively obtain a background image at the water outlet and a foreground image at the water outlet, where the background image is an image that does not contain the container, and the foreground image is an image that contains the container; and generate a grayscale image based on the background image and the foreground image.

[0155] Optionally, the processor 701 generates a grayscale image based on the background image and the foreground image by performing the following steps: converting the background image into a background grayscale image, and converting the foreground image into a first foreground grayscale image; obtaining a first local pixel average value of the background grayscale image, and obtaining a second local pixel average value of the first foreground grayscale image; obtaining a difference between the first local pixel average value and the second local pixel average value to obtain a local pixel average value difference; and determining the grayscale image based on the local pixel average value difference.

[0156] Optionally, when the processor 701 determines the water inlet of the container from the grayscale image, it specifically performs: dividing the grayscale image into regions to obtain multiple regional images; combining feature points of each regional image to determine the water inlet, the feature points being pixels whose grayscale values ​​are greater than a preset grayscale threshold.

[0157] Optionally, the processor 701 performs region division on the grayscale image to obtain multiple region images, specifically performing: dividing the grayscale image into a preset number of region images, each region image containing at least one feature point; combining the feature points of each region image to determine the water inlet, including: obtaining the coordinate value of each feature point in each region image; determining the feature point with the largest coordinate value in each region image as the target feature point, and generating a feature circle set based on the target feature point; obtaining the number of feature points of the target feature point contained in each feature circle in the feature circle set; and determining the feature circle with the largest number of feature points in the feature circle set as the water inlet.

[0158] Optionally, the processor 701 controls the water outlet device to discharge water into the container and obtains the real-time water level of the liquid in the container by specifically performing the following steps: obtaining continuous frame images of the water inlet during the period when the water outlet device discharges water into the container; obtaining a first water level change image based on the continuous frame images; performing equalization processing on pixel points in the water level change image that are greater than a grayscale threshold to obtain a second water level change image; fixing the pixel values ​​of the pixel points in the second water level change image to generate a water level feature map; and determining the real-time water level of the liquid in the container based on the water level feature map.

[0159] Optionally, before the processor 701 performs equalization processing on the pixels in the water level change image that are greater than the grayscale threshold to obtain the second water level change image, the processor 701 specifically performs the following steps: obtaining a second foreground grayscale image after a preset water outlet time, and differentiating the second foreground grayscale image from the background grayscale image to obtain a differential grayscale image; obtaining multiple preset grayscale thresholds, and obtaining the grayscale value of each pixel in the differential grayscale image; determining the number of first pixels in the differential grayscale image whose grayscale values ​​are less than each preset grayscale threshold and whose grayscale values ​​are not zero, and obtaining the number of first pixels corresponding to each preset grayscale threshold; obtaining the number of second pixels in the differential grayscale image whose grayscale values ​​are not zero; calculating the ratio of the first number of pixels corresponding to each preset grayscale threshold to the second number of pixels, and obtaining the pixel proportion corresponding to each preset grayscale threshold; if there is a target grayscale threshold in the preset grayscale thresholds whose pixel proportion is greater than the preset proportion threshold, the target grayscale threshold is determined as the preset grayscale threshold.

[0160] In the embodiment of the present application, when a container is detected to be placed at the water outlet of the water outlet device, the image of the container is automatically captured by the image acquisition device of the water outlet device and a grayscale image is generated, and the position of the water inlet of the container is accurately identified by image processing technology, thereby improving the recognition efficiency of the water inlets of different containers. By starting to discharge water into the container after identifying the water inlet of the container, and simultaneously monitoring the real-time changes of the water level in the container, once the distance between the water level and the water inlet of the container reaches the preset safety distance threshold, the water outlet device will be controlled to stop automatically, thereby effectively preventing the safety hazards caused by liquid overflow, thereby improving the user experience.

[0161] In addition, the device provided in the embodiment of the present application can specifically be a chip, component or module, and the chip may include a connected processor and memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a device control method provided in the above embodiment.

[0162] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a device control method provided in the above-mentioned embodiment.

[0163] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement a device control method provided by the above-mentioned embodiment.

[0164] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0165] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0166] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the related ones shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0167] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A device control method, wherein: Applied to water outlet equipment, the method comprises: When it is detected that there is a container at the water outlet of the water outlet device, a grayscale image of the container is acquired; determining a water inlet of the container from the grayscale image; Controlling the water outlet device to discharge water into the container, and obtaining the real-time water level of the liquid in the container; When the distance between the real-time water level and the water inlet is less than a preset distance threshold, the water outlet device is controlled to stop outlet water to the container.

2. The method according to claim 1, wherein: The obtaining of the grayscale image of the container includes: Respectively acquiring a background image at the water outlet and a foreground image at the water outlet, wherein the background image is an image excluding the container, and the foreground image is an image including the container; The grayscale image is generated based on the background image and the foreground image.

3. The method according to claim 2, wherein: The step of generating the grayscale image based on the background image and the foreground image includes: Converting the background image into a background grayscale image, and converting the foreground image into a first foreground grayscale image; Obtaining a first local pixel average value of the background grayscale image, and obtaining a second local pixel average value of the first foreground grayscale image; Obtaining a difference between the first local pixel average value and the second local pixel average value to obtain a local pixel average value difference; Based on the local pixel average value difference, the grayscale image is determined.

4. The method according to claim 1, wherein: Determining the water inlet of the container from the grayscale image comprises: Performing region division on the grayscale image to obtain a plurality of region images; The characteristic points of each of the regional images are combined to determine the water inlet, wherein the characteristic points are pixels whose grayscale values ​​are greater than a preset grayscale threshold.

5. The method according to claim 4, wherein: The step of dividing the grayscale image into regions to obtain a plurality of region images comprises: Dividing the grayscale image into a preset number of regional images, each of the regional images containing at least one feature point; The step of combining the feature points of each of the regional images to determine the water inlet comprises: Obtaining the coordinate value of each of the feature points in each of the regional images; Determine the feature point with the largest coordinate value in each of the regional images as a target feature point, and generate a feature circle set based on the target feature point; Obtaining the number of feature points of the target feature point contained in each feature circle in the feature circle set; The characteristic circle with the largest number of characteristic points in the characteristic circle set is determined as the water inlet.

6. The method according to any one of claims 1 to 5, wherein: The controlling the water outlet device to outlet water to the container and obtaining the real-time water level of the liquid in the container includes: Acquire continuous frame images of the water inlet during a period in which the water outlet device is discharging water into the container; Obtaining a first water level change image based on the continuous frame images; Performing equalization processing on the pixel points in the first water level change image that are greater than the grayscale threshold, to obtain a second water level change image; Fixing the pixel values ​​of the pixel points in the second water level change image to generate a water level feature map; Based on the water level characteristic diagram, the real-time water level of the liquid in the container is determined.

7. The method according to claim 6, wherein: Before performing equalization processing on the pixel points in the water level change image that are greater than the grayscale threshold to obtain the second water level change image, the method further includes: Acquire a second foreground grayscale image after a preset water outlet time, and perform a differential grayscale image on the second foreground grayscale image and the background grayscale image to obtain a differential grayscale image; Obtaining a plurality of preset grayscale thresholds, and obtaining a grayscale value of each pixel in the differential grayscale image; Determine the number of first pixels whose grayscale values ​​of the pixels in the differential grayscale image are less than each of the preset grayscale thresholds and whose grayscale values ​​are not zero, and obtain the number of first pixels corresponding to each of the preset grayscale thresholds; Obtaining the number of second pixel points whose grayscale values ​​are not zero in the differential grayscale image; Calculating the ratio of the number of the first pixels to the number of the second pixels corresponding to each of the preset grayscale thresholds to obtain a pixel ratio corresponding to each of the preset grayscale thresholds; If there is a target grayscale threshold in the preset grayscale thresholds where the pixel ratio is greater than the preset ratio threshold, the target grayscale threshold is determined as the preset grayscale threshold.

8. A control device for an equipment, wherein: include: A detection unit, configured to acquire a grayscale image of the container when detecting that there is a container at the water outlet of the water outlet device; a water inlet identification unit, configured to determine the water inlet of the container from the grayscale image; a water level acquisition unit, configured to control the water outlet device to discharge water into the container and acquire the real-time water level of the liquid in the container; The control unit is configured to control the water outlet device to stop discharging water to the container when the distance between the real-time water level and the water inlet is less than a preset distance threshold.

9. An electronic device, wherein: The electronic device comprises: a memory configured to store executable program code; The processor is configured to call and run the executable program code from the memory, so that the electronic device executes the device control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the device control method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Beer bottle opening positioning method based on multi-time random circle detection and fitting degree assessment

    CN105046697A

  • Water dispenser control method, water dispenser and computer readable storage medium

    CN111568218A

  • Water dispenser water outlet control method, water dispenser and computer readable storage medium

    CN111568240A

  • Water line identification and estimation method and device based on gray scale variable threshold

    CN112149648A

  • Water dispenser water outlet control method, water dispenser and storage medium

    CN114529568A

Cited By

  • High-precision automatic scribing constant volume identification method

    CN119779433A

  • Water dispenser, water dispensing volume control method and apparatus, device control method and apparatus, and storage medium

    WO2026021218A1