Filter cleanliness detection method, device and system, and electronic equipment
The method and system analyze filter images to determine cleanliness through grayscale processing and polynomial fitting, addressing the inefficiency of fixed reminder cycles by providing timely cleaning reminders based on actual dirtiness levels.
Patent Information
- Application Number
- CN202010412204.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-15
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-05-15
AI Technical Summary
Existing filter systems lack intelligence in determining the optimal time for cleaning or replacement, leading to inefficient and potentially harmful dust accumulation due to fixed reminder cycles that do not account for varying usage environments.
A method and system that analyzes filter images using grayscale processing and polynomial fitting to determine filter cleanliness, utilizing a polynomial distribution function to assess dirtiness levels and provide timely cleaning reminders.
Enables automatic and intelligent filter cleanliness detection, ensuring timely cleaning or replacement decisions based on actual dirtiness levels, enhancing the intelligence of cleanliness detection.
Smart Images

Figure CN113674196B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart home control technology, and in particular to a filter cleanliness detection method, device and system, and electronic equipment. Background Art
[0002] For electronic devices that need to filter dust, impurities or oil smoke, filters are an important consumable, such as filters for household or car air conditioners, filters for household or industrial air purifiers, filters for household or commercial range hoods, filters for vacuum cleaners, filters for fresh air systems, etc.
[0003] Since the filters of electronic devices need to filter dust, impurities, or oil smoke and other substances frequently, in order to ensure that the electronic equipment works better and avoid excessive dust accumulation on the filters causing secondary pollution to the indoor air, the currently commonly used solution is to regularly or periodically remind to replace the filters to ensure that the electronic equipment has a higher filtering effect.
[0004] However, due to the different usage environments of different electronic devices, it is difficult to ensure that when the filter reaches a preset level of dirtiness by manually or mechanically setting a fixed reminder cycle, the user will be given a cleaning reminder in a timely manner, and the degree of intelligence is low. Summary of the invention
[0005] In view of this, the present invention provides a filter cleanliness detection method, device and system, and electronic equipment, which can ensure that a cleaning reminder is given in time when the filter reaches a preset dirtiness level, thereby improving the intelligence level of cleanliness detection.
[0006] In order to achieve the above object, the present invention provides the following technical features:
[0007] A filter cleanliness detection method, comprising:
[0008] Acquire a filter image of the electronic device and perform grayscale processing on the filter image to obtain a grayscale image;
[0009] Traversing and counting the grayscale values of each pixel in the grayscale image, constructing a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determining the minimum grayscale value and the maximum grayscale value in the grayscale image;
[0010] Performing a polynomial fitting operation on multiple binary number pairs to obtain a polynomial distribution function;
[0011] Based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function, the current filter cleanliness of the electronic device is determined.
[0012] Optionally, the determining the current filter cleanliness of the electronic device filter based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function includes:
[0013] Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the maximum grayscale value to obtain a first integral value;
[0014] Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the preset grayscale value to obtain a second integral value;
[0015] Taking the ratio of the second integral value to the first integral value as the grayscale distribution index;
[0016] The grayscale distribution index is matched with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device.
[0017] Optionally, matching the grayscale distribution index with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device includes:
[0018] When the grayscale distribution index is less than the first value, determining that the current filter cleanliness is the first-level cleanliness;
[0019] When the grayscale distribution index is between the first value and the second value, the current cleanliness is determined to be the second-level cleanliness;
[0020] When the grayscale distribution index is between the second value and the third value, it is determined that the current filter cleanliness is level 3 cleanliness;
[0021] When the grayscale distribution index is greater than the third value, it is determined that the current filter cleanliness is to be cleaned.
[0022] Optionally, the method further includes determining and storing a preset grayscale value; the determining and storing the preset grayscale value includes:
[0023] Receiving a grayscale value determined by artificial experience or big data, using the grayscale value as a preset grayscale value and storing the preset grayscale value;
[0024] or,
[0025] A grayscale value sent by a user terminal is received, the grayscale value is used as a preset grayscale value, and the preset grayscale value is stored.
[0026] Optionally, performing a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function includes:
[0027] Construct the initial multinomial distribution function;
[0028] Construct a loss function for representing the sum of distances between multiple binary number pairs and the multinomial distribution function;
[0029] Adjusting the parameters of the multinomial distribution function so that the loss function is minimized;
[0030] The determined multinomial distribution function is used as the multinomial distribution function.
[0031] A filter cleanliness detection device, comprising:
[0032] An acquisition unit, used for acquiring a filter image of an electronic device and performing grayscale processing on the filter image to obtain a grayscale image;
[0033] A traversal and statistical unit, used to traverse and count the grayscale values of each pixel in the grayscale image, construct a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determine the minimum grayscale value and the maximum grayscale value in the grayscale image;
[0034] A fitting unit, used for performing a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function;
[0035] A determination unit is used to determine the current filter cleanliness of the electronic device based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function.
[0036] An electronic device, comprising:
[0037] A camera component, used for photographing the filter to obtain a filter image;
[0038] A storage component, used for storing software programs and preset grayscale values;
[0039] The processor is used to execute the software program to implement the filter cleanliness detection method as described in claim 1.
[0040] A filter cleanliness detection system, comprising:
[0041] A plurality of electronic devices, and a host device respectively connected to the plurality of electronic devices;
[0042] Each electronic device is used to photograph the filter to obtain the filter image and send it to the host device;
[0043] The host device is used to obtain the filter image of each electronic device, and execute the filter cleanliness detection method for each filter image to determine the current filter cleanliness of each electronic device, and send it to each electronic device accordingly.
[0044] A smart home system, comprising:
[0045] Controllers attached to the electronic devices, and host devices connected to the controllers;
[0046] Each controller is used to photograph the filter to obtain a filter image and send it to the host device, receive the current filter cleanliness sent by the host device, and display the current filter cleanliness;
[0047] The host device is used to obtain the filter images of each controller and execute the filter cleanliness detection method for each filter image to determine the current filter cleanliness of each electronic device, and send it to each controller accordingly.
[0048] Optionally, each controller is also used to display the current filter cleanliness of its own electronic device;
[0049] The host device is also used to send the current filter cleanliness of each electronic device to the server;
[0050] The server is used to push the current filter cleanliness of each electronic device to the user's mobile terminal;
[0051] The mobile terminal is used to display the current filter cleanliness of each electronic device for the user to view.
[0052] Through the above technical means, the following beneficial effects can be achieved:
[0053] The present invention provides a method for detecting the cleanliness of a filter. It can be understood that when there is more dirt in the filter, the grayscale value in the filter image is lower; when there is less dirt in the filter, the grayscale value in the filter image is higher. For this reason, the present invention analyzes and processes the filter image to obtain a polynomial distribution function that characterizes the overall dirtiness of the filter image, and the minimum grayscale value and maximum grayscale value in the grayscale image.
[0054] The preset grayscale value is a pre-set critical value for distinguishing whether the filter is dirty. Based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function, the current filter cleanliness of the electronic device can be determined.
[0055] The present invention can automatically determine the current filter cleanliness of the electronic device, so that a decision on whether to clean or replace the filter can be made based on the current filter cleanliness, ensuring that a cleaning reminder is given in time when the filter reaches a preset level of dirtiness, thereby improving the intelligence of cleanliness detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0058] Figure 2 A schematic diagram of the structure of a filter cleanliness detection system provided by an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of the structure of a first embodiment of a smart home system provided by an embodiment of the present invention;
[0060] Figure 4 A schematic diagram of the structure of a second embodiment of a smart home system provided by an embodiment of the present invention;
[0061] Figure 5 A flow chart of a filter cleanliness detection method provided by an embodiment of the present invention;
[0062] Figure 6 A flow chart of another filter cleanliness detection method provided by an embodiment of the present invention;
[0063] Figure 7 A flow chart of another filter cleanliness detection method provided by an embodiment of the present invention;
[0064] Figure 8 A schematic structural diagram of a filter cleanliness detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] In order to facilitate those skilled in the art to understand the application architecture of the present invention, see Figure 1 The present invention provides an electronic device, comprising:
[0067] The camera component 11 is used to photograph the filter to obtain a filter image.
[0068] The storage component 12 is used to store software programs and preset grayscale values.
[0069] The processor 13 is used to execute the software program and implement the filter cleanliness detection method.
[0070] The electronic device may be an electronic device that uses a filter, such as a household air conditioner, a car air conditioner, a household air purifier, an industrial air purifier, a household range hood, a commercial range hood, a vacuum cleaner, a sweeping robot, or a fresh air system.
[0071] A camera component 11 is installed at an appropriate position in the electronic device. The camera component 11 is used to photograph the filter and obtain an image of the filter. The camera component 11 is used to send the image of the filter to the processor 13 .
[0072] The storage component 12 in the electronic device is used to store the software program used by the processor and the preset grayscale value. The preset grayscale value can be preset before the electronic device leaves the factory, or it can be set by the user based on his own situation after the electronic device leaves the factory, which is not limited.
[0073] The processor 13 can execute the software program in the storage component 12 and perform the filter cleanliness detection method based on the filter image. For details about the filter cleanliness detection method based on the filter image, please refer to Figure 5 The embodiments shown will not be described in detail here.
[0074] In order to facilitate those skilled in the art to understand the application architecture of the present invention, see Figure 2 The present invention provides a filter cleanliness detection system, comprising:
[0075] A plurality of electronic devices 21 and a host device 22 respectively connected to the plurality of electronic devices 21.
[0076] Each electronic device 21 is used to photograph the filter to obtain the filter image and send it to the host device 22.
[0077] The host device 22 is used to obtain the filter image of each electronic device 21, and execute the filter cleanliness detection method for each filter image to determine the current filter cleanliness of each electronic device 21, and send it to each electronic device 21 accordingly.
[0078] In a smart home environment, there are usually many electronic devices that use filters, such as household air conditioners, household air purifiers, household range hoods, vacuum cleaners, sweeping robots, and fresh air systems.
[0079] Each electronic device 21 includes a camera component, a storage component and a processor. Each electronic device 21 uses the camera component to shoot the filter to obtain a filter image. The processor executes the software program in the storage component and sends the filter image to the host device 22.
[0080] In order to facilitate the unified processing of filter images, a host device 22 can be set in the smart home environment to use a high-performance host device 22 to uniformly process the filter images of each electronic device, so as to efficiently determine the current filter cleanliness of each electronic device. In this case, each electronic device 21 can save resources to process other operations.
[0081] The host device 22 includes a storage component for storing software programs and preset grayscale values, and a processor for executing the software program and implementing the filter cleanliness detection method. The preset grayscale value can be preset before the electronic device leaves the factory, or it can be set by the user based on his own situation after the electronic device leaves the factory, and there is no limitation on this.
[0082] After obtaining the filter images of each electronic device 21, the host device 22 executes the filter cleanliness detection method for each filter image respectively, thereby determining the current filter cleanliness of each electronic device 21, and then sends it to each electronic device 21 accordingly so that each electronic device can display the current filter cleanliness.
[0083] For details on the filter cleanliness detection method based on the filter image, please refer to Figure 5 The embodiments shown will not be described in detail here.
[0084] Figure 2 Each electronic device is a smart home appliance. In most cases, each electronic device is produced by the same manufacturer. In this case, each electronic device works in conjunction with a host device produced by the same manufacturer, thereby achieving the purpose of centrally determining that each electronic device displays the current filter cleanliness.
[0085] In the case that the manufacturers of various electronic devices are different, the same host device may not be compatible with multiple electronic devices from different manufacturers. Currently, the popularity of smart home appliances is not high, and most households are equipped with non-intelligent home appliances. In order to be applicable to non-intelligent home appliances and electronic devices from different manufacturers, the present invention provides a smart home system.
[0086] See also Figure 3 The present invention provides a first embodiment of a smart home system, comprising:
[0087] Controllers 31 are attached to the electronic devices respectively, and host devices 32 are connected to the controllers 31 .
[0088] Each controller 31 is used to photograph the filter to obtain a filter image and send it to the host device 32, receive the current filter cleanliness sent by the host device 31, and display the current filter cleanliness.
[0089] The host device 32 is used to obtain the filter images of each controller and execute the filter cleanliness detection method for each filter image to determine the current filter cleanliness of each electronic device, and send it to each controller accordingly.
[0090] The present invention provides a controller 31, which includes a camera component for photographing a filter to obtain a filter image, a storage component and a processor. Each controller 31 is used to be attached to each electronic device, and the attachment position is based on the camera component being able to photograph the filter of the electronic device. The attachment position of different electronic devices is different, depending on the specific electronic device, and the present invention does not limit this.
[0091] Each controller 31 uses a camera component to capture an image of the electronic device filter, and a processor executes a software program in a storage component and sends the software program to a host device 32. Optionally, each controller may further include a display screen for displaying the current cleanliness of the filter.
[0092] The host device 32 includes a storage component for storing software programs and preset grayscale values, and a processor for executing the software program and implementing the filter cleanliness detection method. The preset grayscale value can be preset before the electronic device leaves the factory, or it can be set by the user based on his own situation after the electronic device leaves the factory, and there is no limitation on this.
[0093] After obtaining the filter images of each controller 31, the host device 32 executes the filter cleanliness detection method for each filter image respectively, thereby determining the current filter cleanliness of each electronic device, and then sends it to each controller 31 accordingly, so that each controller can display the current filter cleanliness respectively.
[0094] For details on the filter cleanliness detection method based on the filter image, please refer to Figure 5 The embodiments shown will not be described in detail here.
[0095] See also Figure 4 The present invention provides a second embodiment of a smart home system, comprising:
[0096] exist Figure 3 On this basis, a server 33 connected to the host device 32 and a mobile terminal 34 connected to the server 33 are added.
[0097] The host device 32 is also used to send the current filter cleanliness of each electronic device to the server 33.
[0098] The server 33 is used to push the current filter cleanliness of each electronic device to the user's mobile terminal;
[0099] The mobile terminal 34 is used to display the current filter cleanliness of each electronic device for the user to view.
[0100] Optional, in Figure 1-Figure 4 In the embodiment shown, determining and storing the preset grayscale value includes two implementation methods:
[0101] The first implementation method is: receiving a grayscale value determined by artificial experience or big data, using the grayscale value as a preset grayscale value and storing the preset grayscale value.
[0102] The second implementation manner: receiving a grayscale value sent by a user terminal, taking the grayscale value as a preset grayscale value and storing the preset grayscale value.
[0103] Different implementation modes can be configured according to actual conditions, and the present invention does not limit this.
[0104] Since the filter cleanliness detection method executed by the electronic device and the host device is consistent, and the execution process for one filter image and multiple filter images is also consistent, the present invention takes the application of the host device to perform filter cleanliness detection on a filter image as an example to introduce the filter cleanliness detection method in detail.
[0105] See also Figure 5 , the filter cleanliness detection method includes the following steps:
[0106] Step S501: acquiring a filter image of an electronic device and performing grayscale processing on the filter image to obtain a grayscale image.
[0107] The host device obtains the filter image of the electronic device, and performs grayscale processing on the filter image to obtain a grayscale image corresponding to the filter image. The process of grayscale processing on the filter image is a mature technology and will not be described in detail here.
[0108] Optionally, after grayscale processing is performed on the filter image to obtain a grayscale image, noise reduction processing may be performed on the grayscale image to obtain a grayscale image after noise reduction.
[0109] Step S502: traverse and count the grayscale values of each pixel in the grayscale image, construct a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determine the minimum grayscale value and the maximum grayscale value in the grayscale image.
[0110] The host device traverses the grayscale image and counts the frequency of occurrence of the grayscale value of each pixel in the grayscale image, and constructs a binary number pair consisting of the grayscale value and the corresponding frequency of the grayscale value (v i ,c i ),i=1,2,...,N, where v i represents the i-th grayscale value, c i Represents the frequency of occurrence of the i-th grayscale value, and N is the total number of grayscale values.
[0111] A sorting operation is performed on each grayscale value to obtain the minimum grayscale value v_min and the maximum grayscale value v_max in the grayscale image.
[0112] Step S503: performing a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function.
[0113] According to an embodiment provided by the present invention, see Figure 6 This step S503 may include the following steps:
[0114] Step S601: construct an initial multinomial distribution function.
[0115] Based on the binary number pair (v i ,c i ),i=1,2,...,N, construct an m-th power polynomial, where m is much smaller than N.
[0116]
[0117] Among them, a j is the coefficient of x in the polynomial, and a can be obtained through steps S602 and S603. j The specific value of , x is the independent variable representing the gray value.
[0118] Step S602: construct a loss function for representing the sum of distances between a plurality of binary number pairs and the polynomial distribution function.
[0119]
[0120] Using binary pairs (v i ,c i ),i=1,2,...,N into formula (1) and formula (2) to solve the polynomial coefficients in G(x). i Take v i When y i The value of i .
[0121] In formula (2), y i It means that when the independent variable value is x i Gray value x i The actual frequency of occurrence. E represents the sum of squares of the errors between the actual frequency of the grayscale value and the predicted frequency of the grayscale value. The smaller E is, the higher the frequency y i and the predicted value G(x i ), the smaller the gap between them, the better the fitting effect of G(x) is.
[0122] Of course, the least squares method, gradient descent method, etc. can also be used to calculate the polynomial coefficients in formula (1).
[0123] The following is a scheme for the least squares method:
[0124] Construct a in formula (1) j The matrix A is:
[0125] Construct formula (1) where x i The zeroth, first, second, ... mth degree polynomial matrix X:
[0126]
[0127] Then formula (1) can be converted into linear algebraic form: G(x) = XA...Formula (3);
[0128] At the same time, formula (2) can be converted into the following form:
[0129]
[0130] Derivative of formula (4) Setting the derivative to 0, we can obtain the matrix A:
[0131] A=(X T X) -1 X T T;
[0132] The above is a solution for solving the matrix A using the least squares method. After solving A, it is substituted into G(x)=XA to obtain the polynomial distribution function.
[0133] In addition to the least squares method, the gradient descent method can also be used to calculate the coefficient a j .
[0134] Coefficient a j can be converted to: where a j is a single coefficient of G(x) in formula (1).
[0135] The partial derivative of formula (2) is:
[0136]
[0137] Therefore, the iterative formula for each coefficient of the gradient descent method is as follows:
[0138] Among them, 1≤j≤m.
[0139] For each coefficient a j The optimal value of is determined by iterating the above formula: Select coefficient a j The initial value of the iteration is then substituted into the above formula until the termination condition is met, the iteration is stopped, and a is obtained.j There are generally two types of termination conditions:
[0140] (1) The number of iterations reaches the set maximum number of iterations.
[0141] (2) The absolute value of the difference between the two values is less than the specified accuracy threshold. For example:
[0142] Of course, other methods such as the conjugate gradient method may also be used to calculate the polynomial coefficients in formula (1), which will not be described in detail. Step S603: Adjust the parameters of the polynomial distribution function to minimize the loss function.
[0143] Taking formula (1) as an example, the coefficient a in the multinomial distribution function can be adjusted j The purpose of minimizing the loss function is to find all the parameters a in function (1) j , so that G(x) fits optimally.
[0144] Step S604: using the determined polynomial distribution function as the polynomial distribution function.
[0145] Following step S503 , the process proceeds to step S504 : determining the current filter cleanliness of the electronic device based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function.
[0146] According to an embodiment provided by the present invention, see Figure 7 This step S504 may include the following steps:
[0147] Step S701: obtaining a first integral value by calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the maximum grayscale value.
[0148] Calculate the definite integral of the multinomial distribution function G(x) at the minimum grayscale value v_min and the maximum grayscale value v_max A first integral value A is obtained.
[0149] Step S702: obtaining a second integral value by calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the preset grayscale value.
[0150] The preset grayscale value is a pre-set critical value for indicating whether the filter is dirty or not.
[0151] Calculate the definite integral of the multinomial distribution function G(x) at the minimum grayscale value v_min and the preset grayscale value v A second integral value B is obtained.
[0152] Step S703: taking the ratio of the second integral value to the first integral value as a grayscale distribution index.
[0153] The ratio of the second integral value B to the first integral value A is used as the grayscale distribution index It can be understood that a smaller grayscale distribution index M indicates a smaller degree of dirtiness, and a larger grayscale distribution index M indicates a greater degree of dirtiness.
[0154] Step S704: Match the grayscale distribution index with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device.
[0155] Multiple preset cleanliness intervals can be set according to different situations, and this embodiment does not limit this.
[0156] Optionally, this embodiment provides three preset cleanliness intervals:
[0157] The first level cleanliness interval is (0, first value), the second level cleanliness interval is [first value, second value), and the third level cleanliness interval is [second value, third value).
[0158] When the grayscale distribution index is less than the first value, determining that the current filter cleanliness is the first-level cleanliness;
[0159] When the grayscale distribution index is between the first value and the second value, the current cleanliness is determined to be the second-level cleanliness;
[0160] When the grayscale distribution index is between the second value and the third value, it is determined that the current filter cleanliness is level 3 cleanliness;
[0161] When the grayscale distribution index is greater than the third value, it is determined that the current filter cleanliness is to be cleaned.
[0162] Through the above technical means, the following beneficial effects can be achieved:
[0163] The present invention provides a method for detecting the cleanliness of a filter. It can be understood that when there is more dirt in the filter, the grayscale value in the filter image is lower; when there is less dirt in the filter, the grayscale value in the filter image is higher. For this reason, the present invention analyzes and processes the filter image to obtain a polynomial distribution function that characterizes the overall dirtiness of the filter image, and the minimum grayscale value and maximum grayscale value in the grayscale image.
[0164] The preset grayscale value is a pre-set critical value for indicating whether the filter is dirty or not. Based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function, the current filter cleanliness of the electronic device can be determined.
[0165] The present invention can automatically determine the current filter cleanliness of the electronic device, so that a decision on whether to clean or replace the filter can be made based on the current filter cleanliness, ensuring that a cleaning reminder is given in time when the filter reaches a preset level of dirtiness, thereby improving the intelligence of cleanliness detection.
[0166] See also Figure 8 The present invention provides a filter cleanliness detection device, comprising:
[0167] An acquisition unit 81 is used to acquire a filter image of an electronic device and perform grayscale processing on the filter image to obtain a grayscale image;
[0168] A traversal and statistical unit 82 is used to traverse and count the grayscale values of each pixel in the grayscale image, construct a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determine the minimum grayscale value and the maximum grayscale value in the grayscale image;
[0169] A fitting unit 83, configured to perform a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function;
[0170] The determination unit 84 is used to determine the current filter cleanliness of the electronic device based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function.
[0171] Wherein, the determining unit 84 includes:
[0172] Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the maximum grayscale value to obtain a first integral value;
[0173] Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the preset grayscale value to obtain a second integral value;
[0174] Taking the ratio of the second integral value to the first integral value as the grayscale distribution index;
[0175] The grayscale distribution index is matched with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device.
[0176] The matching of the grayscale distribution index with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device includes:
[0177] When the grayscale distribution index is less than the first value, determining that the current filter cleanliness is the first-level cleanliness;
[0178] When the grayscale distribution index is between the first value and the second value, the current cleanliness is determined to be the second-level cleanliness;
[0179] When the grayscale distribution index is between the second value and the third value, it is determined that the current filter cleanliness is level 3 cleanliness;
[0180] When the grayscale distribution index is greater than the third value, it is determined that the current filter cleanliness is to be cleaned.
[0181] The filter cleanliness detection device further includes determining and storing a preset grayscale value; the determining and storing the preset grayscale value includes:
[0182] Receiving a grayscale value determined by artificial experience or big data, using the grayscale value as a preset grayscale value and storing the preset grayscale value;
[0183] or,
[0184] A grayscale value sent by a user terminal is received, the grayscale value is used as a preset grayscale value, and the preset grayscale value is stored.
[0185] The fitting unit 83 includes:
[0186] Construct the initial multinomial distribution function;
[0187] Construct a loss function for representing the sum of distances between multiple binary number pairs and the multinomial distribution function;
[0188] Adjusting the parameters of the multinomial distribution function so that the loss function is minimized;
[0189] The determined multinomial distribution function is used as the multinomial distribution function.
[0190] Through the above technical means, the following beneficial effects can be achieved:
[0191] The present invention provides a method for detecting the cleanliness of a filter. It can be understood that when there is more dirt in the filter, the grayscale value in the filter image is lower; when there is less dirt in the filter, the grayscale value in the filter image is higher. For this reason, the present invention analyzes and processes the filter image to obtain a polynomial distribution function that characterizes the overall dirtiness of the filter image, and the minimum grayscale value and maximum grayscale value in the grayscale image.
[0192] The preset grayscale value is a pre-set critical value for indicating whether the filter is dirty or not. Based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function, the current filter cleanliness of the electronic device can be determined.
[0193] The present invention can automatically determine the current filter cleanliness of the electronic device, so that a decision on whether to clean or replace the filter can be made based on the current filter cleanliness, ensuring that a cleaning reminder is given in time when the filter reaches a preset level of dirtiness, thereby improving the intelligence of cleanliness detection.
[0194] If the functions described in the method of this embodiment are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present invention that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0195] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0196] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A filter cleanliness detection method, characterized in that: include: Acquire a filter image of the electronic device and perform grayscale processing on the filter image to obtain a grayscale image; Traversing and counting the grayscale values of each pixel in the grayscale image, constructing a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determining the minimum grayscale value and the maximum grayscale value in the grayscale image; Performing a polynomial fitting operation on multiple binary number pairs to obtain a polynomial distribution function; Determining the current filter cleanliness of the electronic device based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function; Wherein, determining the current filter cleanliness of the electronic device filter based on the distribution of the preset grayscale value between the minimum grayscale value and the maximum grayscale value in the polynomial distribution function includes: Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the maximum grayscale value to obtain a first integral value; Calculating a definite integral of the polynomial distribution function on the minimum grayscale value and the preset grayscale value to obtain a second integral value; The ratio of the second integral value to the first integral value is used as a grayscale distribution index; the grayscale distribution index is matched with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device.
2. The method according to claim 1, characterized in that The matching of the grayscale distribution index with a plurality of preset cleanliness intervals to determine the current cleanliness of the filter of the electronic device includes: When the grayscale distribution index is less than the first value, determining that the current filter cleanliness is the first-level cleanliness; When the grayscale distribution index is between the first value and the second value, it is determined that the current filter cleanliness is the second-level cleanliness; When the grayscale distribution index is between the second value and the third value, it is determined that the current filter cleanliness is level 3 cleanliness; When the grayscale distribution index is greater than the third value, it is determined that the current filter cleanliness is to be cleaned.
3. The method according to claim 1, characterized in that The method also includes determining and storing a preset grayscale value; wherein determining and storing the preset grayscale value includes: Receiving a grayscale value determined by artificial experience or big data, using the grayscale value as a preset grayscale value and storing the preset grayscale value; or, A grayscale value sent by a user terminal is received, the grayscale value is used as a preset grayscale value, and the preset grayscale value is stored.
4. The method according to claim 1, characterized in that The performing of a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function comprises: Construct the initial multinomial distribution function; Construct a loss function for representing the sum of distances between multiple binary number pairs and the multinomial distribution function; Adjusting the parameters of the multinomial distribution function so that the loss function is minimized; The determined multinomial distribution function is used as the multinomial distribution function.
5. A filter cleanliness detection device, characterized in that: include: An acquisition unit, used for acquiring a filter image of an electronic device and performing grayscale processing on the filter image to obtain a grayscale image; A traversal and statistical unit, used to traverse and count the grayscale values of each pixel in the grayscale image, construct a plurality of binary number pairs consisting of grayscale values and corresponding frequencies of the grayscale values, and determine the minimum grayscale value and the maximum grayscale value in the grayscale image; A fitting unit, used for performing a polynomial fitting operation on a plurality of binary number pairs to obtain a polynomial distribution function; a determination unit, configured to determine the current filter cleanliness of the electronic device based on a distribution of a preset grayscale value between a minimum grayscale value and a maximum grayscale value in the polynomial distribution function; Wherein, the determination unit is specifically used to: obtain a first integral value by taking a definite integral of the polynomial distribution function on the minimum grayscale value and the maximum grayscale value; obtain a second integral value by taking a definite integral of the polynomial distribution function on the minimum grayscale value and the preset grayscale value; use the ratio of the second integral value to the first integral value as a grayscale distribution index; match the grayscale distribution index with a plurality of preset cleanliness intervals to determine the current filter cleanliness of the electronic device.
6. An electronic device, characterized in that: include: A camera component, used for photographing the filter to obtain a filter image; A storage component, used for storing software programs and preset grayscale values; The processor is used to execute the software program to implement the filter cleanliness detection method as described in claim 1.
7. A filter cleanliness detection system, characterized in that: include: A plurality of electronic devices, and a host device respectively connected to the plurality of electronic devices; Each electronic device is used to photograph the filter to obtain the filter image and send it to the host device; The host device is used to obtain the filter image of each electronic device, and execute the filter cleanliness detection method as described in claim 1 for each filter image to determine the current filter cleanliness of each electronic device, and send it to each electronic device accordingly.
8. A smart home system, characterized in that: include: Controllers attached to the electronic devices, and host devices connected to the controllers; Each controller is used to photograph the filter to obtain a filter image and send it to the host device, receive the current filter cleanliness sent by the host device, and display the current filter cleanliness; The host device is used to obtain the filter images of each controller and execute the filter cleanliness detection method as described in claim 1 for each filter image to determine the current filter cleanliness of each electronic device, and send it to each controller accordingly.
9. The system according to claim 8, characterized in that Each controller is also used to display the current filter cleanliness of its own electronic device; The host device is also used to send the current filter cleanliness of each electronic device to the server; The server is used to push the current filter cleanliness of each electronic device to the user's mobile terminal; The mobile terminal is used to display the current filter cleanliness of each electronic device for the user to view.
