Method, system, electronic device and storage medium for detecting oil fume concentration

By collecting oil fume images and combining them with the frame difference method and grayscale histogram statistics of background frame updates, the problem of low oil fume concentration detection accuracy is solved, and fast and accurate oil fume concentration detection is achieved to adapt to stable oil fume environments.

CN112991262BActive Publication Date: 2025-02-07NINGBO FOTILE KITCHEN WARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110162725.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-05
Publication Date
2025-02-07
Estimated Expiration
2041-02-05

AI Technical Summary

Technical Problem

The oil fume concentration detection methods in the existing technology have low detection accuracy, the infrared reflection method has strict requirements on the installation location and has a slow response speed, and the physical particle detection method cannot achieve real-time detection.

Method used

By collecting oil smoke images and obtaining oil smoke feature images, it is determined whether it contains preset objects, such as pot lids. The frame difference method of background frame update and grayscale histogram statistics are combined to calculate the target ratio of the oil smoke movement area and determine the oil smoke concentration level.

Benefits of technology

It achieves fast and accurate oil fume concentration detection, improves detection accuracy, can reflect changes in oil fume concentration in real time, avoids false detection of interference sources such as pot covers, and adapts to stable oil fume environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112991262B_ABST
    Figure CN112991262B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, electronic device and storage medium for detecting oil fume concentration, the detection method comprising: collecting an oil fume image of a current frame corresponding to an oil fume generating area; obtaining an oil fume characteristic image corresponding to the oil fume image; judging whether the oil fume image contains a preset object, and if so, obtaining a background frame image corresponding to the oil fume generating area; calculating a target frame difference image based on the oil fume characteristic image and the background frame image; obtaining a target proportion of an oil fume motion area based on the target frame difference image, and obtaining an oil fume concentration level corresponding to the oil fume generating area based on the target proportion. The present invention performs motion area detection based on background frames to accurately detect images of stable motion areas in the presence of interference sources such as pot covers, thereby realizing rapid and accurate detection of oil fume concentration, achieving a real-time detection effect, and effectively improving the accuracy of oil fume detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil fume detection, and in particular to an oil fume concentration detection method, system, electronic equipment and storage medium. Background Art

[0002] The kitchen is a necessary scene for every family to cook every day, and the effect of kitchen fume treatment directly affects the health and quality of life of family members. The traditional methods of detecting fume concentration are mainly infrared reflection method and physical particle detection method to detect the concentration of fume; among them, the infrared reflection method mainly uses the transmitting end of the device to emit infrared light, and the receiving end receives the intensity of infrared light to judge the current concentration of fume. This method has great requirements on the accuracy of the installation position of the device, and the installation position needs to ensure that there are no related interferences to the infrared light to ensure the detection accuracy; while the physical particle detection method mainly uses the sensor to detect the amount of particles in the air to judge the current fume concentration. This solution installs the sensor between the path where the fume is generated and discharged. When the fume particles come into contact with the sensor, a corresponding response will be generated, which greatly lags the response speed and fails to meet the requirements of real-time detection. Summary of the invention

[0003] The technical problem to be solved by the present invention is to overcome the defect of low detection accuracy of oil fume concentration detection in the prior art, and to provide an oil fume concentration detection method, system, electronic device and storage medium.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] The present invention provides a method for detecting oil fume concentration, the detection method comprising:

[0006] Collecting the oil smoke image of the current frame corresponding to the oil smoke generating area;

[0007] Acquire an oil smoke characteristic image corresponding to the oil smoke image;

[0008] Determine whether the oil smoke image contains a preset object, and if so, obtain a background frame image corresponding to the oil smoke generation area;

[0009] Calculate a target frame difference image based on the oil smoke feature image and the background frame image;

[0010] The target proportion of the oil fume movement area is obtained according to the target frame difference image, and the oil fume concentration level corresponding to the oil fume generation area is obtained according to the target proportion.

[0011] Preferably, the step of obtaining the background frame image corresponding to the oil smoke generating area includes:

[0012] Within the currently set time, frame difference processing is performed on two adjacent frames of oil smoke images to obtain a first frame difference image;

[0013] Obtaining a first proportion of white pixels in the first frame difference image;

[0014] It is determined whether the first proportion is less than a set threshold and lasts for a set time. If so, the next frame image is used as the background frame image.

