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

Through infrared sensors and camera systems, the water dispenser achieves intelligent water dispensing control, solving the problem of overflow caused by users' lack of concentration, and improving the user experience and water resource utilization efficiency.

WO2026021218A1PCT designated stage Publication Date: 2026-01-29WUHU MIDEA KITCHEN & BATH APPLIANCES MFG CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/106176
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-26
Filing Date
2025-06-30
Publication Date
2026-01-29

AI Technical Summary

Technical Problem

Existing water dispensers are prone to overflowing when users are not paying attention, which reduces the user experience.

Method used

Using an infrared sensor, a first camera, and a second camera in conjunction with a controller, the water dispenser achieves intelligent water dispensing control by sensing the approach of a person and capturing images of their face and the water storage container. This includes water temperature adjustment and liquid level detection to prevent overflow.

Benefits of technology

It enables intelligent water dispensing in water dispensers, improving user experience, ensuring water temperature is suitable for individual needs, preventing water overflow, and saving water resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025106176_29012026_PF_FP_ABST
    Figure CN2025106176_29012026_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applied to the field of water dispensers, and provides a water dispenser, a water dispensing volume control method and apparatus, a device control method and apparatus, and a storage medium. The water dispensing volume control method comprises: acquiring an initial grayscale image of a water storage container, and performing feature filtering on the initial grayscale image to obtain a target grayscale image; determining a pixel contour set from the target grayscale image, and performing contour fitting on a target pixel contour in the pixel contour set, so as to determine a characteristic circle set of the water storage container; and determining a water volume capacity of the water storage container on the basis of the characteristic circle set, so as to obtain a single water dispensing volume of the water dispenser for the water storage container, and on the basis of the single water dispensing volume, generating a water dispensing control instruction to control the water dispenser to dispense water to the water storage container, so as to realize automatic control of the water dispensing volume of the water dispenser, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Water dispenser, water output control method, device control method, apparatus and storage medium

[0001] The present application claims priority to the Chinese patent application No. 2024110246054, filed on July 26, 2024, entitled "Water output control method, apparatus, water dispenser and storage medium", the Chinese patent application No. 2024218044412, filed on July 26, 2024, entitled "A water dispenser", and the Chinese patent application No. 202411024594X, filed on July 26, 2024, entitled "Device control method, apparatus, electronic device and storage medium", the contents of which are understood to be incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of water dispensers, and in particular to a water dispenser, a water output control method, a device control method, an apparatus, a water dispenser and a storage medium. BACKGROUND

[0003] In daily life, water dispensing devices are widely used as devices for heating or cooling water. In the related art, users often need to manually control the infusion volume or infusion time of the water dispensing device. However, when the user is not focused, water will overflow, causing harm to the user and reducing the user's experience. SUMMARY

[0004] The present application provides a water dispenser, a water output control method, a device control method, an apparatus, a water dispenser and a storage medium, which aims to control the water output of the water dispenser in real time, thereby improving the user's experience. The technical solution is as follows:

[0005] In a first aspect, the present application provides a water dispenser, which comprises a housing, a controller, an infrared sensor, a first camera and a second camera. The housing has a water outlet, and the controller is arranged in the housing. The infrared sensor is arranged in the housing and is electrically connected to the controller, and is used to sense whether a human body is close to the water dispenser. The first camera is arranged in the housing and is electrically connected to the controller, and is used to be triggered and started by the infrared sensor to obtain a human face image. The second camera is arranged in the housing and is electrically connected to the controller, and is used to be triggered and started by the first camera to capture an image of a water storage container below the water outlet.

[0006] Further, the controller comprises an image processing chip electrically connected with the first camera, and the water dispenser further comprises a touch panel arranged on the shell and electrically connected with the image processing chip, and the touch panel is used for displaying the drinking water information corresponding to the face image when the image processing chip identifies the face image as the preset image.

[0007] Further, the shell comprises a front panel, and the first camera and the touch panel are arranged on the front panel.

[0008] Further, the water dispenser further comprises a cover plate arranged on the shell and covering the light exit side of the second camera.

[0009] Further, the cover plate comprises a movable cover plate movably connected with the shell and having a first position for shielding the light path of the second camera and a second position for avoiding the light path, and the movable cover plate is sealingly connected with the shell in the first position; or the cover plate comprises a high-temperature glass cover plate fixedly connected with the shell and used for shielding the water vapor on the second camera.

[0010] Further, the shell comprises a receiving table for placing a water cup, and a projection of the water outlet is located on the receiving table in the height direction of the water dispenser.

[0011] Further, the water dispenser further comprises an irradiation lamp arranged on the shell and facing the receiving table, so that the light emitted by the irradiation lamp forms a water cup placing area on the receiving table.

[0012] Further, the first camera is rotatably arranged on the top of the shell or the front panel.

[0013] Further, the water dispenser further comprises a water outlet control valve arranged in the shell and communicating with the water outlet, and the water outlet control valve is electrically connected with the controller, wherein the controller is used for controlling the opening degree of the water outlet control valve according to the obtained image of the water storage container.

[0014] Further, the water dispenser further comprises a water tank, a water pump and an instant heating module. The water tank is arranged in the shell; the water pump is arranged in the shell and electrically connected with the controller; and the instant heating module is arranged in the shell and electrically connected with the controller and communicates with the water pump and the water outlet.

[0015] The embodiment of the present application sets the infrared sensor, the first camera and the second camera, triggers the first camera to work after the infrared sensor senses that a human body is close, and the first camera is used to acquire a face image, so that the controller intelligently controls the water outlet to output water of a temperature conforming to the face image according to the recognized face image. Based on this, the second camera is triggered to start by the first camera to shoot a water storage container image, and the controller is sent the shot water storage container image, the controller determines whether the water cup contains brewing material according to the shot water storage container image, if the water cup contains brewing material, the controller controls the water temperature in the water dispenser to adjust to the most suitable temperature of the brewing material, if not, the water is output according to the drinking water information of the face image, so as to realize the intelligent water output of the water dispenser; at the same time, the second camera also shoots the water output process of the water outlet, and sends the shot water cup liquid level picture to the controller, the controller processes the water cup liquid level image, and when the distance between the water cup liquid level and the cup edge is close, the controller controls the water outlet to stop water output, so as to realize the intelligent water stop of the water dispenser.

[0016] In a second aspect, the embodiment of the present application provides a water output amount control method, comprising:

[0017] An initial gray image of the water storage container is acquired, and feature filtering is performed on the initial gray image to obtain a target gray image;

[0018] A pixel contour set is determined from the target gray image, and a target pixel contour in the pixel contour set is subjected to contour fitting to determine a feature circle set of the water storage container;

[0019] The water amount volume of the water storage container is determined based on the feature circle set to obtain a single water output amount of the water dispenser for the water storage container, and a water output control instruction is generated based on the single water output amount to control the water dispenser to output water to the water storage container.

[0020] In a possible implementation, the determination of the pixel contour set from the target gray image comprises:

[0021] Edge detection is performed on the target gray image to determine a plurality of initial pixel contours;

[0022] The target gray image is converted into a binary image, and the initial pixel contours are subjected to contour enhancement processing based on the binary image to generate the pixel contour set.

[0023] In a possible implementation, the contour enhancement processing of the initial pixel contours based on the binary image to generate the pixel contour set comprises:

[0024] Each pixel in each initial pixel contour is subjected to pixel dilation to connect each pixel with adjacent pixels to generate the pixel contour set, and the adjacent pixels are pixels with a gray value greater than a gray threshold value and a relative distance less than a distance threshold value.

[0025] In a possible implementation, the performing of the profile fitting on the target pixel profile in the pixel profile set to determine the feature circle set of the water storage container comprises:

[0026] The pixel profiles in the pixel profile set are screened to obtain the target pixel profile;

[0027] The target pixel profile is subjected to circle fitting to obtain a first feature circle and a second feature circle, the first feature circle being larger than the second feature circle;

[0028] The feature circle set is generated based on the first feature circle and the second feature circle.

[0029] In a possible implementation, the performing of the screening on the pixel profiles in the pixel profile set to obtain the target pixel profile comprises:

[0030] The pixel profiles in the pixel profile set in an unsealed state are filtered to obtain a plurality of pixel profiles in a sealed state;

[0031] The profile areas of the pixel profiles in the sealed state are obtained;

[0032] The first target pixel profile and the second target pixel profile are obtained based on the profile areas, the profile area of the first target pixel profile being larger than the profile area of the second target pixel profile;

[0033] The first target pixel profile is determined as the first feature circle and the second target pixel profile is determined as the second feature circle.

[0034] In a possible implementation, the performing of the feature filtering on the initial gray-scale image to obtain the target gray-scale image comprises:

[0035] An interference region image is determined from the initial gray-scale image;

[0036] An image division range for the initial gray-scale image is determined based on the interference region image, and the initial gray-scale image is divided based on the image division range to obtain the target gray-scale image.

[0037] In a possible implementation, the determining of the water volume of the water storage container based on the feature circle set comprises:

[0038] A first relative distance of a side boundary of the water dispenser to the first feature circle is obtained from the initial gray-scale image;

[0039] The height information of the water storage container and a first scale of the first feature circle are determined according to the first relative distance, and a first area of the first feature circle is determined based on the first scale;

[0040] acquire a second relative distance between the bottom boundary of the water dispenser and the image acquisition device of the water dispenser from the initial gray image;

[0041] determine a second scale of the second feature circle according to the second relative distance, and determine a second area of the second feature circle based on the second scale;

[0042] determine the water volume of the water storage container based on the height information, the first area and the second area.

[0043] In the above technical solution, by acquiring the initial gray image and performing feature filtering, the key information related to the water storage container can be accurately extracted to form a target gray image. By fitting the target pixel contour, the feature circle set of the water storage container is accurately determined, and based on these feature circles, the water volume of the water storage container can be quickly and accurately calculated, and the water control instruction is generated accordingly to realize the automatic control of the water outlet volume of the water dispenser, thereby improving the user experience.

[0044] In a third aspect, an equipment control method is provided, applied to a water dispenser, including:

[0045] when detecting that there is a water storage container at the water outlet of the water dispenser, acquiring a gray image for the water storage container;

[0046] determining the water inlet of the water storage container from the gray image;

[0047] controlling the water dispenser to dispense water to the water storage container, and acquiring the real-time water level of the liquid in the water storage container;

[0048] when the distance between the real-time water level and the water inlet is less than a preset distance threshold, controlling the water dispenser to stop dispensing water to the water storage container.

[0049] In a possible implementation, the acquiring of the gray image for the water storage container includes:

[0050] respectively acquiring a background image at the water outlet and a foreground image at the water outlet, the background image being an image not containing the water storage container, and the foreground image being an image containing the water storage container;

[0051] generating the gray image based on the background image and the foreground image.

[0052] In a possible implementation, the generating of the gray image based on the background image and the foreground image includes:

[0053] converting the background image into a background gray image and converting the foreground image into a first foreground gray image;

[0054] acquiring a first local pixel average value of the background gray image, and acquiring a second local pixel average value of the first foreground gray image;

[0055] 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;

[0056] determining the gray-scale image based on the local pixel average value difference.

[0057] In a possible implementation, the determining of the water inlet of the water storage container from the gray-scale image comprises:

[0058] dividing the gray-scale image into a plurality of region images, and combining feature points of each region image to determine the water inlet, the feature points being pixel points with a gray-scale value greater than a preset gray-scale threshold.

[0059] In a possible implementation, the dividing of the gray-scale image into a plurality of region images comprises: dividing the gray-scale image into a preset number of region images, and each region image containing at least one feature point.

[0060] In a possible implementation, the combining of the feature points of each region image to determine the water inlet comprises:

[0061] obtaining a coordinate value of each feature point in each region image;

[0062] determining a target feature point as a feature point with a maximum coordinate value in each region image, and generating a feature circle set based on the target feature point;

[0063] obtaining a feature point quantity of the target feature point contained in each feature circle in the feature circle set, and determining a feature circle with a maximum feature point quantity in the feature circle set as the water inlet.

[0064] In a possible implementation, the controlling of the water dispenser to dispense water into the water storage container and the obtaining of the real-time water level of the liquid in the water storage container comprise:

[0065] obtaining a continuous frame image of the water inlet in a water dispensing period of the water dispenser to the water storage container;

[0066] obtaining a first water level change image based on the continuous frame image, and performing equalization processing on pixel points greater than a gray-scale threshold in the first water level change image to obtain a second water level change image;

[0067] fixing a pixel value of a pixel point 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 water storage container based on the water level feature map.

[0068] In a possible implementation, before the equalization processing on the pixel points greater than the gray-scale threshold in the water level change image to obtain the second water level change image, the method further comprises:

[0069] obtain a second foreground grayscale image after a preset water outlet duration, and perform difference between the second foreground grayscale image and the background grayscale image to obtain a difference grayscale image;

[0070] obtain a plurality of preset grayscale thresholds, and obtain a grayscale value of each pixel point in the difference grayscale image;

[0071] determine a first pixel point quantity of the pixel points in the difference grayscale image whose grayscale value is less than each preset grayscale threshold and is not zero, to obtain a first pixel point quantity corresponding to each preset grayscale threshold;

[0072] obtain a second pixel point quantity in the difference grayscale image whose grayscale value is not zero.

[0073] In a possible implementation, after the step of obtaining the second pixel point quantity in the difference grayscale image whose grayscale value is not zero, the method further includes:

[0074] calculate a ratio of the first pixel point quantity corresponding to each preset grayscale threshold and the second pixel point quantity, to obtain a pixel point proportion corresponding to each preset grayscale threshold;

[0075] if there is a target grayscale threshold in the preset grayscale thresholds whose pixel point proportion is greater than a preset proportion threshold, the target grayscale threshold is determined as the preset grayscale threshold.

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

[0077] an image obtaining unit configured to obtain an initial grayscale image of a water storage container, and perform feature filtering on the initial grayscale image to obtain a target grayscale image;