[0015] Preferably, the step of obtaining the target proportion of the oil smoke movement area according to the target frame difference image comprises:

[0016] Calculate the target proportion corresponding to the white pixels in the target frame difference image;

[0017] Wherein, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area;

[0018] The size of the target proportion is positively correlated with the oil fume concentration level.

[0019] Preferably, the step of obtaining the oil smoke characteristic image corresponding to the oil smoke image comprises:

[0020] Performing grayscale processing on the oil smoke image to obtain a grayscale image;

[0021] The grayscale image is subjected to minimum filtering to obtain the oil smoke characteristic image.

[0022] Preferably, before the step of grayscale processing the oil smoke image to obtain a grayscale image, the step further includes:

[0023] Obtaining the minimum value image of the oil smoke image on the RGB channel (i.e., the three color channels of red, green and blue);

[0024] The step of grayscale processing the oil smoke image to obtain a grayscale image comprises:

[0025] Grayscale processing is performed on the minimum value image to obtain the grayscale image.

[0026] Preferably, when the preset object is not included in the oil smoke characteristic image, the detection method further comprises:

[0027] Performing grayscale histogram statistics on the oil fume characteristic image to obtain the oil fume concentration level corresponding to the oil fume generating area; and / or,

[0028] When the oil smoke generating area includes a cooking area, the preset object includes a pot cover.

[0029] The present invention also provides a system for detecting oil fume concentration, the detection system comprising:

[0030] The frame image acquisition module is used to acquire the oil smoke image of the current frame corresponding to the oil smoke generating area;

[0031] An oil smoke characteristic image acquisition module, used to acquire an oil smoke characteristic image corresponding to the oil smoke image;

[0032] A judging module, used for judging whether the oil smoke image contains a preset object, and if so, calling a background frame image acquisition module to acquire a background frame image corresponding to the oil smoke generating area;

[0033] A target frame difference image acquisition module is used to calculate a target frame difference image based on the oil smoke feature image and the background frame image;

[0034] A target proportion acquisition module, used for acquiring the target proportion of the oil smoke motion area according to the target frame difference image;

[0035] The oil fume concentration level acquisition module is used to acquire the oil fume concentration level corresponding to the oil fume generating area according to the target proportion.

[0036] Preferably, the background frame image acquisition module includes:

[0037] A first frame difference image calculation unit is used to perform frame difference processing on two adjacent frames of oil smoke images within a currently set time to obtain a first frame difference image;

[0038] A first proportion obtaining unit, used for obtaining a first proportion corresponding to white pixels in the first frame difference image;

[0039] The judging unit is used to judge whether the first proportion is less than a set threshold and lasts for a set time. If so, the background frame image acquisition unit is called to use the next frame image as the background frame image.

[0040] Preferably, the target proportion acquisition module is used to calculate the target proportion corresponding to the white pixel points in the target frame difference image;

[0041] Wherein, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area;

[0042] The size of the target proportion is positively correlated with the oil fume concentration level.

[0043] Preferably, the oil smoke characteristic image acquisition module includes:

[0044] A grayscale processing unit, used for performing grayscale processing on the oil smoke image to obtain a grayscale image;

[0045] The filtering processing unit is used to perform minimum filtering on the grayscale image to obtain the oil smoke characteristic image.

[0046] Preferably, the oil smoke characteristic image acquisition module further includes:

[0047] A minimum value image acquisition unit, used for acquiring the minimum value image of the oil smoke image on the RGB channel;

[0048] The grayscale processing unit is used to perform grayscale processing on the minimum value image to obtain the grayscale image.

[0049] Preferably, the oil fume concentration level acquisition module is further used to perform grayscale histogram statistics on the oil fume characteristic image to obtain the oil fume concentration level corresponding to the oil fume generating area when the preset object is not included in the oil fume characteristic image; and / or,

[0050] When the oil smoke generating area includes a cooking area, the preset object includes a pot cover.

[0051] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for detecting oil fume concentration when executing the computer program.

[0052] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for detecting oil fume concentration described in the claim are implemented.

[0053] The positive and progressive effects of the present invention are:

[0054] The oil fume feature image is obtained by sequentially performing minimum value processing, grayscale processing and minimum value filtering processing operations on the RGB channels of the oil fume image, thereby suppressing interference information in the image, improving the accuracy of obtaining the oil fume feature image, and ensuring the accuracy of subsequent oil fume concentration detection; in order to avoid false detection or interference caused by objects such as pot covers, the object recognition model is pre-trained to accurately identify whether there is a pot cover in the oil fume feature image. When it does not exist, the grayscale histogram statistics are directly used to determine the oil fume concentration level; when it exists, the oil fume motion area is detected based on the frame difference method updated by the background frame to finally determine the oil fume concentration level, so that even in the case of stable oil fume, such as the stable generation of oil fume or water vapor for a period of time (cooking food, etc.), the motion area detection based on the background frame can more accurately detect the image of the stable motion area than the existing frame difference method, thereby realizing fast and accurate detection of oil fume concentration, achieving the effect of real-time detection, and effectively improving the accuracy of oil fume detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a schematic diagram of the first scene in the cooking scene of the present invention.

[0056] Figure 2 It is a schematic diagram of the second scene in the cooking scene of the present invention.

[0057] Figure 3 This is a flow chart of the method for detecting oil fume concentration according to Example 1 of the present invention.

[0058] Figure 4 This is a flow chart of the method for detecting oil fume concentration according to Example 1 of the present invention.

[0059] Figure 5 This is a module schematic diagram of the oil fume concentration detection system of Example 2 of the present invention.

[0060] Figure 6 This is a schematic diagram of the structure of an electronic device for implementing a method for detecting oil fume concentration according to Example 3 of the present invention. DETAILED DESCRIPTION