[0078] a pixel fitting unit configured to determine a pixel contour set from the target grayscale image, and perform contour fitting on a target pixel contour in the pixel contour set to determine a feature circle set of the water storage container;

[0079] a control unit configured to determine a water volume of the water storage container based on the feature circle set, to obtain a single water outlet quantity of the water dispenser for the water storage container, and generate a water outlet control instruction based on the single water outlet quantity to control the water dispenser to outlet water to the water storage container.

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

[0081] a detection unit configured to obtain a grayscale image for a water storage container when detecting that there is the water storage container at a water outlet of a water outlet device;

[0082] a water inlet recognition unit configured to determine a water inlet of the water storage container from the grayscale image;

[0083] a water level acquisition unit configured to control the water outlet device to outlet water to the water storage container and to acquire a real-time water level of liquid in the water storage container;

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

[0085] In a sixth aspect, an embodiment of the present application provides a water dispenser, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the computer program is executed by the processor to implement the water outlet amount control method or the device control method according to any one of the above.

[0086] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed to implement the water outlet amount control method or the device control method according to any one of the above. BRIEF DESCRIPTION OF DRAWINGS

[0087] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0088] FIG. 1 is a structural schematic diagram of a water dispenser in an embodiment of the present application;

[0089] FIG. 2 is a partial enlarged structural schematic diagram of B in FIG. 1;

[0090] FIG. 3 is a module schematic diagram of a water dispenser in an embodiment of the present application;

[0091] FIG. 4 is a scene schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0092] FIG. 5 is a flow schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0093] FIG. 6 is a flow schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0094] FIG. 7 is a flow schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0095] FIG. 8 is a scene schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0096] FIG. 9 is a flow schematic diagram of a water outlet amount control method provided by an embodiment of the present application;

[0097] FIG. 10 is a scenario diagram of a water outlet amount control method according to an embodiment of the present application;

[0098] FIG. 11 is a flow diagram of a water outlet amount control method according to an embodiment of the present application;

[0099] FIG. 12 is a scenario diagram of a water outlet amount control method according to an embodiment of the present application;

[0100] FIG. 13 is a scenario diagram of a device control method according to an embodiment of the present application;

[0101] FIG. 14 is a flow diagram of a device control method according to an embodiment of the present application;

[0102] FIG. 15 is a scenario diagram of a device control method according to an embodiment of the present application;

[0103] FIG. 16 is a flow diagram of a device control method according to an embodiment of the present application;

[0104] FIG. 17 is a flow diagram of a device control method according to an embodiment of the present application;

[0105] FIG. 18 is a scenario diagram of a device control method according to an embodiment of the present application;

[0106] FIG. 19 is a flow diagram of a device control method according to an embodiment of the present application;

[0107] FIG. 20 is a flow diagram of a device control method according to an embodiment of the present application;

[0108] FIG. 21 is a scenario diagram of a device control method according to an embodiment of the present application;

[0109] FIG. 22 is a structural diagram of a device control apparatus according to an embodiment of the present application;

[0110] FIG. 23 is a structural diagram of a device control apparatus according to an embodiment of the present application;

[0111] FIG. 24 is a structural diagram of a water dispenser according to an embodiment of the present application.

[0112] BRIEF DESCRIPTION OF THE DRAWINGS 1 - water dispenser; 10 - housing; 10a - water outlet; 11 - front panel; 12 - receiving table; 20 - controller; 21 - image processing chip; 30 - infrared sensor; 40 - first camera; 50 - second camera; 60 - touch panel; 70 - illumination lamp; 80 - water tank; 90 - water pump; 100 - instant heating module; 110 - water outlet control valve. DETAILED DESCRIPTION

[0113] The following description refers to the accompanying drawings. Unless otherwise noted, like elements in different drawings have the same or similar notation, and the same or similar elements in different drawings are represented with the same or similar references. The implementations described in the following examples do not represent all implementations consistent with the present disclosure. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0114] In the description of the present disclosure, it should be understood that the terms "first", "second" and the like are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present disclosure can be understood according to the specific circumstances. In addition, in the description of the present disclosure, "multiple" means two or more, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.

[0115] Please refer to FIG. 1-3, the present embodiment provides a water dispenser 1, the water dispenser 1 includes a shell 10, a controller 20, an infrared sensor 30, a first camera 40 and a second camera 50.

[0116] The shell 10 is provided with a water outlet 10a, through which a user can access water; the shell 10 mainly plays a role in protecting the internal components of the water dispenser 1, beautifying the appearance and heat insulation. It can be understood that the shell 10 can protect the internal components of the water dispenser 1, such as the water tank 80, the water pump 90, the filter, the compressor, etc., from physical damage and environmental pollution from the outside world; the design and material selection of the shell 10 can affect the overall appearance of the water dispenser 1; the shell 10 should have a certain heat insulation and anti-scalding effect to avoid users being scalded when touching the water dispenser 1. Among them, the shell 10 is generally made of plastic, metal or stainless steel, etc. The present embodiment does not make specific limitation here.

[0117] The controller 20 is arranged in the shell 10, so that the shell 10 plays a role in protecting the controller 20; wherein the controller 10 can be an integrated microcontroller unit module, or a dedicated integrated circuit controller, or an embedded module with multiple I / O interfaces, which is not limited here. The controller 10 can receive signals sent by different devices and perform corresponding control actions according to the preset control logic. For example, the controller 20 can control the water outlet 10a to output hot water, cold water or warm water according to the received instructions.

[0118] Referring to FIG. 3, the infrared sensor 30 is arranged on the shell 10 and is electrically connected with the controller 20, and the infrared sensor 30 is used for sensing whether a person approaches the water dispenser 1; the first camera 40 is arranged on the shell 10 and is electrically connected with the controller 20, and the first camera 40 is used for being triggered to start by the infrared sensor 30 to obtain a face image.

[0119] Specifically, when the infrared sensor 30 senses that a human body approaches the water dispenser 1, the infrared sensor 30 sends a signal to the controller 20 to make the controller 20 send a starting instruction to the first camera 40; after receiving the starting instruction, the first camera 40 starts to work to take a photo of the face of the user to obtain a face image of the user, and sends the face image taken by the first camera 40 to the controller 20, and the controller 20 processes the received face image to determine whether the face image is a preset image; if the face image is the preset image, the controller 20 stores the water information of the face image to make the controller 20 control the outlet 10a to output the water at a temperature suitable for the face image; if the face image is not the preset image, the user of the face image needs to store the face image in the memory of the controller 20 and input the water information of the user.

[0120] Referring to FIG. 3, in addition, the second camera 50 is arranged on the shell 10 and is electrically connected with the controller 20, and the second camera 50 is used for being triggered to start by the first camera 40 to take a photo of the water storage container below the outlet 10a.

[0121] It can be understood that the second camera 50 can be arranged near the outlet 10a to take a photo of the water cup below the outlet 10a; after the first camera 40 sends the obtained face image to the controller 20 and the controller 20 completes the processing of the received face image, the controller 20 triggers the second camera 50 to start. That is, when the user of the face image places the water cup below the outlet 10a, the second camera 50 can take a photo of the water storage container below the outlet 10a and send the obtained water storage container image to the controller 20, and the controller 20 determines whether there is a brewing material in the water cup according to the received water storage container image; if there is a brewing material in the water cup, the controller 20 controls the water temperature in the water dispenser 1 to be adjusted to the most suitable temperature for the brewing material and controls the outlet 10a to output the water; if there is no brewing material in the water cup, the controller 20 controls the water temperature in the water dispenser 1 to be adjusted to the water temperature suitable for the face image and controls the outlet 10a to output the water, so that the intelligent water output of the water dispenser 1 can be realized.

[0122] In addition, during the process of water outlet 10a discharging water, the second camera 50 continues to work to capture the water cup liquid level picture and send it to the controller 20. At this time, the controller 20 processes the water cup liquid level picture, wherein the position of the water cup liquid level is R1 and the position of the cup edge is R2. When R1 = 80% * R2 ± 5%, the controller 20 controls the water outlet 10a to stop discharging water. In this way, on the one hand, it can prevent the water cup from overflowing to save water resources; on the other hand, since the controller 20 can process the received water cup liquid level image and stop discharging water when R1 = 80% * R2 ± 5%, the user does not need to wait for the water cup to fill up all the time to save the user's time.

[0123] It should be noted that the infrared sensor 30, the first camera 40 and the second camera 50 of the embodiment of the present application work in sequence, that is, the first camera 40 is triggered and started by the infrared sensor 30, and the second camera 50 is triggered and started by the first camera 40. When the first camera 40 and the second camera 50 work, the infrared sensor 30 can not work. In this way, the memory space of the controller 20 can be saved.

[0124] The embodiment of the present application sets the infrared sensor 30, the first camera 40 and the second camera 50, and triggers the first camera 40 to work after the infrared sensor 30 senses that a human body is close. The first camera 40 is used to obtain a face image so that the controller 20 can intelligently control the water outlet 10a to discharge water with a temperature suitable for the face image according to the recognized face image. Based on this, the second camera 50 is triggered and started by the first camera 40 to capture a water storage container image and send it to the controller 20. The controller 20 determines whether the water cup contains brewing material according to the captured water storage container image. If the water cup contains brewing material, the controller 20 controls the water temperature in the water dispenser 1 to adjust to the most suitable temperature for the brewing material. If not, it discharges water according to the drinking water information of the face image to achieve intelligent water discharge of the water dispenser 1. At the same time, the second camera 50 also captures the water discharge process of the water outlet 10a and sends the captured water cup liquid level picture to the controller 20. The controller 20 processes the water cup liquid level picture. When the distance between the water cup liquid level and the cup edge is close, the controller 20 controls the water outlet 10a to stop discharging water to achieve intelligent water stop of the water dispenser 1.

[0125] Please continue to refer to FIG. 3. Further, the water dispenser 1 further comprises a water tank 80, a water pump 90 and an instant heating module 100. The water tank 80, the water pump 90 and the instant heating module 100 are all arranged in the shell 10. The water pump 90 is electrically connected with the controller 20, the instant heating module 100 is electrically connected with the controller 20, and the instant heating module 100 communicates with the water pump 90 and the water outlet 10a.

[0126] Specifically, when the controller 20 identifies that the drinking water information of the face image is hot water, or the controller 20 identifies that there is a brewing material in the cup, the controller 20 controls the water pump 90 to work to pump the water in the water tank 80 to the connecting pipe (not shown in the figure); at the same time, the controller 20 also controls the instant heating module 100 to work, so that the instant heating module 100 heats the water on the connecting pipe into hot water that meets the drinking water information of the face image, or hot water that is suitable for the brewing material. The connecting pipe is connected to the water pump 90 and the water outlet 10a, and the instant heating module 100 is arranged on the connecting pipe, so that the water heated by the instant heating module 100 can flow out of the water outlet 10a.

[0127] Please continue to refer to FIG. 3, in some embodiments, the controller 20 includes an image processing chip 21, which is a special chip for processing image data, and the image processing chip 21 is electrically connected with the first camera 40, that is, after the first camera 40 captures the face image, the first camera 40 sends the face image to the image processing chip 21, and the image processing chip 21 processes the face image.

[0128] Please refer to FIGS. 1-2, further, the water dispenser 1 also includes a touch panel 60, which is arranged on the shell 10 and is electrically connected with the image processing chip 21. It can be understood that, after the first camera 40 sends the captured face image to the image processing chip 21, the image processing chip 21 processes the received face image to determine whether the face image is a preset image; when the face image is a preset image, the touch panel 60 displays the drinking water information corresponding to the face image, and the touch panel 60 prompts the user of the face image whether to modify the drinking water information, if not, the controller 20 controls the water outlet 10a to output the same water temperature as the previously stored drinking water information, if modification is made, the controller 20 controls the water outlet 10a to output the same water temperature as the modified drinking water information; when the face image is not a preset image, the touch panel 60 displays whether to store the face image, if stored, the touch panel 60 prompts the user of the face image to input the drinking water information, so as to be used again by the user. That is, the controller 20 can accurately control the water outlet 10a to output the corresponding water temperature according to the obtained face image, so as to realize the intelligent water output of the water dispenser 1.

[0129] Please continue to refer to FIGS. 1-2, in some embodiments, the shell 10 includes a front panel 11, the first camera 40 and the touch panel 60 are arranged on the front panel 11. It can be understood that when the user needs to get water, the user will walk to the position of the water outlet 10a, because the first camera 40 and the touch panel 60 are arranged on the front panel 11, and the front panel 11 and the water outlet 10a are located on the same side, so the first camera 40 can more easily shoot the user to obtain the face image of the user, and at the same time, it is convenient for the user to watch and operate the touch panel 60.

[0130] Please refer to FIG. 1, in some embodiments, the shell 10 includes a receiving table 12 for placing a water cup, wherein the projection of the water outlet 10a is located on the receiving table 12 in the height direction AA of the water dispenser 1. That is, under the action of gravity, the water of the water outlet 10a flows vertically downward, so the user places the water cup on the receiving table 12 below the water outlet 10a, and the water of the water outlet 10a can be directly caught by the water cup, at this time, the water cup is directly placed on the receiving table 12, without the user holding the water cup, and the controller 20 controls the water outlet 10a to discharge the corresponding water temperature according to the shot water storage container image, so as to improve the user's experience.

[0131] Please refer to FIGS. 1-2, further, in some embodiments, the water dispenser 1 further includes an illumination lamp 70 arranged on the shell 10 and facing the receiving table 12, so that the light emitted by the illumination lamp 70 forms a water cup placing area on the receiving table 12. It can be understood that the illumination lamp 70 can be arranged near the water outlet 10a, and the illumination lamp 70 is arranged opposite to the receiving table 12, so that the light emitted by the illumination lamp 70 can form a water cup placing area on the receiving table 12, and the water cup placing area can be shot by the second camera 50, so that on the one hand, since the light emitted by the illumination lamp 70 forms a water cup placing area on the receiving table 12, to guide the user to place the water cup in the water cup placing area, thereby improving the accuracy of the second camera 50 shooting the water cup; on the other hand, under the illumination of the illumination lamp 70, the clarity of the second camera 50 shooting the water cup can be improved, thereby facilitating the controller 20 to judge whether there is a brewing material in the water cup and the type of the brewing material.

[0132] It should be noted that the illumination lamp 70 can emit light of multiple colors, and the user can adjust the light emitted by the illumination lamp 70 to be inconsistent with the light of the external environment, so as to facilitate the user to identify the water cup placing area on the receiving table 12.

[0133] The second camera 50 is arranged on the housing 10, and the second camera 50 is used to capture the image of the water storage container below the water outlet 10a. At this time, the light path of the second camera 50 needs to be directed towards the water cup so as to capture the image of the water storage container. However, when hot water is discharged from the water outlet 10a, the water vapor generated by the hot water is lighter than the ambient air, so that the water vapor generated by the hot water moves upward, thereby causing the second camera 50 to capture unclear images, and causing the water dispenser 1 to be unable to accurately discharge water.

[0134] Therefore, in some embodiments, the water dispenser 1 further comprises a cover plate arranged on the housing 10, and the cover plate covers the light exit side of the second camera 50. That is, when hot water is discharged from the water outlet 10a, the controller 20 can control the cover plate to close to cover the light exit side of the second camera 50, so as to avoid the water vapor covering the light exit side of the second camera 50.

[0135] Further, in some embodiments, the cover plate comprises a movable cover plate movably connected with the housing 10, and the movable cover plate has a first position covering the light exit side of the second camera 50 and a second position avoiding the light exit side of the second camera 50. Specifically, when hot water is discharged from the water outlet 10a, the controller 20 can control the movable cover plate to cover the light exit side of the second camera 50, so that the movable cover plate blocks the light path of the second camera 50, thereby preventing the water vapor generated by the hot water from covering the second camera 50. When it is necessary to capture the water cup, the controller 20 controls the movable cover plate to avoid the light exit side of the second camera 50, so that the movable cover plate avoids the light path of the second camera 50, thereby allowing the second camera 50 to capture the water cup. Furthermore, when the movable cover plate is in the first position, the movable cover plate is sealingly connected with the housing, so as to prevent the water vapor generated by the hot water from entering from the gap between the movable cover plate and the housing. The sealing form between the movable cover plate and the housing is not specifically limited in the embodiments of the present application.

[0136] It should be noted that the movable cover plate can be a light-tight cover plate. In this case, the second camera 50 can capture an image of the water storage container before the water outlet 10a discharges hot water, and send the captured image to the controller 20. The controller 20 processes the received image of the water storage container, controls the movable cover plate to block the light path of the second camera 50, and controls the movable cover plate to avoid the light path of the second camera 50 for a certain period of time according to the image of the water storage container, so that the second camera 50 captures the water level of the cup at this time, thereby confirming the relationship between the position R1 of the water level and the position R2 of the cup edge, and when R1 = 80% * R2 ± 5%, the controller 20 controls the water outlet 10a to stop discharging water. In this way, on the one hand, the water vapor on the light-emitting side of the second camera 50 can be reduced, and on the other hand, the water cup can be prevented from overflowing. Of course, the movable cover plate can also be made of other materials, and the present application does not make specific limitations in this regard.

[0137] In other embodiments, the cover plate includes a high-temperature glass cover plate, which is a special glass that can work in a high-temperature environment without being damaged by the high-temperature environment. The high-temperature glass cover plate is generally made of high-purity siliceous mineral materials and is refined at high temperature. It can still maintain the original permeability and transparency of glass in a high-temperature environment. Therefore, the high-temperature glass cover plate has the characteristics of high transparency, high temperature resistance, good thermal stability, and stable chemical properties.

[0138] The high-temperature glass cover plate is fixedly connected to the shell 10 and is used to cover the water vapor on the second camera 50. It can be understood that when the water outlet 10a discharges hot water, the water vapor generated by the hot water will not cover the high-temperature glass cover plate due to its high transparency and high temperature resistance. That is, the high-temperature glass cover plate is arranged on the light-emitting side of the second camera 50, which can block the water vapor generated by the hot water and ensure the clarity of the image captured by the second camera 50.

[0139] In some embodiments, the first camera 40 can be rotatably arranged on the top or front panel 11 of the shell 10. It can be understood that after the infrared sensor 30 triggers the first camera 40 to start, the first camera 40 can obtain a face image from different angles due to its rotatability. At this time, the controller 20 can identify and process the face image from different angles to improve the accuracy of face image recognition by the controller 20. At the same time, the first camera 40 is rotatably arranged on the top or front panel 11 of the shell 10 to avoid the situation that the first camera 40 does not capture a face.

[0140] In some embodiments, the water dispenser 1 further comprises a water outlet control valve 110 arranged in the housing 10, such that the housing 10 protects the water outlet control valve 110, the water outlet control valve 110 is in communication with the water outlet 10a and is electrically connected with the controller 20. It can be understood that after the second camera 50 captures the image of the water storage container below the water outlet 10a, the controller 20 can control the opening size of the water outlet control valve 110 according to the obtained image of the water storage container, that is, when the controller 20 identifies that the distance between the position R1 of the water cup liquid level and the position R2 of the cup edge is far, the controller 20 controls the opening of the water outlet control valve 110 to be larger, so as to increase the water outlet speed of the water outlet 10a; when the controller 20 identifies that the distance between the position R1 of the water cup liquid level and the position R2 of the cup edge is close, that is, R1 = 80% * R2 ± 5%, the controller 20 controls the water outlet control valve 110 to be closed, so as to stop the water outlet of the water outlet 10a, thereby preventing the water cup from overflowing, and thus realizing the intelligent water stopping of the water dispenser 1.

[0141] In order to improve the use safety of the water dispenser 1, the application provides a water outlet amount control method, and the execution subject of the water outlet amount control method is the water dispenser 1. The following will be described in detail, and it should be noted that the description order of the following embodiments is not limited as the preferred order of the embodiments. Please refer to FIG. 4, which is a scene schematic diagram of a water outlet amount control method provided by an embodiment of the application. As shown in FIG. 4, the water dispenser 1 comprises an image acquisition device and a water outlet, wherein the image acquisition device can be the second camera 50 shown in FIG. 1, and the water outlet can be the water outlet 10a shown in FIG. 1. The image acquisition device is used to capture the image of the area below the water outlet in real time, and the shooting angle of the image acquisition device is determined according to the actual use scene, which is not limited here. As shown in the left schematic diagram of FIG. 4, the left view range of the image acquisition device falls on the housing 10 of the water dispenser 1. Hereinafter, the intersection point of the housing 10 view is described, that is, when there is a water storage container below the intersection point of the housing 10 view, the complete image of the water storage container can be completely obtained. At the same time, by detecting the distance between the intersection point of the housing 10 view and the cup edge of the water storage container, the height information of the water storage container can be obtained. As shown in the right schematic diagram of FIG. 4, the left area of the dashed line is the image of the area of the housing 10. Since the housing 10 is a mirror surface, the mapping image of the water storage container on the housing 10 can be obtained at the same time when the area image is obtained. The height information of the container can be determined by analyzing the distance between the water storage container and the intersection point of the housing 10 view.

[0142] It should be noted that the height information of the water storage container is obtained according to actual experimental data, in which the corresponding relationship data between the water storage containers of different heights and the sight intersection of the shell 10 is saved respectively in actual experiments, and in actual application, the corresponding comparison data is called from the used corresponding relationship database, so that the actual height information of the water storage container corresponding to the distance between the water storage container and the sight intersection of the shell 10 is obtained. At the same time, the corresponding relationship database records the actual scale of the cup mouth of the water storage container under different height information, wherein the actual scale refers to the ratio of the diameter length distance of the cup mouth of the water storage container in the gray image to the actual length in the real scene, which is used to measure the degree of reduction between the distance on the image and the actual distance.

[0143] Specifically, the shooting angle of the image acquisition device is preferably set to be perpendicular to the water storage container. When the water dispenser 1 is in the standby state, the image acquisition device is controlled to intermittently acquire a plurality of frames of images by using the difference frame method, and the current frame image is compared with the previous frame image to determine whether the current frame image contains the water storage container. When any water storage container is detected in the current frame image, the water dispenser 1 is switched from the standby state to the pre-water state. The current frame image obtained in the pre-water state is converted into a gray image, which contains a series of pixel features of the water storage container. In order to speed up the processing speed, the redundant pixel area in the gray image needs to be filtered to highlight the pixel features of the water storage container. After filtering, Canny or Prewitt algorithm is used to obtain the edge profile in the image, wherein the edge profile in the image refers to the curve of continuous points with the same color or gray value in the image, which is an important processing object in image processing and is used for shape analysis and object detection and recognition.

[0144] All the closed edge profiles in the image are found, and the area of each closed edge profile is obtained. The area of each edge profile is traversed to obtain the edge profile with the largest area and the edge profile with the second largest area. The edge profile with the largest area and the edge profile with the second largest area are subjected to contour fitting operation respectively to generate a first feature circle and a second feature circle. The first feature circle is taken as the cup mouth of the water storage container, and the second feature circle is taken as the cup bottom of the water storage container.

[0145] The height information of the water storage container is determined by determining the distance of the cup opening of the water storage container from the perspective intersection point of the shell 10, and calling the corresponding reference data under the current distance from the corresponding relationship database, to determine the height information of the water storage container. At the same time, the size ratio of the gray scale image under the height information is greater than or equal to the actual size ratio in the real scene, and the actual size ratio is taken as the actual scale of the cup opening. The relative distance between the image acquisition device and the container tray of the water dispenser 1 is obtained in advance, and the relative distance is converted into the actual size ratio of the cup bottom of the water storage container, and the water volume of the container is obtained through the water volume calculation formula. According to the water volume, the single water output of the water dispenser 1 is determined, and the water outlet of the water dispenser 1 is controlled to start dispensing water, and the water dispenser 1 is controlled to stop dispensing water when the water output reaches the single water output.

[0146] Based on the scene diagram shown in Figure 4, the water output control method provided by the embodiment of the application will be described in detail below in combination with Figures 5-12.

[0147] Based on the above situation, the embodiment of the application provides a water output control method. Please refer to Figure 5, which is a flowchart of the water output control method provided by the embodiment of the application. As shown in Figure 5, the method of the embodiment of the application can include the following steps S101-S103.

[0148] S101, obtaining an initial gray scale image of a water storage container, and filtering the features of the initial gray scale image to obtain a target gray scale image.

[0149] In the embodiment of the application, the shell 10 of the water dispenser 1 is made of mirror material, so the area image captured by the image acquisition device will also include the image of the water storage container in the shell 10. At this time, this part of the area image is the interference area.

[0150] Specifically, when the water dispenser 1 is in standby state, the image acquisition device continuously captures the image frames below the water outlet at low power consumption, and compares and analyzes the continuous image frames frame by frame to detect whether there is a feature change in the current frame image compared with the previous frame image. Once the container feature is detected in the current frame image, the current frame image is converted into an initial gray scale image, and the water dispenser 1 is switched from standby state to pre-water state. The current frame image obtained in the pre-water state is converted into a gray scale image. At the same time, the area image of the shell 10 of the water dispenser 1 is deleted from the gray scale image to obtain the target gray scale image after filtering the interference area.

[0151] S102, determining a set of pixel contours from the target gray scale image, and performing contour fitting on the target pixel contour in the set of pixel contours to determine a set of feature circles of the water storage container.

[0152] In the embodiments of the present application, the Canny algorithm or the Prewitt algorithm is used to process the target gray image to identify the edge profile of each pixel region in the target gray image. Specifically, which algorithm to use is determined according to the actual use scenario, and is not specifically limited here. The Canny algorithm is based on a Gaussian filter to smooth the image, then calculates the gradient amplitude and direction, and finds the local maximum value through non-maximum suppression, and finally determines the edge through double threshold processing. The Prewitt algorithm uses two 3x3 convolution kernels to approximate the gradient, and then detects the edge of the image through threshold processing.

[0153] Specifically, the target gray image after edge detection is subjected to a binarization operation, that is, the target gray image is converted into a binary image, that is, the pixel gray value in the target gray image greater than the gray value threshold is fixed, and the pixel gray value in the target gray image less than the gray value threshold is fixed to generate the target gray image after binarization processing.

[0154] The target gray image after binarization processing is subjected to pixel dilation, wherein the pixel dilation is used to expand the isolated pixel region in the target gray image into a continuous region to generate a pixel profile, and a set of pixel profiles is generated based on all the pixel profiles in the target gray image.

[0155] Each pixel profile in the set of pixel profiles is traversed, and the profile area of each pixel profile after elliptical fitting is determined. The pixel profile with a profile area less than a preset area threshold is filtered and deleted, and the pixel profile with the largest profile area is determined as the first feature circle, that is, the cup opening of the water storage container, and the pixel profile with the second largest profile area is determined as the second feature circle to generate a set of feature circles of the water storage container.

[0156] S103, determining the water volume of the water storage container based on the set of feature circles to obtain the single water output of the water dispenser for the water storage container, generating a water output control instruction based on the single water output to control the water dispenser to output water to the water storage container.

[0157] In the embodiments of the present application, the corresponding relationship data of the water storage containers of different heights and the intersection points of the shell 10 are saved respectively. In actual application, the corresponding reference data can be called from the used corresponding relationship database to obtain the actual height information of the water storage container at the distance of the intersection point of the shell 10. At the same time, the corresponding relationship database records the actual scale of the cup opening of the water storage container under different height information, wherein the actual scale refers to the ratio of the diameter length distance of the cup opening of the water storage container in the gray image to the actual length in the real scene, which is used to measure the degree of reduction between the distance on the image and the actual distance.