[0061] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0062] The application scenario of the oil smoke concentration solution of the present invention is applicable to all scenarios where oil smoke concentration detection is required. When the application scenario is a cooking scenario, such as Figure 1 As shown, an image acquisition device (such as a camera) is set on the range hood, and the camera is used to collect relevant scene images of the cooking area in real time, and then two cooking areas (such as Figure 2 As shown, the relative position of each frame of oil smoke image corresponding to the cooking area is obtained.

[0063] Example 1

[0064] like Figure 3 and Figure 4 As shown, the method for detecting the oil smoke concentration of this embodiment includes:

[0065] S101, collecting the oil fume image of the current frame corresponding to the oil fume generating area; specifically, an image acquisition device may be used to collect each frame of the oil fume image of the oil fume generating area (such as a cooking area) in real time.

[0066] S102, obtaining an oil fume characteristic image corresponding to the oil fume image; wherein the oil fume characteristic image can clearly and fully highlight or reflect the distribution of oil fume in the current oil fume generating area.

[0067] Specifically, step S102 includes:

[0068] S1021, obtaining the minimum value image of the oil smoke image on the RGB channel;

[0069] S1022, performing grayscale processing on the minimum value image to obtain a grayscale image;

[0070] S1023, performing minimum filtering on the grayscale image to obtain an oil fume characteristic image, that is, obtaining an oil fume characteristic image algorithm based on the color characteristics of the oil fume itself, thereby ensuring the effectiveness and accuracy of obtaining the oil fume characteristic image.

[0071] Specifically, the formula for calculating the minimum image on the RGB channels is as follows:

[0072]

[0073] I c (y) represents the pixel value of each channel of the original image, and I(x) represents the minimum value image of the obtained RGB channel image.

[0074] The formula for converting the minimum value image into a grayscale image is as follows:

[0075] G(x)=0.3I R (x)+0.59I G (x)+0.11I B (x)

[0076] The steps of performing minimum filtering on the obtained gray value image G(x) are as follows:

[0077] (a) Select the size of the kernel matrix as 3*3; (b) Perform a sliding window operation on the grayscale image G(x) according to the size of the kernel matrix, and compare the 8-neighborhood values ​​in each sliding window with the pixel value of the center point. If there is a pixel value smaller than the center point in the 8-neighborhood, the pixel value is used to replace the pixel value of the center point; (c) Traverse G(x) in the grayscale image according to step (b) to finally obtain the oil smoke feature image.

[0078] In this embodiment, the oil fume image is processed sequentially on the RGB channels for minimum value processing, grayscale processing, and minimum value filtering processing to obtain the oil fume feature image, thereby suppressing interference information in the image, improving the accuracy of the oil fume feature image acquisition, and ensuring the accuracy of subsequent oil fume concentration detection. Of course, other image processing methods can also be combined according to actual image processing requirements to ensure the effectiveness and accuracy of the oil fume feature image acquisition.

[0079] S103, determining whether the oil smoke image contains a preset object, if so, executing step S104; if not, executing step S108;

[0080] In the cooking scenario, the preset object can be a common object such as a pot cover with a similar grayscale value to the oil fume. It can be reset and adjusted according to the object settings of the actual scene and the preset object to adapt to the corresponding scene requirements. The corresponding oil fume detection process is similar to that of the present embodiment, so it will not be repeated here.

[0081] By identifying the preset objects, the influence of interference sources such as pot covers on the detection of oil fume concentration is effectively eliminated, and false detection is avoided as much as possible. Specifically, the collected positive and negative sample data sets of pots are brought into the machine learning model for training to establish a pot cover detection model; the model is used to identify the oil fume images of the cooking area collected by the camera in real time to determine whether there is a pot cover in the oil fume image.

[0082] Among them, how to train the machine learning model based on the positive and negative sample data sets of pots to obtain the pot lid detection model is a mature technology in this field, so it will not be elaborated here.

[0083] In addition, the model training process and principles of other preset objects are similar to the training process and principles of the pot lid detection model, so they will not be repeated here.

[0084] S104, obtaining a background frame image corresponding to the oil smoke generating area;

[0085] Specifically, the traditional motion area detection method (such as the frame difference method between the previous and next frames) to determine the oil fume motion area is only applicable to the situation where the motion area changes greatly; however, when the oil fume image of the cooking area behind the pot cover is relatively stable, the oil fume is relatively stable at this time, and the change of the previous and next frames in the oil fume motion area is not obvious. It is difficult to effectively and accurately determine the range of the motion area using the traditional motion area detection method. This embodiment proposes a solution for detecting the oil fume motion area based on the frame difference method based on background frame update.

[0086] Specifically, step S104 includes:

[0087] Within the currently set time, frame difference processing is performed on two adjacent frames of oil smoke images to obtain a first frame difference image;

[0088] Obtaining a first proportion of white pixels in the first frame difference image;

[0089] Determine whether the first proportion is less than a set threshold and lasts for a set time. If so, use the next frame image as the background frame image;

[0090] Select a frame of image within the current set time With the previous frame image Perform frame difference processing to obtain a frame difference image Right now when When , the pixel position is black, otherwise it is white. Where m, n are the sizes of the image to be detected, and the white part of the pixel position is the potential oil smoke movement area.

[0091] Statistical frame difference image The ratio of the number of white pixels to the total number of pixels in the video is taken into account. Taking into account the difference between the previous and next frame images caused by the noise of the video stream itself (generated by the hardware performance of the device collecting the video stream), the ratio of the number of pixels in the moving area to the number of pixels of a set value (such as 10%) can be selected as the threshold for dividing whether it is a background frame. That is, when the proportion of the moving area is less than 10% and the duration is greater than T, the current frame is taken as the background frame image in a relatively stable situation.

[0092] The background frame image is updated in real time to ensure that the frame difference image between the background frame image and the current frame image can accurately reflect the oil smoke concentration in the current scene.

[0093] S105, calculating a target frame difference image based on the oil smoke feature image and the background frame image;

[0094] S106, obtaining a target proportion of the oil smoke movement area according to the target frame difference image;

[0095] Specifically, step S106 includes:

[0096] S1061, calculating and obtaining the target proportion corresponding to the white pixels in the target frame difference image;

[0097] Among them, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area;

[0098] The size of the target proportion is positively correlated with the level of oil fume concentration.

[0099] S107. Obtain the oil fume concentration level corresponding to the oil fume generating area according to the target proportion.

[0100] Specifically, using the current frame image Image with background frame Perform frame difference calculation to obtain a frame difference image based on the background frame image Right now

[0101] Get the frame difference image based on the background frame image Finally, the ratio of the number of non-zero pixels (i.e., white pixels) in the binarized frame difference image to the total number of pixels is calculated, and this ratio is used as the proportion of the oil smoke movement area in the oil smoke feature image, and the final oil smoke concentration level is determined based on the proportion.

[0102] For example, 10% and 20% are selected as the threshold intervals for dividing the oil fume concentration levels. That is, when the proportion is greater than 20%, it is determined that the current cooking scene corresponds to a heavy smoke state; when the proportion is less than or equal to 20% and greater than 10%, it is determined that the current cooking scene corresponds to a medium or light smoke state; otherwise, it is determined that the current cooking scene corresponds to a smoke-free state.

[0103] S108, performing grayscale histogram statistics on the oil smoke characteristic image to obtain the oil smoke concentration level corresponding to the oil smoke generating area.

[0104] Specifically, the number of times the same grayscale value appears is counted based on all the pixels in the oil fume feature image, and then the grayscale histogram of 0-255 grayscale levels is transformed into three intervals, each of which has an interval length of 80, 70, and 105, respectively. The corresponding oil fume concentration level is divided according to the total number of pixels in each interval length as the final oil fume detection result.

[0105] In this embodiment, by determining whether there is a preset object in the oil fume feature image, such as whether there is a pot cover in the cooking scene, the frame difference method based on background frame update is used to identify the oil fume concentration when there is a pot cover. When there is no pot cover, the grayscale histogram statistics are directly used to determine the oil fume concentration. This effectively eliminates the interference with the oil fume movement area in the actual application process, avoids the mistaken exclusion of the oil fume area of ​​interest, and ensures the final oil fume detection accuracy and detection effect.

[0106] In this embodiment, in order to avoid false detection or interference caused by objects such as pot covers, an object recognition model is pre-trained to accurately identify whether there is a pot cover in the oil fume feature image. If not, the grayscale histogram statistics are directly used to determine the oil fume concentration level; if it exists, the oil fume motion area is detected based on the frame difference method updated by the background frame to finally determine the oil fume concentration level. Even in the case of stable oil fume, such as the situation where oil fume or water vapor is stably generated for a period of time (cooking food, etc.), the motion area detection based on the background frame can more accurately detect the image of the stable motion area than the existing frame difference method, thereby realizing fast and accurate detection of oil fume concentration, achieving the effect of real-time detection, and effectively improving the accuracy of oil fume detection.

[0107] Example 2

[0108] like Figure 5 As shown, the oil fume concentration detection system of this embodiment includes a frame image acquisition module 1, an oil fume characteristic image acquisition module 2, a judgment module 3, a background frame image acquisition module 4, a target frame difference image acquisition module 5, a target proportion acquisition module 6 and an oil fume concentration level acquisition module 7.

[0109] The frame image acquisition module 1 is used to acquire the oil smoke image corresponding to the oil smoke generating area;

[0110] Specifically, an image acquisition device may be used to acquire each frame of oil fume image of an oil fume generating area (such as a cooking area) in real time.

[0111] The oil fume characteristic image acquisition module 2 is used to acquire an oil fume characteristic image corresponding to the oil fume image; wherein the oil fume characteristic image can clearly and fully highlight or reflect the distribution of oil fume in the current oil fume generating area.

[0112] Specifically, the oil smoke characteristic image acquisition module 2 includes a minimum image acquisition unit, a grayscale processing unit and a filtering processing unit;

[0113] The minimum value image acquisition unit is used to acquire the minimum value image of the oil smoke image on the RGB channel;

[0114] The grayscale processing unit is used for performing grayscale processing on the minimum value image to obtain a grayscale image;

[0115] The filtering processing unit is used to perform minimum filtering on the grayscale image to obtain the oil smoke feature image.

[0116] That is, the oil smoke characteristic image algorithm is obtained according to the color characteristics of the oil smoke itself, which ensures the effectiveness and accuracy of the acquisition of the oil smoke characteristic image.

[0117] Specifically, the formula for calculating the minimum image on the RGB channels is as follows:

[0118]

[0119] I c (y) represents the pixel value of each channel of the original image, and I(x) represents the minimum value image of the obtained RGB channel image.

[0120] The formula for converting the minimum value image into a grayscale image is as follows:

[0121] G(x)=0.3I R (x)+0.59I G (x)+0.11I B (x)

[0122] The steps of performing minimum filtering on the obtained gray value image G(x) are as follows:

[0123] (a) Select the size of the kernel matrix as 3*3; (b) Perform a sliding window operation on the grayscale image G(x) according to the size of the kernel matrix, and compare the 8-neighborhood values ​​in each sliding window with the pixel value of the center point. If there is a pixel value smaller than the center point in the 8-neighborhood, the pixel value is used to replace the pixel value of the center point; (c) Traverse G(x) in the grayscale image according to step (b) to finally obtain the oil smoke feature image.

[0124] In this embodiment, the oil fume image is processed sequentially on the RGB channels for minimum value processing, grayscale processing, and minimum value filtering processing to obtain the oil fume feature image, thereby suppressing interference information in the image, improving the accuracy of the oil fume feature image acquisition, and ensuring the accuracy of subsequent oil fume concentration detection. Of course, other image processing methods can also be combined according to actual image processing requirements to ensure the effectiveness and accuracy of the oil fume feature image acquisition.

[0125] The judging module 3 is used to judge whether the oil smoke image contains a preset object, and if so, the background frame image acquisition module 4 is called;

[0126] In the cooking scenario, the preset object can be a common object such as a pot cover with a similar grayscale value to the oil fume. It can be reset and adjusted according to the object settings of the actual scene and the preset object to adapt to the corresponding scene requirements. The corresponding oil fume detection process is similar to that of the present embodiment, so it will not be repeated here.

[0127] By identifying the preset objects, the influence of interference sources such as pot covers on the detection of oil fume concentration is effectively eliminated, and false detection is avoided as much as possible. Specifically, the collected positive and negative sample data sets of pots are brought into the machine learning model for training to establish a pot cover detection model; the model is used to identify the oil fume images of the cooking area collected by the camera in real time to determine whether there is a pot cover in the oil fume image.

[0128] Among them, how to train the machine learning model based on the positive and negative sample data sets of pots to obtain the pot lid detection model is a mature technology in this field, so it will not be elaborated here.

[0129] In addition, the model training process and principles of other preset objects are similar to the training process and principles of the pot lid detection model, so they will not be repeated here.

[0130] The background frame image acquisition module 4 is used to acquire the background frame image corresponding to the oil smoke generation area;

[0131] Specifically, the traditional motion area detection method (such as the frame difference method between the previous and next frames) to determine the oil fume motion area is only applicable to the situation where the motion area changes greatly; however, when the oil fume image of the cooking area behind the pot cover is relatively stable, the oil fume is relatively stable at this time, and the change of the previous and next frames in the oil fume motion area is not obvious. It is difficult to effectively and accurately determine the range of the motion area using the traditional motion area detection method. This embodiment proposes a solution for detecting the oil fume motion area based on the frame difference method based on background frame update.

[0132] Specifically, the background frame image acquisition module 4 includes a first frame difference image calculation unit, a first ratio acquisition unit and a judgment unit.

[0133] The first frame difference image calculation unit is used to perform frame difference processing on two adjacent frames of oil smoke images within a currently set time to obtain a first frame difference image;

[0134] The first proportion acquisition unit is used to acquire a first proportion corresponding to white pixels in the first frame difference image;

[0135] The judging unit is used to judge whether the first proportion is less than a set threshold and lasts for a set time period. If so, the background frame image acquisition unit is called to use the next frame image as the background frame image.

[0136] Select a frame of image within the current set time With the previous frame image Perform frame difference processing to obtain a frame difference image Right now when When , the pixel position is black, otherwise it is white. Where m, n are the sizes of the image to be detected, and the white part of the pixel position is the potential oil smoke movement area.

[0137] Statistical frame difference image The ratio of the number of white pixels to the total number of pixels in the video is taken into account. Taking into account the difference between the previous and next frame images caused by the noise of the video stream itself (generated by the hardware performance of the device collecting the video stream), the ratio of the number of pixels in the moving area to the number of pixels of a set value (such as 10%) can be selected as the threshold for dividing whether it is a background frame. That is, when the proportion of the moving area is less than 10% and the duration is greater than T, the current frame is taken as the background frame image in a relatively stable situation.

[0138] The background frame image is updated in real time to ensure that the frame difference image between the background frame image and the current frame image can accurately reflect the oil smoke concentration in the current scene.

[0139] The target frame difference image acquisition module 5 is used to calculate the target frame difference image according to the oil smoke feature image and the background frame image;

[0140] The target proportion acquisition module 6 is used to acquire the target proportion of the oil smoke motion area according to the target frame difference image;

[0141] Specifically, the target proportion acquisition module 6 is used to calculate the target proportion corresponding to the white pixel points in the target frame difference image;

[0142] Among them, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area;

[0143] The size of the target proportion is positively correlated with the level of oil fume concentration.

[0144] The oil fume concentration level acquisition module 7 is used to obtain the oil fume concentration level corresponding to the oil fume generating area according to the target proportion.

[0145] Specifically, using the current frame image Image with background frame Perform frame difference calculation to obtain a frame difference image based on the background frame image Right now

[0146] Get the frame difference image based on the background frame image Finally, the ratio of the number of non-zero pixels (i.e., white pixels) in the binarized frame difference image to the total number of pixels is calculated, and this ratio is used as the proportion of the oil smoke movement area in the oil smoke feature image, and the final oil smoke concentration level is determined based on the proportion.

[0147] For example, 10% and 20% are selected as the threshold intervals for dividing the oil fume concentration levels. That is, when the proportion is greater than 20%, it is determined that the current cooking scene corresponds to a heavy smoke state; when the proportion is less than or equal to 20% and greater than 10%, it is determined that the current cooking scene corresponds to a medium or light smoke state; otherwise, it is determined that the current cooking scene corresponds to a smoke-free state.

[0148] In addition, when the judging unit judges that the preset object is not included in the oil smoke characteristic image, the oil smoke concentration level obtaining module 7 is used to perform grayscale histogram statistics on the oil smoke characteristic image to obtain the oil smoke concentration level corresponding to the oil smoke generating area.

[0149] Specifically, the number of times the same grayscale value appears is counted based on all the pixels in the oil fume feature image, and then the grayscale histogram of 0-255 grayscale levels is transformed into three intervals, each of which has an interval length of 80, 70, and 105, respectively. The corresponding oil fume concentration level is divided according to the total number of pixels in each interval length as the final oil fume detection result.

[0150] In this embodiment, by determining whether there is a preset object in the oil fume feature image, such as whether there is a pot cover in the cooking scene, the frame difference method based on background frame update is used to identify the oil fume concentration when there is a pot cover. When there is no pot cover, the grayscale histogram statistics are directly used to determine the oil fume concentration. This effectively eliminates the interference with the oil fume movement area in the actual application process, avoids the mistaken exclusion of the oil fume area of ​​interest, and ensures the final oil fume detection accuracy and detection effect.

[0151] In this embodiment, in order to avoid false detection or interference caused by objects such as pot covers, an object recognition model is pre-trained to accurately identify whether there is a pot cover in the oil fume feature image. If not, the grayscale histogram statistics are directly used to determine the oil fume concentration level; if it exists, the oil fume motion area is detected based on the frame difference method updated by the background frame to finally determine the oil fume concentration level. Even in the case of stable oil fume, such as the situation where oil fume or water vapor is stably generated for a period of time (cooking food, etc.), the motion area detection based on the background frame can more accurately detect the image of the stable motion area than the existing frame difference method, thereby realizing fast and accurate detection of oil fume concentration, achieving the effect of real-time detection, and effectively improving the accuracy of oil fume detection.

[0152] Example 3

[0153] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Example 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for detecting the oil fume concentration in Example 1 is implemented. Figure 6 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0154] like Figure 6 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0155] The bus 33 includes a data bus, an address bus, and a control bus.