[0158] Specifically, the distance of the first feature circle in the initial image relative to the intersection point of the shell 10 is obtained, and the corresponding reference data is called from the correspondence database to determine the height information of the water storage container, and the size ratio of the target gray image under the height information is equal to the actual size ratio in the real scene, and the actual size ratio is taken as the first scale of the first feature circle in the feature circle set, and the relative distance between the image acquisition device and the container tray of the water dispenser 1 is obtained in advance, and the relative distance is converted into the actual size ratio of the second feature circle in the feature circle set.

[0159] The water volume of the container is obtained by the water volume calculation formula, and the single water output of the water dispenser 1 is determined according to the water volume, and the water output control instruction is generated according to the single water output to control the water outlet of the water dispenser 1 to start water output, and the water dispenser 1 is controlled to stop water output after monitoring that the water output of the water dispenser 1 reaches the single water output.

[0160] As can be seen from the above, by obtaining the initial gray image and performing feature filtering, the key information related to the water storage container can be accurately extracted to form the target gray image. Through the fitting of the target pixel contour, the feature circle set of the water storage container is accurately determined, and the water volume of the water storage container can be quickly and accurately calculated based on the feature circle, and the water output control instruction is generated accordingly to realize the automatic control of the water output of the water dispenser, thereby improving the user experience.

[0161] Since there is interference image data in the initial gray image, it is necessary to filter the interference image data to improve the processing speed of the data. Please refer to FIG. 6, which is a flowchart of a water output control method provided by an embodiment of the present application. As shown in FIG. 6, the method of the present application can include the following steps S201-S203.

[0162] S201, edge detection is performed on the target gray image to determine a plurality of initial pixel contours.

[0163] In the present application, the edge contour is a pixel set corresponding to the object boundary of the target gray image, which is a closed curve connected by adjacent pixels with the same value (usually 0).

[0164] Specifically, the target gray image is processed using a Canny algorithm or a Prewitt algorithm to identify the edge profile of each pixel region in the target gray image, wherein the Canny algorithm performs smoothing processing on the image based on a Gaussian filter, then calculates the gradient amplitude and direction, and finds the local maximum value through non-maximum suppression, and finally determines the edge through double-threshold processing, and the Prewitt algorithm uses two groups of 3x3 convolution kernels to approximately calculate the gradient, and then detects the edge through threshold processing, and the specific algorithm used is determined according to the actual use scene, which is not specifically limited here.

[0165] S202, convert the target gray image into a binary image, and perform contour enhancement processing on the initial pixel profile based on the binary image to generate a pixel profile set.

[0166] Specifically, the target gray image after edge detection is subjected to a binarization operation, i.e., the target gray image is converted into a binary image, i.e., the gray value of a pixel point in the target gray image whose gray value is greater than a gray value threshold is fixed to generate a binary image. For example, the gray value threshold is 128, there are A pixel points, B pixel points and C pixel points in the target gray image, wherein the gray value of the A pixel point is 230, the gray value of the B pixel point is 220, and the gray value of the C pixel point is 50. Since the gray value of the A pixel point and the gray value of the B pixel point are greater than the gray value threshold, the gray value of the A pixel point and the gray value of the B pixel point are both set to 200, and the gray value of the C pixel point is set to 0.

[0167] All pixel profiles in the binary image are subjected to contour enhancement processing, wherein the purpose of contour enhancement is to highlight the edges and contours in the image to facilitate subsequent processing, such as enhancing the lines of the pixel profile in the white region of the binary image to generate a pixel profile set.

[0168] S203, perform pixel dilation on each pixel in each initial pixel profile to connect each pixel with adjacent pixels to generate a pixel profile set.

[0169] Specifically, all closed pixel contours are extracted from the binary image to generate the pixel contour set, for example, the composition of each pixel in the initial pixel contour is [0, 0, 0], [0, 1, 0], [0, 0, 0], in order to simplify the example, it is assumed that the gray threshold is 1 (that is, only the pixel with a value of 1 is considered for inflation), and the distance threshold is 1 (that is, only the adjacent pixel is connected), the inflation operation is performed on each pixel in the initial pixel contour respectively, in this example, only one pixel with a value of 1 is located in the second row and the second column, then the pixel is connected with its adjacent pixel, the adjacent pixel is defined as the pixel with a gray value greater than the gray threshold and a relative distance less than the distance threshold, after the inflation operation, a new pixel contour set is obtained, which is [0, 0, 0], [0, 1, 1], [0, 1, 1], in the pixel contour set, the original isolated pixel has been connected with its adjacent pixel to form a continuous contour.

[0170] As can be seen from the above, the edge detection step can identify the edge information in the image to form a plurality of preliminary pixel contours. By converting the target gray image into a binary image, the processing of the binary image simplifies the image data, so that the subsequent contour analysis and processing are more efficient. The preliminary pixel contours are enhanced based on the binary image to strengthen the clarity of the contours and improve the accuracy and stability of the contours. By connecting a single pixel with its adjacent pixel that meets a certain condition to form a more complete and continuous pixel contour through inflation of the pixel, the identification accuracy of the cup mouth and the cup bottom of any water storage container can be improved by combining the plurality of enhanced pixel contours obtained by the above processing to form a pixel contour set.

[0171] The gray image is divided into granules to improve the accuracy of the gray value determination of each pixel in the gray image. Referring to FIG. 7, FIG. 7 is a flowchart of a water output control method according to an embodiment of the present application. As shown in FIG. 7, the method according to the embodiment of the present application can include the following steps S301-S307.

[0172] S301, each pixel contour in the pixel contour set is screened to obtain a target pixel contour.

[0173] Specifically, the contour area of each pixel contour in the contour set is obtained, and the target pixel contour is determined according to the contour area, wherein the target pixel contour includes a first target pixel contour and a second target pixel contour, the contour area of the first target pixel contour and the second target pixel contour are both greater than an area threshold, and the area of the first target pixel contour is greater than the contour area of the second target pixel contour.

[0174] S302, the target pixel contour is circularly fitted to obtain a first feature circle and a second feature circle.

[0175] S303, generating a feature circle set based on the first feature circle and the second feature circle.

[0176] Specifically, in S302-S303, the first target pixel contour and the second target pixel contour are respectively subjected to a circle fitting operation, i.e., the first target pixel contour and the second target pixel contour are simulated as an elliptical contour, to obtain a first feature circle corresponding to the first target pixel contour and a second feature circle corresponding to the second target pixel contour, and generate a feature circle set based on the first feature circle and the second feature circle.

[0177] S304, filtering the pixel contours in the un-closed state in the pixel contour set to obtain a plurality of pixel contours in the closed state.

[0178] Specifically, each pixel contour in the pixel contour set is traversed to determine the pixel contour in the un-closed state. For example, the pixel contour set includes A pixel contour, B pixel contour and C pixel contour, and after detection, it is found that the contour of the B pixel contour is in the un-closed state. At this time, the B pixel contour is filtered and deleted from the pixel contour set.

[0179] S305, obtaining the contour area of each pixel contour in the closed state.

[0180] S306, obtaining the first target pixel contour and the second target pixel contour based on the contour area.

[0181] S307, determining the first target pixel contour as the first feature circle and determining the second target pixel contour as the second feature circle.

[0182] Specifically, in S305-S307, the closed state refers to a continuous and uninterrupted pixel boundary, for example, a complete circular or rectangular contour is closed, while an open line segment is not. For example, the pixel contours in the closed state include A pixel contour and B pixel contour, and through calculation, it is known that the contour area of the A pixel contour is greater than that of the B pixel contour. At this time, the A pixel contour is determined as the first target pixel contour, the B pixel contour is determined as the second target pixel contour, and the first target pixel contour is determined as the first feature circle and the second target pixel contour is determined as the second feature circle. The first feature circle is the cup mouth of the water storage container, and the second feature circle is the cup bottom of the water storage container.

[0183] Please refer to FIG. 8, which is a scene schematic diagram of a water output control method provided by an embodiment of the present application.

[0184] As shown in FIG. 8, when there are multiple pixel contours in the grayscale image, the area sizes of the multiple pixel contours are respectively acquired, and the first feature circle and the second feature circle are further determined according to the area sizes of the pixel contours.

[0185] As can be seen from the above, the pixel contours are screened to identify the pixel contours with representativeness and accuracy, thereby providing a reliable basis for subsequent feature circle fitting. The circle fitting operation is performed on the screened target pixel contours, and the circle that best represents the pixel contours can be found. In order to further optimize the identification speed of the feature circles, the pixel contours in the unsealed state in the pixel contour set are filtered, and the contour area of the pixel contours in the sealed state is acquired, so as to determine the first target pixel contour and the second target pixel contour, and the first target pixel contour is determined as the first feature circle and the second target pixel contour is determined as the second feature circle, thereby further improving the identification accuracy of the cup mouth and the cup bottom of the water storage container.

[0186] Since the shell 10 of the water dispenser 1 is a mirror surface material, the surface of the water storage container in the shell 10 will be imaged and acquired in the area image collected by the image acquisition device. At this time, this part of the area image is the interference area. In order to improve the processing speed of the image, please refer to FIG. 9, which is a flowchart of a water output control method provided by an embodiment of the present application. As shown in FIG. 9, the method of the embodiment of the present application can include the following steps S401-S403.

[0187] S401, acquiring an initial grayscale image of the water storage container.

[0188] Specifically, when the water dispenser 1 is in a standby state, the image acquisition device continuously captures the image frames below the water outlet at a low power consumption, and performs frame-by-frame comparison and analysis on the continuous image frames to detect whether there is a feature change in the current frame image compared with the previous frame image, especially those that may indicate that the area where the water cup is placed in front of the water dispenser 1 changes. Once it is detected that there is a feature of the container in the current frame image, the current frame image is converted into an initial grayscale image.

[0189] S402, determining an interference area image from the initial grayscale image.

[0190] S403, determining an image division range for the initial grayscale image based on the interference area image, and dividing the initial grayscale image based on the image division range to obtain a target grayscale image.

[0191] Specifically, in S402-S403, specifically, the relative position of the side image of the water dispenser 1 in the initial grayscale image is determined by a preset image processing algorithm, and the image division range is determined based on the relative position, and the initial grayscale image is divided based on the image division range to obtain the target grayscale image.

[0192] Please refer to FIG. 10, which is a scene diagram of a water outlet control method provided by an embodiment of the present application.

[0193] As shown in FIG. 10, as shown in the left diagram of FIG. 10, the area on the left side of the dotted line in the initial gray image is the interference area image of the shell 10. At this time, the image division range for the initial gray image is determined based on the dotted line, and after the interference area image on the left side is divided and deleted, the target gray image is obtained.

[0194] As can be seen from the above, by determining the interference area image from the initial gray image and dividing and cropping the interference area image from the initial gray image to generate the target gray image, the key information of the water storage container can be focused on more, and the time cost caused by processing redundant data is reduced, thereby speeding up the processing speed.

[0195] In order to further improve the precise control of the water outlet of the water dispenser 1, please refer to FIG. 11, which is a flowchart of a water outlet control method provided by an embodiment of the present application. As shown in FIG. 11, the method of the present application can include the following steps S501-S505.

[0196] S501, obtaining the first relative distance between the side boundary of the water dispenser 1 and the first characteristic circle from the initial gray image.

[0197] S502, determining the height information of the water storage container and the first scale of the first characteristic circle according to the first relative distance, and determining the first area of the first characteristic circle based on the first scale.

[0198] Specifically, in S501-S502, the side boundary is the intersection point of the image acquisition device acting on the shell 10 of the water dispenser 1, that is, the intersection bottom of the shell 10, and the distance between the leftmost point of the first characteristic circle and the intersection point of the shell 10 is calculated in the initial gray image to obtain the first relative distance.

[0199] The height information of the water storage container under the first relative distance is queried in the corresponding relationship database, and the actual scale of the first characteristic circle under the height information is queried, which is recorded as the first scale. The actual area of the cup mouth is determined based on the first scale, and is recorded as the first area. For example, 5 millimeters of the cup mouth in the initial gray image is equal to 1 centimeter in the actual scene. For another example, the diameter of the cup mouth in the initial gray image is 2 centimeters, which is equal to 4 centimeters in the actual scene.

[0200] S503, obtaining the second relative distance between the bottom boundary of the water dispenser and the image acquisition device of the water dispenser from the initial gray image.

[0201] S504, determining a second scale of the second feature circle according to the second relative distance, and determining a second area of the second feature circle based on the second scale.

[0202] Specifically, in S503-S504, the bottom boundary is the position of the upper surface of the container tray in the water dispenser 1 as the boundary value. The relative distance between the image acquisition device and the container tray of the water dispenser 1 is obtained in advance, wherein the relative distance is a fixed distance. The relative distance is converted into the actual scale of the bottom of the water storage container, denoted as the second scale, and the actual area of the second feature circle is determined according to the second scale, i.e. the area of the bottom of the water storage container, denoted as the second area.

[0203] S505, determining the water volume of the water storage container based on the height information, the first area and the second area.

[0204] Specifically, for example, the height information is 8 centimeters, the scale of the first feature circle is 1:2 (1 centimeter on each photo represents 2 centimeters in reality), and the scale of the second feature circle is 1:1.5 (1 centimeter on each photo represents 1.5 centimeters in reality), at this time the height information is converted into the actual height using the scale of the first feature circle, i.e. the height information is 8 centimeters x 2 = 16 centimeters, and for another example, assuming that the second feature circle on the target gray image photo is 4 centimeters and the first feature circle is 6 centimeters, then the second area corresponding to the second feature circle is 4 centimeters x 1.5 = 6 centimeters, and the second area corresponding to the second feature circle is 6 centimeters x 2 = 12 centimeters, according to the water volume calculation formula v = π x ((6 centimeters + 12 centimeters) / 2) ^ 2 x 16 centimeters ≈ 3600π cubic centimeters, i.e. the water volume of the water storage container is approximately equal to 3600π cubic centimeters.

[0205] Please refer to FIG. 12, which is a scene diagram of a water output control method provided by an embodiment of the present application, as shown in FIG. 12, the first relative distance is the relative distance between the lens bottom of the shell 10 and the left pixel point of the first feature circle, and the second relative distance is the relative distance between the image acquisition device and the container tray of the water dispenser 1.

[0206] As can be seen from the above, by measuring the first relative distance between the side boundary of the water dispenser 1 and the first feature circle, the height information of the water storage container is determined, and the scale of the first feature circle is determined according to the height information, and then the area thereof is accurately calculated. By measuring the second relative distance between the bottom boundary of the water dispenser 1 and the image acquisition device, the scale of the second feature circle is determined, and thus the water volume of the water storage container can be accurately calculated, so as to ensure that each water output can meet the needs of the user, thereby improving the user experience.

[0207] To improve the use safety of the water dispenser 1, the embodiment of the present application provides a device control method, and the execution subject of the device control method is the water dispenser 1. The following will be described in detail, and it should be noted that the description order of the following embodiments is not regarded as the limitation on the preferred order of the embodiments. Please refer to FIG. 13, which is a scene schematic diagram of a device control method provided by the embodiment of the present application. As shown in FIG. 13:

[0208] The water dispenser 1 includes an image acquisition device and a water outlet, wherein the image acquisition device can be the second camera 50 shown in FIG. 1, and the water outlet can be the water outlet 10a shown in FIG. 1. 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 scene, which is not limited here. The image of the area below the water outlet includes a foreground image and a background image. The foreground image is the image captured when it is monitored that any water storage container exists. The background image is the image without the water storage container. In order to facilitate the calculation of the real-time water level of the liquid in the water storage container, it is necessary to convert the foreground image and the background image into a gray image, and further determine the water inlet of the water storage container and the real-time water level in the water storage container from the gray image. When the relative distance between the real-time water level and the water inlet is less than a preset distance, the water outlet of the water dispenser 1 is controlled to stop water output at this time.

[0209] Specifically, when the water dispenser 1 is in a standby state, the image acquisition device will monitor the image at the water outlet in real time by using the difference frame method. The difference frame method is a method of obtaining the contour of a moving target by performing difference operation on adjacent two frames in a video image sequence, which is suitable for monitoring whether a new object appears between the current frame image and the last frame image in the monitoring scene. In the present scheme, the user monitors whether the water storage container exists compared with the last frame image of the current frame image at the water outlet. When it is monitored that the water storage container exists in the current frame, the current frame image containing the water storage container is taken as the foreground image. Since the foreground image will contain part of the background image, in order to filter this part of the image, the background image is converted into a background gray image and the foreground image is converted into a foreground gray image. For the background gray image and the foreground gray image, the average pixel gray value of each region of the foreground gray image is subtracted from the average pixel gray value of each region of the background gray image by using sliding window processing to eliminate the difference of the pixel gray value, so as to generate the gray image for the water storage container.

[0210] The gray scale image of the water storage container is divided into a preset number of regional gray scale images, and target feature points in each regional gray scale 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 water storage container. After the water inlet is determined, the water dispenser 1 starts to dispense water into the water storage container, and at the same time, since the water level in the water storage container is in a dynamic change process during the dispensing process, in order to prevent liquid overflow, a plurality of gray scale images are continuously acquired by using the frame difference method to generate a water level feature map of the water storage container, wherein the water level feature map is used to display the real-time change data of the liquid inside the water storage container. The pixel points in different regions of the water level feature map have different gray scale values, in order to balance the pixel values of each region in the water level feature map, a fixed threshold binaryzation is used to fix the pixel values in the water level feature map, so as to further improve the accuracy of real-time liquefaction, wherein the fixed threshold binaryzation is to set the gray scale value of the pixel point on the gray scale image to 0 or 255, and classify according to the preset gray scale threshold, that is, the pixel greater than the gray scale threshold is set to white, and the pixel less than or equal to the gray scale threshold is set to black. Then, a plurality of water level feature maps are continuously acquired by using the frame difference method to determine the real-time water level of the liquid in the water storage container, and when the relative distance between the monitored real-time water level and the water inlet is less than the preset distance threshold, the water outlet of the water dispenser 1 is controlled to stop dispensing water into the water storage container.

[0211] It should be noted that through experimental data, it can be known that when the binaryzation pixel in the water level feature map is converted into a histogram form, the pixel value of the water level region presents continuity in the histogram, and the pixel value of the interference pixel presents discontinuity in the histogram. The pixel presenting discontinuity is the interference pixel, that is, the pixel of the falling liquid when the water outlet is dispensing water and the interference pixel formed on the wall of the water storage container due to the reflection of the material of the water storage container.

[0212] Based on the scene diagram shown in FIG. 13, the device control method provided by the embodiment of the present application will be described in detail below in combination with FIGS. 14-21.

[0213] Based on the above situation, the embodiment of the present application provides a device control method. Please refer to FIG. 14, which is a flowchart of a device control method provided by the embodiment of the present application. As shown in FIG. 14, the method of the embodiment of the present application can include the following steps S601-S604.

[0214] S601, when it is detected that there is a water storage container at the water outlet of the water dispenser, a gray scale image of the water storage container is acquired.

[0215] In the embodiment, an image acquisition device is mounted at the water outlet of the water dispenser, which is used to acquire image data of a preset view range at the water outlet in real time when the water dispenser is in a standby state. The acquired image data includes a background image and a foreground image. The background image is image data when no water storage container is placed below the water outlet, and the foreground image is image data when a water storage container is placed below the water outlet.

[0216] Specifically, when the water dispenser 1 is in the standby state, the image acquisition device is controlled to acquire a current frame image below the water outlet in real time by using a difference frame method and compare the current frame image with the background image, and when it is monitored that the water storage container feature exists in the current frame, the current frame image is determined as the foreground image. After the foreground image is determined, the water dispenser 1 enters a pre-water-out state. In the pre-water-out state, in order to determine that the water outlet of the water dispenser 1 corresponds to the water inlet of the water storage container, the background image is converted into a background grayscale image, the foreground image is converted into a foreground grayscale image, the pixel average values of each region of the background grayscale image and the foreground grayscale image are respectively determined for pixel averaging processing, and finally a grayscale image for the water storage container is obtained. In the grayscale image, the interference region outside the region where the water storage container is located relative to the background image is removed.

[0217] Please refer to FIG. 15, which is a scene schematic diagram of a device control method provided by the embodiment.

[0218] As shown in FIG. 15, the image acquisition device captures image data below the water outlet in real time at a certain shooting angle, and image data not containing any water storage container is taken as a background image. In the standby state, the water dispenser 1 continuously acquires image data below the water outlet by using a difference frame method, compares the image data of the current frame with the background image to monitor whether a water storage container is placed below the water outlet, and determines that the current frame image contains a water storage container after comparison and analysis. At this time, the current frame image is determined as a foreground image. The background image is converted into a background grayscale image, the foreground image is converted into a foreground grayscale image, the pixel average values of each region of the background grayscale image and the foreground grayscale image are respectively determined for pixel averaging processing, and finally a grayscale image for the water storage container is obtained. In the grayscale image, the interference region outside the region where the water storage container is located is removed.

[0219] S602, determining the water inlet of the water storage container from the grayscale image.

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

[0221] Specifically, the gray-scale image is evenly divided into a preset number of region images along the x direction, and for each region image, the position information of the pixels in the region image is obtained to generate a region pixel coordinate map, in which the positions of the pixels in each region image are marked in a left edge form, and the pixel with the largest y-axis in each region pixel coordinate map is determined as the target feature point.

[0222] A random algorithm is used to randomly select a preset number of region images, and the target feature points of the region images in the selected state are obtained. The target feature points of the region 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 analyzed, i.e., 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 water storage container.

[0223] S603, controlling the water dispenser to dispense water to the water storage container, and obtaining the real-time water level of the liquid in the water storage container.

[0224] In the embodiments of the present application, after determining the water inlet of the water storage container, the water dispenser is switched from the pre-water dispensing state to the water dispensing state, and the real-time water level inside the water storage container is obtained at the same time to prevent the liquid inside the water storage container from overflowing.

[0225] Specifically, when the water dispenser starts to dispense water to the water storage container, a gray-scale image of the water storage container is obtained every interval preset time length by the difference frame method, and the gray-scale image of the current frame is compared with the gray-scale image obtained in the last frame to generate a water level feature map of the liquid inside the water storage container. The feature pixels represented in the water level feature map are pixels with a gray-scale value greater than a gray-scale threshold. All pixels greater than the gray-scale threshold in the water level feature map are obtained, and the pixels are subjected to fixed threshold binarization processing, wherein the fixed threshold binarization processing is an image processing method that can set the gray-scale value of the pixel to 0 or 255, so that the entire gray-scale image presents a visual effect of only black and white. The coordinate positions of the pixels after fixed threshold binarization processing are obtained, and the pixel point with the largest coordinate position in the current frame water level feature map is determined as the real-time water level of the water storage container.

[0226] S604, when the distance between the real-time water level and the water inlet is less than a preset distance threshold, controlling the water dispenser to stop dispensing water to the water storage container.

[0227] Specifically, the water level feature map corresponding to the gray image of the current frame is obtained to determine the real-time water level inside the water storage container. Since the water inlet of the water storage container has been determined in step S602, the pixel point with the maximum coordinate position in the water level feature map, i.e., the relative distance between the real-time water level and the water inlet of the water storage container, needs to be determined. If the distance between the real-time water level and the water inlet is less than the preset distance threshold, the water outlet of the water dispenser 1 is stopped at this time.

[0228] As can be seen from the above, by detecting that the water storage container is placed at the water outlet of the water dispenser, the image of the water storage container is automatically captured by the image acquisition device of the water dispenser and a gray image is generated, and the water inlet position of the water storage container is accurately identified through image processing technology, thereby improving the identification efficiency of the water inlets of different water storage containers. By identifying the water inlet of the water storage container and starting to dispense water into the water storage container, and simultaneously monitoring the real-time change of the water level in the water storage container, once the distance between the water level and the water inlet of the water storage container reaches the preset safety distance threshold, the water dispenser is automatically stopped, thereby effectively preventing the safety hazard caused by liquid overflow, and improving the user experience.

[0229] Since there is a large amount of redundant data in the background image and the foreground image, the redundant data needs to be filtered to improve the processing speed of the data. Please refer to FIG. 16, which is a flowchart of a device control method according to an embodiment of the present application. As shown in FIG. 16, the method of the present application can include the following steps S701-S705.

[0230] S701, respectively acquiring a background image at the water outlet and a foreground image at the water outlet.

[0231] S702, generating a gray image based on the background image and the foreground image.

[0232] Specifically, in steps S701-S702, when the water dispenser 1 is in a standby state, the image acquisition device is controlled to use the difference frame method to acquire the current frame image below the water outlet in real time and compare it with the background image, and when it is monitored that the current frame contains the characteristics of the water storage container, the current frame image is determined as the foreground image. After the foreground image is determined, the water dispenser 1 will enter a pre-water dispensing state. In the pre-water dispensing state, the background image is converted into a background gray image, and the foreground image is converted into a foreground gray image. The pixel average values of each region of the background gray image and the foreground gray image are determined respectively for pixel averaging processing, and finally the gray image for the water storage container is obtained.

[0233] S703, converting the background image into a background gray image, and converting the foreground image into a first foreground gray image.

[0234] Specifically, for the obtained background image and foreground image, image processing algorithms such as weighted average method and simple average method are used in time division, which are not limited here, wherein the weighted average method allocates weights according to the sensitivity of the human eye to different colors, and the simple average method averages the values of the RGB three color channels. For each pixel in the background image and the foreground image. According to the selected image processing algorithm, the corresponding conversion formula is applied, and 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. 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.

[0235] S704, obtaining a first local pixel average value of the background gray image, and obtaining a second local pixel average value of the first foreground gray image.

[0236] Specifically, the background gray image and the first foreground gray image are both divided into local area images of the same number and size, and the sliding window processing method is used to traverse the pixel average value of each local area image.

[0237] S705, determining the gray image based on the local pixel average value difference.

[0238] Specifically, the local pixel average values of each region obtained from the background gray image and the local pixel average values of each region of the first foreground gray image are sequentially calculated by difference to generate new local pixel values, and the gray image is generated based on the local pixel values.

[0239] It should be noted that when the local pixel average value difference is large, it means that the contrast of the background gray image and the first foreground gray image is high, and the outline of the water storage container can be more clearly represented. When the local pixel average value difference is small, it means that the contrast of the background gray image and the first foreground gray image is low, for example, the average pixel value of the first local area in the obtained background gray image is 13.33, and the second local pixel average value of the first foreground gray 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 all local pixel average values in the background gray image and the first foreground gray image is obtained to generate the gray image.

[0240] As can be seen, the background image and the foreground image at the water outlet are captured respectively, wherein the background image is a pure image without the water storage container, and the foreground image contains the actual water storage container. The background image and the foreground image are converted into a background gray image and a foreground gray image respectively, so as to further calculate the pixel average value of the background gray image and the foreground gray image in a local area, and obtain a pixel difference value, i.e. a local pixel average value difference. Thus, the outline and details of the water storage container are more clearly presented. Based on the optimized gray image, the water inlet of the water storage container can be accurately located, accurate reference is provided for subsequent water outlet operation, and the recognition accuracy of the water inlet is improved.

[0241] Since there are a large number of pixels in the gray image, the gray image needs to be divided into granules to improve the accuracy of the gray value determination of each pixel in the gray image. Please refer to FIG. 17, which is a flowchart of a device control method provided by an embodiment of the present application. As shown in FIG. 17, the method of the present embodiment can include the following steps S801-S807.

[0242] S801, the gray image is divided into regions to obtain a plurality of region images.

[0243] Specifically, the gray image is uniformly divided into a preset number of region images along the x direction, for example, the gray image is divided into 20 region images along the x direction.