[0156] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .

[0157] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0158] The processor 31 executes various functional applications and data processing by running the computer programs stored in the memory 32, such as the method for detecting the oil fume concentration in the first embodiment of the present invention.

[0159] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model generating device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. Figure 6 As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via the bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0160] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0161] Example 4

[0162] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the method for detecting oil fume concentration in Embodiment 1 are implemented.

[0163] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0164] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps in the method for detecting oil fume concentration in Example 1.

[0165] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0166] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A method for detecting oil fume concentration, characterized in that: The detection method comprises: Collecting the oil smoke image of the current frame corresponding to the oil smoke generating area; Acquire an oil smoke characteristic image corresponding to the oil smoke image; Determine whether the oil smoke image contains a preset object, and if so, obtain a background frame image corresponding to the oil smoke generation area; Calculate a target frame difference image based on the oil smoke feature image and the background frame image; Acquire a target proportion of the oil smoke movement area according to the target frame difference image, and acquire an oil smoke concentration level corresponding to the oil smoke generation area according to the target proportion; The step of obtaining the background frame image corresponding to the oil smoke generating area comprises: Within the currently set time, frame difference processing is performed on two adjacent frames of oil smoke images to obtain a first frame difference image; Obtaining a first proportion of white pixels in the first frame difference image; Determine whether the first proportion is less than a set threshold and lasts for a set time, and if so, use the next frame image as the background frame image; The step of obtaining the target proportion of the oil smoke movement area according to the target frame difference image comprises: Calculate the target proportion corresponding to the white pixels in the target frame difference image; Wherein, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area; The size of the target proportion is positively correlated with the oil fume concentration level.