[0244] S802, the feature points of each region image are combined to determine the water inlet.

[0245] Specifically, the pixel points with a pixel gray value greater than a gray threshold value in each region image are determined as the feature points, wherein each region image includes at least one feature point. Then, the coordinate values of the feature points in each region image are obtained to determine the target feature points corresponding to each region image. Then, a preset number of region images are selected by random calling, and the target feature points in the selected region images are connected to determine the water inlet of the water storage container.

[0246] S803, the gray image is divided into a preset number of region images, and each region image includes at least one feature point.

[0247] S804, the coordinate values of each feature point in each region image are obtained.

[0248] Specifically, in S303-S304, the gray-scale image is uniformly divided into a preset number of region images, for example, 20 region images, and then the pixel points greater than a preset gray-scale value threshold in each region image are marked as feature points, and a feature point coordinate graph in each region image is generated, which marks the X coordinate point and the Y axis coordinate point of each feature point.

[0249] S805, the feature point with the maximum coordinate value in each region image is determined as a target feature point, and a feature circle set is generated based on the target feature point.

[0250] Specifically, based on the feature point coordinate graph obtained in S804, the feature point with the maximum Y axis in the feature point coordinate graph corresponding to each region image is determined as the target feature point. A preset number of region images are selected by random calling, and the target feature points in the selected region images are obtained and connected to generate a feature circle. The random selection of a preset number of target feature points of all region images is randomly combined, and the feature circle set is obtained.

[0251] S806, the number of feature points contained in the target feature points in each feature circle in the feature circle set is obtained.

[0252] S807, the feature circle with the maximum number of feature points in the feature circle set is determined as the water inlet.

[0253] Specifically, in S806-S807, the feature circle set is traversed to determine the number of target feature points contained in the line segment of each feature circle in the feature circle set, and the feature circle with the most contained target feature points is determined as the water inlet. For example, there are three feature circles in the feature circle set, A feature circle, B feature circle and C feature circle, wherein the line segment of A feature circle contains 5 target feature points, the line segment of B feature circle contains 10 target feature points, and the line segment of C feature circle contains 20 target feature points. Since the line segment of C feature circle contains the most target feature points, C feature circle is determined as the water inlet of the water storage container.

[0254] Please refer to Figure 18, which is a scene diagram of a device control method provided by an embodiment of the present application.

[0255] As shown in Figure 18, the gray-scale image is divided into a preset number of region images, and the pixel point coordinate graph of each region image is obtained, the pixel point coordinate graph shows the feature points with a gray-scale value greater than a gray-scale threshold, and the feature point with the maximum Y axis value in the pixel point coordinate image is determined as the target feature point. The target feature points of three region images are randomly selected to connect to combine feature circles, and the number of other target feature points contained in each feature circle is determined to determine the water inlet of the water storage container.

[0256] As can be seen from the above, by dividing the gray-scale image into multiple smaller area images through area division, the processing accuracy of each area is improved. By identifying the pixel points with a gray value exceeding a preset threshold in each area image and determining the coordinate values of the feature points in each area image, the feature point with the largest coordinate value in each area is found and defined as a target feature point, and a feature circle set is generated around the 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 water storage container, thereby ensuring the recognition accuracy and robustness of the water inlet of the water storage container.

[0257] In order to improve the accurate control of the water dispenser 1 on the water outlet of the water storage container, please refer to FIG. 19, which is a flowchart of a device control method provided by an embodiment of the present application. As shown in FIG. 19, the method of the embodiment of the present application can include the following steps S901-S905.

[0258] S901, acquiring continuous frame images of the water inlet during the water outlet period of the water dispenser to the water storage container.

[0259] S902, obtaining a first water level change image based on the continuous frame images.

[0260] Specifically, in S901-S902, when the water dispenser 1 is in the water outlet state, a plurality of continuous frame images of the water inlet of the water storage container are acquired by using the difference frame method, and a first water level change image is determined based on the current frame image.

[0261] S903, performing equalization processing on the pixel points greater than the gray threshold in the first water level change image to obtain a second water level change image.

[0262] In the embodiment of the present application, the main role of performing equalization processing on the pixel points greater than the gray threshold in the first water level change image is to enhance the contrast of the image, so that the water level line is more clearly visible in the image, thereby improving the accuracy and reliability of water level detection. The equalization processing adjusts the gray value distribution of the pixel points 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, facilitating subsequent image analysis and processing.

[0263] Specifically, the first water level change image is pre-processed, including denoising and enhancement, to improve the image quality. The pixel points in the image are divided into two categories by threshold segmentation, i.e., greater than and less than the gray threshold. For the pixel points greater than the gray 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. Then edge detection and thinning are performed to obtain more accurate water level edges. The water level line is optimized through connectivity processing and smoothing processing to generate a second water level change image.

[0264] S904, the pixel value of the pixel point in the second water level change image is fixed to generate a water level feature map.

[0265] S905, based on the water level feature map, the real-time water level of the liquid in the water storage container is determined.

[0266] Specifically, in S904-S905, a preset gray threshold is called, which 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 value of the pixel point greater than or equal to the preset gray threshold is set to the fixed gray value, while the original pixel value of other pixel points is kept unchanged. Finally, the processed water level feature map is obtained, in which the area greater than or equal to the gray threshold presents a fixed pixel gray value, thereby highlighting the water level information, for example, there is a second water level change image, the gray range of which is 0 to 255, the preset gray threshold is 128,

[0267] The second water level change image is simply denoised, for example, 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. For each pixel point, it is checked whether its gray value is greater than or equal to the preset gray threshold. If yes, the pixel value of the pixel point is set to 255, otherwise, its original pixel value is kept unchanged.

[0268] As can be seen from the above, by continuously capturing consecutive frame images at the water inlet of the water storage container during the time period when the water dispenser dispenses water into the water storage container, the first water level change image is generated by processing the consecutive frame images to obtain real-time liquid change data in the water storage container. The second water level change image is obtained by equalizing the pixel points in the first water level change image whose gray value exceeds the set threshold, to enhance the contrast of the water level change, so that the water level boundary is more obvious. The water level feature map is generated by fixing the pixel points in the second water level change image to ensure the stability and reliability of the water level feature.

[0269] In order to further improve the precision control of the water dispenser 1, please refer to FIG. 20, which is a flowchart of a device control method according to an embodiment of the present application. As shown in FIG. 20, the method according to an embodiment of the present application can include the following steps S1001-S1006.

[0270] It should be noted that the light transmittance and light reflectance of water storage containers made of different materials are different, and therefore the gray values of pixels in the respective gray images are quite different. The water level feature map is an image obtained by combining pixels with different gray values inside the water storage container. Therefore, in order to ensure the accuracy of the obtained water level feature map, the pixels in the water level feature map need to be filtered and equalized.

[0271] S1001, obtaining a second foreground gray image after a preset water outlet duration, and performing difference between the second foreground gray image and the background gray image to obtain a difference gray image.

[0272] Specifically, when the water dispenser 1 is in the water outlet state and the water outlet duration is greater than the preset duration threshold, the image acquisition device is controlled to obtain a second foreground gray image. The second foreground gray image is subjected to pixel-by-pixel difference operation with the background gray image obtained in advance to generate a difference gray image, wherein the difference gray image highlights the pixel changes in the second foreground gray image.

[0273] S1002, obtaining a plurality of preset gray thresholds, and obtaining the gray value of each pixel point in the difference gray image.

[0274] S1003, determining the number of first pixel points whose gray value in the difference gray image is less than each preset gray threshold and is not zero, to obtain the number of first pixel points corresponding to each preset gray threshold.

[0275] Specifically, in S1002-S1003, in order to determine the preset gray threshold suitable for the water storage container, a plurality of preset gray thresholds are called respectively to test the number of first pixel points whose gray value in the difference gray image is less than each preset gray threshold and is not zero, and the pixel points are marked as first pixel points.

[0276] S1004, obtaining the number of second pixel points whose gray value in the difference gray image is not zero.

[0277] Specifically, all pixel points in the difference gray image are subjected to pixel traversal and filtering to obtain the number of pixel points whose gray value in the difference gray image is not zero, and the pixel points are marked as second pixel points.

[0278] S1005, calculate the ratio of the number of first pixel points and the number of second pixel points corresponding to each preset gray threshold, to obtain the pixel point proportion corresponding to each preset gray threshold.

[0279] S1006, if there is a target gray threshold in the preset gray threshold whose pixel point proportion is greater than the preset proportion threshold, the target gray threshold is determined as the preset gray threshold.

[0280] Specifically, in S1005-S1006, the second pixel point is the pixel point whose gray value in the differential gray image is not zero, and the first pixel point is the pixel point whose gray value in the differential gray image is less than each preset gray threshold and whose gray value is not zero. By obtaining the total amount of first pixel points and calculating the proportion of the number of second pixel points and the total amount of first pixel points, it is determined whether the tested preset gray threshold can match the material of the water storage container. For example, the gray threshold whose ratio of the number of first pixel points to the number of second pixel points is greater than 10% is taken as the preset gray threshold. When the first preset gray threshold is 200, the number of second pixel points in the differential gray image is 1000, and the number of first pixel points is 500. At this time, the proportion is (500 / 1000)*100%=50%, which is greater than 10%. Therefore, the first preset gray threshold is taken as the target gray threshold, and the target gray threshold is determined as the preset gray threshold.

[0281] As can be seen from the above, by obtaining the second foreground gray image after the water dispenser discharges water to the water storage container for a preset time, and performing differential processing on the previous background gray image, a differential gray image is obtained. This step effectively highlights the changing part of the liquid in the water storage container. By selecting a plurality of preset gray thresholds and analyzing the gray value of each pixel point in the differential gray image, the pixel points whose gray value is less than the threshold but not zero are identified by comparing the gray value of each pixel point with the preset gray threshold, and the number of pixel points whose gray value is less than the threshold but not zero is calculated to determine the edge of the liquid. By calculating the pixel point proportion under each preset gray threshold, the detection effect of the liquid under different thresholds is evaluated. By screening the target gray threshold whose pixel point proportion exceeds the preset proportion threshold and determining it as the final preset gray threshold, the accuracy and safety of the water discharge process are ensured.

[0282] Optionally, when light shines on the water storage container, strong reflections can occur, which can appear as part of the water level line on the image, but are not actually the true water level. At the same time, when liquid is input into the water storage container, a water column can be formed. This water column can also generate pixel values on the image, which can interfere with the accurate detection of the water level. This means that it is necessary to identify which pixel points belong to the interference pixel points and exclude the interference pixel points from the water level feature map. By converting the pixel point coordinate values of each region in the water level feature map into a histogram form, it is monitored whether there are discontinuity points in the pixel data in the histogram, where the discontinuity points are often caused by interference factors (such as reflections or water columns). In this case, those discrete points below the discontinuity points are also caused by the same interference factors, and therefore should not be considered as part of the water level line. These points also need to be identified and excluded.

[0283] Please refer to FIG. 21, which is a scene schematic diagram of a device control method provided by an embodiment of the present application. As shown in FIG. 21, the histogram image is obtained by data mapping the pixel coordinate values of all pixel points in the water level feature map. The region shown by the dashed line 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 region are in different regions, the data in the histogram presents a discrete manner. At this time, the pixel points in the discrete region are filtered, which can ensure the accuracy of the liquid surface data acquisition.

[0284] Based on the scene schematic diagram of FIG. 4, the device control apparatus provided by an embodiment of the present application will be described in detail in combination with FIG. 22. It should be noted that the device control apparatus in FIG. 22 is used to execute the method of the embodiments shown in FIGS. 5-12 of the present application. For the sake of convenience, only the parts related to the embodiments of the present application are shown, and the specific technical details not disclosed are referred to the embodiments shown in FIGS. 5-12 of the present application. The device control apparatus 2000 can include an image acquisition unit 2001, a pixel fitting unit 2002, and a control unit 2003, as follows:

[0285] The image acquisition unit 2001 is configured to acquire an initial gray image of the water storage container, and perform feature filtering on the initial gray image to obtain a target gray image.

[0286] The pixel fitting unit 2002 is configured to determine a pixel contour set from the target gray image, and perform contour fitting on a target pixel contour in the pixel contour set to determine a feature circle set of the water storage container.

[0287] The control unit 2003 is configured to determine the water volume of the water storage container based on the feature circle set, to obtain the single water output of the water dispenser for the water storage container, and generate a water output control instruction based on the single water output to control the water dispenser to output water to the water storage container.

[0288] In some embodiments, the receiving strategy detection unit 2001 further comprises an image acquisition unit and an image generation unit.

[0289] The acquisition unit is configured to acquire a background image at the infusion port and a foreground image at the infusion port respectively, the background image being an image not containing the container, and the foreground image being an image containing the container;

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

[0291] In some embodiments, the pixel fitting unit 2002 further comprises an edge detection unit and an image enhancement unit.

[0292] The edge detection unit is configured to perform edge detection on the target grayscale image to determine a plurality of initial pixel contours.

[0293] The image enhancement unit is configured to convert the target grayscale image into a binary image, and perform contour enhancement processing on the initial pixel contours based on the binary image to generate a pixel contour set.

[0294] In some embodiments, the pixel fitting unit 2002 further comprises a first pixel processing unit.

[0295] The first pixel processing unit is configured to perform pixel dilation on each pixel in each initial pixel contour to connect each pixel with adjacent pixels to generate a pixel contour set, the adjacent pixels being pixels with a grayscale value greater than a grayscale threshold value and a relative distance less than a distance threshold value.

[0296] In some embodiments, the pixel fitting unit 2002 further comprises a second pixel processing unit, a circle fitting unit, and a generation unit.

[0297] The second pixel processing unit is configured to screen each pixel contour in the pixel contour set to obtain a target pixel contour.

[0298] The circle fitting unit is configured to perform circle fitting on the target pixel contour to obtain a first feature circle and a second feature circle, the first feature circle being larger than the second feature circle.

[0299] The generation unit is configured to generate a feature circle set based on the first feature circle and the second feature circle.

[0300] In some embodiments, the pixel fitting unit 2002 further comprises a filtering unit, a calculation unit, a target pixel contour acquisition unit, and a determination unit.

[0301] The filtering unit is configured to filter the pixel contours in the pixel contour set that are in an unsealed state to obtain a plurality of pixel contours in a sealed state.

[0302] The computing unit is configured to obtain a contour area of each pixel contour in the closed state;

[0303] The target pixel contour obtaining unit is configured to obtain a first target pixel contour and a second target pixel contour based on the contour area, the contour area of the first target pixel contour being greater than the contour area of the second target pixel contour;

[0304] The determining unit is configured to determine the first target pixel contour as a first feature circle and the second target pixel contour as a second feature circle.

[0305] In some embodiments, the image obtaining unit 2001 further includes an interference image determining unit and an image dividing unit.

[0306] The interference image determining unit is configured to determine an interference area image from the initial gray-scale image;

[0307] The image dividing unit is configured to determine an image dividing range for the initial gray-scale image based on the interference area image, and divide the initial gray-scale image based on the image dividing range to obtain a target gray-scale image.

[0308] In some embodiments, the image control unit 2003 further includes a first relative distance determining unit, a first area determining unit, a first relative distance determining unit, a first area determining unit, and a water volume determining unit.

[0309] The first relative distance determining unit is configured to obtain a first relative distance between a side boundary of the water dispenser and the first feature circle from the initial gray-scale image;

[0310] The first area determining unit is configured to determine height information of the water storage container and a first scale of the first feature circle according to the first relative distance, and determine a first area of the first feature circle based on the first scale;

[0311] The first relative distance determining unit is configured to obtain a second relative distance between a bottom boundary of the water dispenser and an image capturing device of the water dispenser from the initial gray-scale image;

[0312] The first area determining unit is configured to determine a second scale of the second feature circle according to the second relative distance, and determine a second area of the second feature circle based on the second scale;

[0313] The water volume determining unit is configured to determine a water volume of the water storage container based on the height information, the first area, and the second area.

[0314] In the embodiment of the present application, by acquiring an initial gray image and performing feature filtering, the key information related to the water storage container can be accurately extracted to form a target gray image. By fitting the target pixel contour, the feature circle set of the water storage container is accurately determined, and based on these feature circles, the water volume of the water storage container can be quickly and accurately calculated, and the water control instruction is generated accordingly to realize the automatic control of the water outlet volume of the water dispenser, thereby improving the user experience.

[0315] Based on the scene schematic diagram of FIG. 13, the device control apparatus provided by the embodiment of the present application will be described in detail below in combination with FIG. 23. It should be noted that the device control apparatus in FIG. 13 is used to execute the method of the embodiments shown in FIGS. 14-21 of the present application, and only the part related to the embodiments of the present application is shown for the convenience of description, and the specific technical details not disclosed are please refer to the embodiments shown in FIGS. 14-21 of the present application. The device control apparatus 3000 can include a detection unit 3001, an inlet identification unit 3002, a water level acquisition unit 3003, and a control unit 3004, as follows:

[0316] The detection unit 3001 is configured to acquire a gray image of the water storage container when it is detected that there is a water storage container at the water outlet of the water dispenser;

[0317] The inlet identification unit 3002 is configured to determine the water inlet of the water storage container from the gray image;

[0318] The water level acquisition unit 3003 is configured to control the water dispenser to discharge water to the water storage container and acquire the real-time water level of the liquid in the water storage container;

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

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

[0321] The acquisition unit is configured to acquire a background image at the water outlet and a foreground image at the water outlet, respectively, the background image being an image not containing the water storage container, and the foreground image being an image containing the water storage container;

[0322] The image generation unit is configured to generate a gray image based on the background image and the foreground image.

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

[0324] The image conversion unit is configured to convert the background image into a background grayscale image and convert the foreground image into a first foreground grayscale image.

[0325] The pixel value acquisition unit is configured to acquire a first local pixel average value of the background grayscale image and acquire a second local pixel average value of the first foreground grayscale image.

[0326] The pixel difference value acquisition unit is configured to acquire a difference value between the first local pixel average value and the second local pixel average value to obtain a local pixel average value difference.

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

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

[0329] The first division unit is configured to divide the grayscale image into a plurality of region images.

[0330] The feature combination unit is configured to combine feature points of each region image to determine the water inlet, the feature points being pixel points with a grayscale value greater than a preset grayscale threshold.

[0331] In some embodiments, the water inlet identification unit 3002 further includes a second division unit, a coordinate value acquisition unit, a feature circle set unit, a feature point number acquisition unit, and a water inlet determination unit.

[0332] The grayscale image is divided into a preset number of region images, and each region image contains at least one feature point.

[0333] The second division unit is configured to combine the feature points of each region image to determine the water inlet, including:

[0334] The coordinate value acquisition unit is configured to acquire a coordinate value of each feature point in each region image.

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

[0336] The feature point number acquisition unit is configured to acquire a feature point number of the target feature point included in each feature circle in the feature circle set.

[0337] The water inlet determination unit is configured to determine a feature circle with a maximum feature point number in the feature circle set as the water inlet.

[0338] In some embodiments, the water inlet recognition unit 3002 further comprises a frame image acquisition unit, a first water level image unit, a second water level image unit, a water level feature map generation unit, and a water level determination unit.

[0339] The frame image acquisition unit is configured to acquire continuous frame images of the water inlet during a water dispensing period of the water dispenser to the water storage container.

[0340] The first water level image unit is configured to obtain a first water level change image based on the continuous frame images.

[0341] The 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 value to obtain a second water level change image.

[0342] The water level feature map generation unit is configured to fix pixel values of the pixel points in the second water level change image to generate a water level feature map.

[0343] The water level determination unit is configured to determine a real-time water level of the liquid in the water storage container based on the water level feature map.

[0344] In some embodiments, the water inlet recognition unit 3002 further comprises a differential grayscale image unit, a grayscale value unit, a first pixel point unit, a second pixel point unit, a pixel point proportion unit, and a calculation unit.

[0345] The differential grayscale image unit is configured to acquire a second foreground grayscale image after a preset water dispensing duration, and perform a difference between the second foreground grayscale image and a background grayscale image to obtain a differential grayscale image.

[0346] The grayscale value unit is configured to acquire a plurality of preset grayscale threshold values, and acquire grayscale values of each pixel point in the differential grayscale image.

[0347] The first pixel point unit is configured to determine a number of first pixel points in the differential grayscale image whose grayscale values are less than each preset grayscale threshold value and are not zero, to obtain a number of first pixel points corresponding to each preset grayscale threshold value.

[0348] The second pixel point unit is configured to acquire a number of second pixel points in the differential grayscale image whose grayscale values are not zero.

[0349] The pixel point proportion unit is configured to calculate a ratio of the number of first pixel points corresponding to each preset grayscale threshold value to the number of second pixel points, to obtain a pixel point proportion corresponding to each preset grayscale threshold value.

[0350] The calculation unit is configured to, if there is a target grayscale threshold value in the preset grayscale threshold values whose pixel point proportion is greater than a preset proportion threshold value, determine the target grayscale threshold value as the preset grayscale threshold value.

[0351] In addition, the device control apparatus provided by the above-described embodiments and the water outlet amount control method and the device control method belong to the same concept, and the implementation process is described in the method embodiments, which will not be repeated here.

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

[0353] Please refer to FIG. 24, which is a structural schematic diagram of a water dispenser provided by an embodiment of the present application. As shown in FIG. 24, the water dispenser 4000 includes a processor 4001 and a memory 4002. The processor 4001 is electrically connected to the memory 4002.

[0354] The processor 4001 is the control center of the water dispenser 30 and can include one or more processing cores. The processor 4001 connects various parts of the water dispenser through various interfaces and lines, executes various functions of the water dispenser and processes data by running or calling computer programs stored in the memory 4002 and calling data stored in the memory 4002, thereby overall controlling the water dispenser. Optionally, the processor 4001 can be implemented in at least one of the following hardware forms: Digital Signal Processing (DSP), Field Programmable Gate Array (FPGA), Programmable Logic Array (PLA). The processor 4001 can integrate one or a combination of several kinds of CPUs, Graphics Processing Units (GPUs) and modems. Among them, the CPU mainly processes operating systems, user pages and application programs, etc.; the GPU is responsible for rendering and drawing display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 4001, but be realized by a separate communication chip.

[0355] The memory 4002 can be used to store software programs and modules, and the processor 4001 executes various functional applications and data processing by running the computer programs and modules stored in the memory 4002. The memory 4002 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one computer program required by a function, etc.; and the data storage area can store data created according to the use of the water dispenser, etc.

[0356] In addition, the memory 4002 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 4002 can also include a memory controller to provide access for the processor 4001 to the memory 4002.

[0357] In the embodiments of the present application, the processor 4001 in the water dispenser 30 loads the instructions corresponding to the processes of one or more computer programs into the memory 4002, and the processor 4001 runs the computer programs stored in the memory 4002 to implement various functions according to the following steps:

[0358] An initial gray-scale image of the water storage container is obtained, and feature filtering is performed on the initial gray-scale image to obtain a target gray-scale image; a pixel contour set is determined from the target gray-scale image, and contour fitting is performed on a target pixel contour in the pixel contour set to determine a feature circle set of the water storage container; the water volume of the water storage container is determined based on the feature circle set to obtain a single water output amount of the water dispenser for the water storage container, and a water output control instruction is generated based on the single water output amount to control the water dispenser to output water to the water storage container.

[0359] Optionally, the processor 4001 performs contour enhancement processing on the initial pixel contour based on the binary image to generate the pixel contour set, and specifically performs: pixel dilation is performed on each pixel in each initial pixel contour to connect each pixel with adjacent pixels to generate the pixel contour set, and the adjacent pixels are pixels with a gray-scale value greater than a gray-scale threshold and a relative distance less than a distance threshold.

[0360] Optionally, the processor 4001 performs contour fitting on the target pixel contour in the pixel contour set to determine the feature circle set of the water storage container, and specifically performs: each pixel contour in the pixel contour set is screened to obtain the target pixel contour; the target pixel contour is circularly fitted to obtain a first feature circle and a second feature circle, and the first feature circle is larger than the second feature circle; and the feature circle set is generated based on the first feature circle and the second feature circle.

[0361] Optionally, the processor 4001 performs filtering on each pixel contour in the pixel contour set to obtain a target pixel contour, and specifically performs: filtering pixel contours in the un-closed state in the pixel contour set to obtain a plurality of pixel contours in the closed state; obtaining contour areas of each pixel contour in the closed state; obtaining a first target pixel contour and a second target pixel contour based on the contour areas, the contour area of the first target pixel contour being greater than the contour area of the second target pixel contour; determining the first target pixel contour as the first feature circle and determining the second target pixel contour as the second feature circle.

[0362] Optionally, the processor 4001 performs feature filtering on the initial gray-scale image to obtain a target gray-scale image, and specifically performs: determining an interference region image from the initial gray-scale image; determining an image division range for the initial gray-scale image based on the interference region image, and dividing the initial gray-scale image based on the image division range to obtain the target gray-scale image.

[0363] Optionally, the processor 4001 performs feature filtering on the initial gray-scale image to obtain a target gray-scale image, and specifically performs: determining an interference region image from the initial gray-scale image; determining an image division range for the initial gray-scale image based on the interference region image, and dividing the initial gray-scale image based on the image division range to obtain the target gray-scale image.

[0364] In the embodiments of the present application, by obtaining the initial gray-scale image and performing feature filtering, the key information related to the water storage container can be accurately extracted to form the target gray-scale image. By fitting the target pixel contour, the feature circle set of the water storage container is accurately determined, and based on these feature circles, the water volume of the water storage container can be quickly and accurately calculated, and the water control instruction is generated accordingly to realize the automatic control of the water output of the water dispenser, thereby improving the user experience.

[0365] In another possible implementation, the processor 4001 in the water dispenser 30 loads the instructions corresponding to the processes of one or more computer programs into the memory 4002 and runs the computer programs stored in the memory 4002 by the processor 4001 to implement various functions, as follows:

[0366] When it is detected that the water storage container exists at the water outlet of the water dispenser, a gray-scale image of the water storage container is acquired; a water inlet of the water storage container is determined from the gray-scale image; the water dispenser is controlled to supply water to the water storage container, and a real-time water level of liquid in the water storage container is acquired; when a distance between the real-time water level and the water inlet is less than a preset distance threshold, the water dispenser is controlled to stop supplying water to the water storage container.

[0367] Optionally, the processor 4001, in the execution of the acquisition of the gray-scale image of the water storage container, specifically executes: acquiring a background image at the water outlet and a foreground image at the water outlet respectively, the background image being an image not containing the water storage container, and the foreground image being an image containing the water storage container; and generating the gray-scale image based on the background image and the foreground image.

[0368] Optionally, the processor 4001, in the execution of the generation of the gray-scale image based on the background image and the foreground image, specifically executes: converting the background image into a background gray-scale image and converting the foreground image into a first foreground gray-scale image; acquiring a first local pixel average value of the background gray-scale image and a second local pixel average value of the first foreground gray-scale image; acquiring a difference value 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 gray-scale image based on the local pixel average value difference.

[0369] Optionally, the processor 4001, in the execution of the determination of the water inlet of the water storage container from the gray-scale image, specifically executes: performing region division on the gray-scale image to obtain a plurality of region images; and combining feature points of each region image to determine the water inlet, the feature points being pixel points with a gray-scale value greater than a preset gray-scale threshold.