2. The method for detecting oil fume concentration according to claim 1, characterized in that: The step of obtaining the oil smoke characteristic image corresponding to the oil smoke image comprises: Performing grayscale processing on the oil smoke image to obtain a grayscale image; The grayscale image is subjected to minimum filtering to obtain the oil smoke characteristic image.

3. The method for detecting oil fume concentration according to claim 2, characterized in that: Before the step of grayscale processing the oil smoke image to obtain a grayscale image, the step further includes: Obtaining the minimum value image of the oil smoke image on the RGB channel; The step of grayscale processing the oil smoke image to obtain a grayscale image comprises: Grayscale processing is performed on the minimum value image to obtain the grayscale image.

4. The method for detecting oil fume concentration according to claim 1, characterized in that: When the preset object is not included in the oil smoke characteristic image, the detection method further includes: Performing grayscale histogram statistics on the oil fume characteristic image to obtain the oil fume concentration level corresponding to the oil fume generating area; and / or, When the oil smoke generating area includes a cooking area, the preset object includes a pot cover.

5. A system for detecting oil fume concentration, characterized in that: The detection system comprises: The frame image acquisition module is used to acquire the oil smoke image of the current frame corresponding to the oil smoke generating area; An oil smoke characteristic image acquisition module, used to acquire an oil smoke characteristic image corresponding to the oil smoke image; A judging module, used for judging whether the oil smoke image contains a preset object, and if so, calling a background frame image acquisition module to acquire a background frame image corresponding to the oil smoke generating area; A target frame difference image acquisition module is used to calculate a target frame difference image based on the oil smoke feature image and the background frame image; A target proportion acquisition module, used for acquiring the target proportion of the oil smoke motion area according to the target frame difference image; A fume concentration level acquisition module, used for acquiring the fume concentration level corresponding to the fume generating area according to the target proportion; The background frame image acquisition module comprises: A first frame difference image calculation unit is used to perform frame difference processing on two adjacent frames of oil smoke images within a currently set time to obtain a first frame difference image; A first proportion obtaining unit, used for obtaining a first proportion corresponding to white pixels in the first frame difference image; a judging unit, configured to judge whether the first proportion is less than a set threshold and lasts for a set time, and if so, calling a background frame image acquisition unit to use a subsequent frame image as the background frame image; The target proportion acquisition module is used to calculate the target proportion corresponding to the white pixel points in the target frame difference image; Wherein, the area where the white pixels in the target frame difference image are located corresponds to the oil smoke movement area; The size of the target proportion is positively correlated with the oil fume concentration level.

6. The oil fume concentration detection system according to claim 5, characterized in that: The oil smoke characteristic image acquisition module comprises: A grayscale processing unit, used for performing grayscale processing on the oil smoke image to obtain a grayscale image; The filtering processing unit is used to perform minimum filtering on the grayscale image to obtain the oil smoke characteristic image.

7. The oil fume concentration detection system according to claim 6, characterized in that: The oil smoke characteristic image acquisition module also includes: A minimum value image acquisition unit, used for acquiring the minimum value image of the oil smoke image on the RGB channel; The grayscale processing unit is used to perform grayscale processing on the minimum value image to obtain the grayscale image.

8. The oil fume concentration detection system according to claim 5, characterized in that: The oil fume concentration level acquisition module is further used to perform grayscale histogram statistics on the oil fume characteristic image to obtain the oil fume concentration level corresponding to the oil fume generating area when the preset object is not included in the oil fume characteristic image; and / or, When the oil smoke generating area includes a cooking area, the preset object includes a pot cover.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting the oil fume concentration according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting oil smoke concentration described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Kitchen fume concentration division method and fume concentration detection and interference elimination method

    CN108563991A

  • Kitchen oil fume concentration detection and interference elimination method based on image processing

    CN108760590A