[0370] Optionally, the processor 4001, in the execution of the region division on the gray-scale image to obtain the plurality of region images, specifically executes: dividing the gray-scale image into a preset number of region images, at least one feature point being contained in each region image; and combining the feature points of each region image to determine the water inlet, including: acquiring a coordinate value of each feature point in each region image; determining a target feature point as a feature point with a maximum coordinate value in each region image, and generating a feature circle set based on the target feature point; acquiring a feature point number of the target feature points contained in each feature circle in the feature circle set; and determining a feature circle with a maximum feature point number in the feature circle set as the water inlet.

[0371] Optionally, the processor 4001, in the execution of the control of the water dispenser to the water outlet of the water storage container and the acquisition of the real-time water level of the liquid in the water storage container, specifically executes: acquiring a continuous frame image of the water inlet during the water outlet period of the water dispenser to the water storage container; obtaining a first water level change image based on the continuous frame image; performing equalization processing on the pixel points greater than the gray threshold in the water level change image 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 water storage container based on the water level feature map.

[0372] Optionally, before the processor 4001 performs the equalization processing on the pixel points greater than the gray threshold in the water level change image to obtain the second water level change image, the processor 4001 specifically executes: acquiring a second foreground gray image after a preset water outlet time, and performing difference on the second foreground gray image and the background gray image to obtain a difference gray image; acquiring a plurality of preset gray thresholds, and acquiring the gray value of each pixel point in the difference gray image; determining the number of first pixel points in the difference gray image whose gray value is less than each preset gray threshold and whose gray value is not zero to obtain the number of first pixel points corresponding to each preset gray threshold; acquiring the number of second pixel points in the difference gray image whose gray value is not zero; calculating the ratio of the number of first pixel points corresponding to each preset gray threshold to the number of second pixel points to obtain the pixel point ratio corresponding to each preset gray threshold; and if there is a target gray threshold in the preset gray thresholds whose pixel point ratio is greater than a preset ratio threshold, determining the target gray threshold as the preset gray threshold.

[0373] In the embodiments of the present application, when it is detected that the water storage container is placed at the water outlet of the water dispenser, the image of the water storage container is automatically captured by the image acquisition device of the water dispenser to generate a gray image, and the water inlet position of the water storage container is accurately identified through image processing technology, thereby improving the identification efficiency of the water inlets of different water storage containers. By identifying the water inlet of the water storage container to start the water outlet to the water storage container and simultaneously monitoring the real-time change of the water level in the water storage container, once the distance between the water level and the water inlet of the water storage container reaches a preset safety distance threshold, the water dispenser is automatically stopped, thereby effectively preventing the safety hazards caused by liquid overflow, and improving the user experience.

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

[0375] The embodiment of the present application further provides a computer readable storage medium, which stores computer program codes, and when the computer program codes are run on a computer, the computer is caused to execute the related method steps to realize the device control method or the water output control method provided by the above embodiment.

[0376] The embodiment of the present application further provides a computer program product, which, when run on a computer, causes the computer to execute the related steps to realize the device control method or the water output control method provided by the above embodiment.

[0377] The device, the computer readable storage medium, the computer program product or the chip provided by the embodiment of the present application are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved are referable to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0378] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the above division of functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0379] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented by other ways. For example, the device embodiments described above are only schematic, and the division of the modules or units is only a logical function division, and there can be another division way in actual implementation. For example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0380] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A water dispenser, characterized in that, The water dispenser comprises: a housing having a water outlet; a controller arranged in the housing; an infrared sensor arranged in the housing and electrically connected with the controller, for sensing whether a human body is close to the water dispenser; a first camera arranged in the housing and electrically connected with the controller, for being triggered to start by the infrared sensor to obtain a face image; and a second camera arranged in the housing and electrically connected with the controller, for being triggered to start by the first camera to shoot an image of a water storage container below the water outlet.

2. The water dispenser of claim 1, wherein, The controller comprises: an image processing chip electrically connected with the first camera; The water dispenser further comprises: a touch panel arranged on the housing and electrically connected with the image processing chip, for displaying water information corresponding to the face image after the image processing chip identifies the face image as a preset image.

3. The water dispenser of claim 2, wherein, The housing comprises: a front panel, the first camera and the touch panel are arranged on the front panel.

4. The water dispenser of claim 1, wherein, The water dispenser further comprises: a cover plate arranged on the housing and covering a light-emitting side of the second camera.

5. The water dispenser of claim 4, wherein, The cover plate comprises: a movable cover plate movably connected with the housing and having a first position for shielding a light path of the second camera and a second position for avoiding the light path, in the first position, the movable cover plate is sealingly connected with the housing; or a high-temperature glass cover plate fixedly connected with the housing for shielding water vapor on the second camera.

6. The water dispenser of claim 1, wherein, The housing comprises: a receiving table for placing a water cup, a projection of the water outlet is located on the receiving table in a height direction of the water dispenser.

7. The water dispenser of claim 6, wherein, The water dispenser further comprises: an irradiation lamp arranged on the housing and facing the receiving table, so that light emitted by the irradiation lamp forms a water cup placing area on the receiving table.

8. The water dispenser of claim 1, wherein, The first camera is rotatably arranged on a top of the housing or the front panel.

9. The water dispenser of claim 1, wherein, The water dispenser further comprises: a water outlet control valve arranged in the housing and communicating with the water outlet and electrically connected with the controller; wherein the controller is configured to control an opening degree of the water outlet control valve according to the obtained image of the water storage container.

10. A water cooler as claimed in any one of claims 1 to 9, wherein, The water dispenser further comprises: a water tank arranged in the housing; a water pump arranged in the housing and electrically connected with the controller; and an instant heating module arranged in the housing and electrically connected with the controller and communicating the water pump and the water outlet.

11. A water outlet quantity control method applied to a water dispenser, the method comprising: obtaining an initial gray image of a water storage container and performing feature filtering on the initial gray image to obtain a target gray image; determining a pixel contour set from the target gray image and performing contour fitting on a target pixel contour in the pixel contour set to determine a feature circle set of the water storage container; Determine a water volume of the water storage container based on the set of feature circles to obtain a single water output volume of the water dispenser for the water storage container, and generate a water output control instruction based on the single water output volume to control the water dispenser to output water to the water storage container.

12. The method of claim 11, wherein, The determining the set of pixel contours from the target gray-scale image comprises: performing edge detection on the target gray-scale image to determine a plurality of initial pixel contours; convert the target gray-scale image into a binary image, and perform contour enhancement processing on the initial pixel contours based on the binary image to generate the set of pixel contours.

13. The method of claim 12, wherein, The contour enhancement processing on the initial pixel contours based on the binary image to generate the set of pixel contours comprises: performing pixel dilation on each pixel in each of the initial pixel contours to connect each of the pixels with adjacent pixels to generate the set of pixel contours, the adjacent pixels being pixels with a gray-scale value greater than a gray-scale threshold value and a relative distance less than a distance threshold value.

14. The method of claim 11, wherein, The contour fitting on a target pixel contour in the set of pixel contours to determine the set of feature circles of the water storage container comprises: screening each of the pixel contours in the set of pixel contours to obtain the target pixel contour; performing circle fitting on the target pixel contour to obtain a first feature circle and a second feature circle, the first feature circle being greater than the second feature circle; generating the set of feature circles based on the first feature circle and the second feature circle.

15. The method of claim 11 or 14, wherein, The screening each of the pixel contours in the set of pixel contours to obtain the target pixel contour comprises: filtering the pixel contours in the set of pixel contours in an unsealed state to obtain a plurality of pixel contours in a sealed state; obtaining a contour area of each of the pixel contours in the sealed state; obtaining a first target pixel contour and a second target pixel contour based on the contour area, the contour area of the first target pixel contour being greater than the contour area of the second target pixel contour; determining the first target pixel contour as the first feature circle and determining the second target pixel contour as the second feature circle.

16. The method of claim 11, wherein, The feature filtering on the initial gray-scale image to obtain a target gray-scale image comprises: determining an interference region image from the initial gray-scale image; determining an image division range for the initial gray-scale image based on the interference region image, and dividing the initial gray-scale image based on the image division range to obtain the target gray-scale image.

17. The method according to any one of claims 11 to 15, wherein, The determining the water volume of the water storage container based on the set of feature circles comprises: obtaining a first relative distance between a side boundary of the water dispenser and the first feature circle from the initial gray-scale image; determining height information of the water storage container and a first scale of the first feature circle according to the first relative distance, and determining a first area of the first feature circle based on the first scale; obtaining a second relative distance between a bottom boundary of the water dispenser and an image acquisition device of the water dispenser from the initial gray-scale image; determine a second scale of the second feature circle according to the second relative distance, and determine a second area of the second feature circle based on the second scale; determine the water volume of the water storage container based on the height information, the first area, and the second area.

18. A device control method in which, The method is applied to a water dispenser, and the method comprises: when detecting that a water storage container exists at a water outlet of the water dispenser, acquiring a grayscale image for the water storage container; determining a water inlet of the water storage container from the grayscale image; controlling the water dispenser to dispense water to the water storage container, and acquiring a real-time water level of liquid in the water storage container; when a distance between the real-time water level and the water inlet is less than a preset distance threshold, controlling the water dispenser to stop dispensing water to the water storage container.

19. The method of claim 18, wherein, The acquiring of the grayscale image for the water storage container comprises: acquiring a background image at the water outlet and a foreground image at the water outlet respectively, the background image being an image not containing the water storage container, and the foreground image being the image containing the water storage container; generating the grayscale image based on the background image and the foreground image.

20. The method of claim 19, wherein, The generating of the grayscale image based on the background image and the foreground image comprises: converting the background image into a background grayscale image and converting the foreground image into a first foreground grayscale image; acquiring a first local pixel average value of the background grayscale image and acquiring a second local pixel average value of the first foreground grayscale image; acquiring a difference value of the first local pixel average value and the second local pixel average value to obtain a local pixel average value difference; determining the grayscale image based on the local pixel average value difference.

21. The method of claim 18 or 20, wherein, The determining of the water inlet of the water storage container from the grayscale image comprises: performing region division on the grayscale image to obtain a plurality of region images; combining feature points of each region image to determine the water inlet, the feature points being pixel points with a grayscale value greater than a preset grayscale threshold.

22. The method of claim 21, wherein, The performing of the region division on the grayscale image to obtain the plurality of region images comprises: dividing the grayscale image into a preset number of region images, at least one feature point being contained in each region image. The combining of the feature points of each region image to determine the water inlet comprises: acquiring a coordinate value of each feature point in each region image; determining a target feature point with a maximum coordinate value in each region image, and generating a feature circle set based on the target feature point; acquiring a feature point number of the target feature point contained in each feature circle in the feature circle set; determining a feature circle with a maximum feature point number in the feature circle set as the water inlet.

23. The method of claim 18, wherein, The controlling of the water dispenser to dispense water to the water storage container and the acquiring of the real-time water level of liquid in the water storage container comprise: acquiring continuous frame images of the water inlet within a water dispensing period of the water dispenser to the water storage container; acquiring a first water level change image based on the continuous frame images; Equalize the pixel points greater than the gray threshold value in the first water level change image to obtain a second water level change image; Fix the pixel value of the pixel points in the second water level change image to generate a water level feature map; Determine the real-time water level of the liquid in the water storage container based on the water level feature map.

24. The method of any one of claims 18 to 23, wherein, Before the equalizing the pixel points greater than the gray threshold value in the water level change image to obtain a second water level change image, the method further includes: Obtain a second foreground gray image after a preset water outlet duration, and perform difference between the second foreground gray image and a background gray image to obtain a difference gray image; Obtain a plurality of preset gray threshold values, and obtain the gray value of each pixel point in the difference gray image; Determine the number of first pixel points in the difference gray image, which have a gray value less than each of the preset gray threshold values and a non-zero gray value, to obtain the number of first pixel points corresponding to each of the preset gray threshold values; Obtain the number of second pixel points in the difference gray image, which have a non-zero gray value; Calculate the ratio of the number of first pixel points to the number of second pixel points corresponding to each of the preset gray threshold values to obtain the pixel point proportion corresponding to each of the preset gray threshold values; If there is a target gray threshold value in the preset gray threshold values, which has a pixel point proportion greater than a preset proportion threshold value, determine the target gray threshold value as the preset gray threshold value.

25. An apparatus control device, wherein, The method includes: An image acquisition unit is configured to acquire an initial gray image of a water storage container, and perform feature filtering on the initial gray image to obtain a target gray image; A pixel fitting unit is configured to determine a set of pixel contours from the target gray image, and perform contour fitting on a target pixel contour in the set of pixel contours to determine a set of feature circles of the water storage container; A control unit is configured to determine the water volume of the water storage container based on the set of feature circles to obtain the single water outlet volume of the water dispenser for the water storage container, and generate a water outlet control instruction based on the single water outlet volume to control the water dispenser to outlet water to the water storage container.

26. An apparatus control device, wherein, The method includes: A detection unit is configured to acquire a gray image of a water storage container when detecting that there is a water storage container at the water outlet of a water outlet device; A water inlet recognition unit is configured to determine a water inlet of the water storage container from the gray image; A water level acquisition unit is configured to control the water outlet device to outlet water to the water storage container, and acquire the real-time water level of the liquid in the water storage container; A control unit is configured to control the water outlet device to stop outletting water to the water storage container when the distance between the real-time water level and the water inlet is less than a preset distance threshold value.

27. A water dispenser, wherein, The water dispenser includes: A memory configured to store executable program code; A processor configured to call and run the executable program code from the memory, so that the water dispenser executes the water outlet volume control method of any one of claims 11 to 17 or the device control method of any one of claims 18 to 24.

28. A computer readable storage medium, wherein, The computer readable storage medium stores a computer program which, when executed, implements the water outlet amount control method of any one of claims 11 to 17 or the device control method of any one of claims 18 to 24.

Citation Information

Patent Citations

  • Home intelligent water dispenser

    CN106859334A

  • Intelligent object recognition drinking-water system

    CN106859335A

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

    CN111568218A

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

    CN111568235A

  • Water dispenser control method, water dispenser and storage medium

    CN114463554A