Range hood control method, system, range hood, and storage medium
By calculating the frame difference ratio of the grayscale image in the range hood to generate lighting change information, removing object interference, extracting the oil smoke area, and correcting the wind speed level, the problem of range hood misidentification caused by lighting changes is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202211202240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-09-29
AI Technical Summary
In open monitoring scenarios, existing range hoods experience changes in lighting conditions, leading to misidentification of fume environment information and incorrect adjustment of wind speed levels, resulting in a poor user experience.
By acquiring the image frames of the cookware, calculating the timing frame difference and frame difference ratio of the grayscale image, generating illumination change information, removing object interference information, extracting the oil fume area image, calculating the oil fume ratio, and correcting the wind speed level based on the illumination change information and the oil fume ratio.
It effectively suppresses the impact of sudden changes in ambient light on oil smoke identification, improves the accuracy of oil smoke movement information and the rationality of wind speed adjustment, and enhances user experience.
Smart Images

Figure CN115682066B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of household appliances, and in particular to a control method and system for a range hood, a range hood, and a storage medium. Background Art
[0002] Currently, range hoods use image detection methods to identify oil fume concentration and then adjust the air volume according to the oil fume concentration. However, since the range hood is in an open monitoring scenario, changes in the lighting environment in this scenario can lead to the problem of misidentification of oil fume environment information, causing the range hood to incorrectly adjust the wind speed level, resulting in a poor user experience. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the defect in the prior art that changes in the lighting environment may lead to misidentification of oil fume environment information, and to provide a control method, system, electronic device and storage medium for a range hood.
[0004] The present invention solves the above technical problems through the following technical solutions:
[0005] The present invention provides a range hood control method, comprising:
[0006] Acquire an image frame including the cookware; wherein the time interval between two adjacent image frames is a preset time length;
[0007] Calculating the timing frame difference between the grayscale images of every two adjacent image frames;
[0008] Calculating a frame difference ratio between the timing frame difference and a frame difference of a grayscale image of a latter frame in the corresponding two adjacent image frames;
[0009] Illumination change information is generated based on the frame difference ratio within a preset time period.
[0010] Preferably, generating illumination change information based on the frame difference ratio within a preset time period includes:
[0011] In the preset time period, when at least one of the frame difference ratios is greater than a preset first ratio threshold, the illumination change information indicates that severe illumination disturbance exists.
[0012] Preferably, the generating of illumination change information based on the frame difference ratio within a preset time period further includes:
[0013] Within the preset time period, when all the frame difference ratios are not greater than the first ratio threshold, counting the number of the frame difference ratios greater than a preset second ratio threshold;
[0014] If the number is within a preset number threshold range, the illumination change information indicates that there is a mild illumination disturbance; otherwise, the illumination change information indicates that there is no illumination disturbance;
[0015] The second ratio threshold is smaller than the first ratio threshold.
[0016] Preferably, before the step of generating illumination change information based on the frame difference ratio within a preset time period, the control method further comprises:
[0017] removing object interference information from the timing frame difference and extracting an oil smoke area image;
[0018] Obtaining a fume ratio based on the fume area image and a preset monitoring area;
[0019] After the step of generating illumination change information based on the frame difference ratio within a preset time period, the control method further includes:
[0020] A corrected oil fume ratio is obtained according to the illumination change information and the oil fume ratio.
[0021] Preferably, removing object interference information from the timing frame difference and extracting the oil smoke area image includes:
[0022] Converting the timing frame difference into a YCrCb (a color space using YUV color encoding) color space, and removing the human hand information from the converted image frame based on the range of Cr (red component information) and Cb (blue component information) values corresponding to the human hand to obtain a first image;
[0023] Converting the first image into an HSV (a color space that uses a hue, saturation, and value model) color space, and extracting a second image from the converted first image based on color characteristics of the oil smoke; wherein the second image includes a potential oil smoke area;
[0024] An area in the grayscale image of the second image whose variance value is less than a preset variance threshold is taken as a target fume area, and the fume area image is extracted from the grayscale image of the second image based on the target fume area.
[0025] Preferably, obtaining the oil fume ratio based on the oil fume area image and a preset monitoring area includes:
[0026] Calculating the ratio of the area corresponding to the non-zero value in the oil smoke area image to the area of the monitoring area to obtain an initial oil smoke ratio;
[0027] The initial oil fume ratio is smoothed and filtered by using an exponential weighted average method to obtain the oil fume ratio, or the initial oil fume ratio is used as the oil fume ratio.
[0028] Preferably, obtaining the corrected oil fume ratio according to the illumination change information and the oil fume ratio includes:
[0029] When the illumination change information indicates that there is no illumination disturbance, the corrected oil fume ratio is the current oil fume ratio;
[0030] When the illumination change information indicates the presence of a mild illumination disturbance, if the current oil fume ratio is greater than the gear adjustment ratio threshold, the corrected oil fume ratio is the gear adjustment ratio threshold; if the current oil fume ratio is not greater than the gear adjustment ratio threshold, the corrected oil fume ratio is the current oil fume ratio;
[0031] When the illumination change information indicates that there is a severe illumination disturbance, the corrected oil fume ratio adopts the value of the corrected oil fume ratio at the previous moment.
[0032] Preferably, the control method further includes:
[0033] determining a target wind speed level according to the corrected oil smoke ratio;
[0034] When the target wind speed level is higher than the current wind speed level, adjusting the current wind speed level to the target wind speed level;
[0035] When the target wind speed level is lower than the current wind speed level and the duration of being in the current wind speed level is longer than a preset locking duration, the current wind speed level is adjusted to the target wind speed level.
[0036] The present invention also provides a range hood control system, comprising: an image frame acquisition module, a timing frame difference calculation module, a frame difference ratio calculation module, and a light change information generation module;
[0037] The image frame acquisition module is used to acquire image frames including the cookware; wherein the time interval between two adjacent image frames is a preset time length;
[0038] The timing frame difference calculation module is used to calculate the timing frame difference between the grayscale images of every two adjacent image frames;
[0039] The frame difference ratio calculation module is used to calculate the frame difference ratio between the timing frame difference and the frame difference between the grayscale image of the latter frame in the two adjacent image frames;
[0040] The illumination change information generating module is configured to generate illumination change information based on the frame difference ratio within a preset time period.
[0041] Preferably, the illumination change information generating module is specifically configured to, within the preset time period, when at least one of the frame difference ratios is greater than a preset first ratio threshold, determine that the illumination change information indicates the presence of severe illumination disturbance.
[0042] Preferably, the illumination change information generating module is further configured to, within the preset time period, when all the frame difference ratios are not greater than the first ratio threshold, count the number of the frame difference ratios greater than a preset second ratio threshold;
[0043] The illumination change information generating module is further configured to: if the number is within a preset number threshold range, the illumination change information indicates that there is a mild illumination disturbance; otherwise, the illumination change information indicates that there is no illumination disturbance;
[0044] The second ratio threshold is smaller than the first ratio threshold.
[0045] Preferably, the control system further comprises: an extraction module, a fume ratio calculation module and a correction module;
[0046] The extraction module is used to remove object interference information from the timing frame difference and extract the oil smoke area image;
[0047] The oil smoke ratio calculation module is used to obtain the oil smoke ratio based on the oil smoke area image and the preset monitoring area;
[0048] The correction module is used to obtain a corrected oil fume ratio according to the illumination change information and the oil fume ratio.
[0049] Preferably, the extraction module includes: a first image calculation unit, a second image calculation unit and a fume area image calculation unit;
[0050] The first image calculation unit is configured to convert the timing frame difference into a YCrCb color space, and based on the range of Cr values and Cb values corresponding to a human hand, remove the human hand information from the converted image frame to obtain a first image;
[0051] The second image calculation unit is used to convert the first image into the HSV color space, and extract the second image from the converted first image based on the color characteristics of the oil smoke; wherein the second image includes a potential oil smoke area;
[0052] The oil fume area image calculation unit is configured to take an area in the grayscale image of the second image whose variance value is less than a preset variance threshold as a target oil fume area, and extract the oil fume area image from the grayscale image of the second image based on the target oil fume area.
[0053] Preferably, the oil fume ratio calculation module includes: an initial oil fume ratio calculation unit and an oil fume ratio calculation unit;
[0054] The initial oil fume ratio calculation unit is used to calculate the ratio of the area corresponding to the non-zero value in the oil fume area image to the area of the monitoring area to obtain the initial oil fume ratio;
[0055] The oil fume ratio calculation unit is configured to perform smoothing filtering on the initial oil fume ratio by using an exponential weighted average method to obtain the oil fume ratio, or to use the initial oil fume ratio as the oil fume ratio.
[0056] Preferably, the correction module includes: a no light disturbance correction unit, a mild light disturbance correction unit and a severe light disturbance correction unit;
[0057] The no-light-disturbance correction unit is configured to correct the oil fume ratio to the current oil fume ratio when the light change information indicates that no light disturbance exists;
[0058] The mild light disturbance correction unit is configured to, when the light change information indicates the presence of mild light disturbance, if the current oil fume ratio is greater than the gear adjustment ratio threshold, set the corrected oil fume ratio to the gear adjustment ratio threshold; if the current oil fume ratio is not greater than the gear adjustment ratio threshold, set the corrected oil fume ratio to the current oil fume ratio;
[0059] The severe light disturbance correction unit is configured to, when the light change information indicates the presence of severe light disturbance, use the value of the corrected oil fume ratio at a previous moment as the corrected oil fume ratio.
[0060] Preferably, the control system further comprises: a target wind speed gear determination module and a gear adjustment module;
[0061] The target wind speed level determination module is used to determine the target wind speed level according to the corrected oil smoke ratio;
[0062] The gear adjustment module is used to adjust the current wind gear to the target wind gear when the target wind gear is higher than the current wind gear;
[0063] The gear adjustment module is further configured to adjust the current wind gear to the target wind gear when the target wind gear is lower than the current wind gear and the duration of the current wind gear is greater than a preset locking duration.
[0064] The present invention also provides a range hood comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned range hood control method when executing the computer program.
[0065] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the aforementioned range hood control method when executed by a processor.
[0066] The positive progress effect of the present invention is that: the lighting change information is generated by the frame difference ratio within a preset time period. The lighting change information reflects whether there is lighting disturbance and the degree of disturbance. The identified oil fume movement information can be reasonably corrected according to the lighting change information, and it has a good inhibitory effect on the sudden change of ambient light, making the oil fume movement information more accurate and more in line with the actual situation. Furthermore, the wind speed can be adjusted more accurately and reasonably according to the oil fume movement information to achieve a better oil fume exhaust effect and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a flow chart of a range hood control method according to embodiment 1 of the present invention.
[0068] Figure 2 This is a flowchart of a specific implementation of step S14 in the range hood control method of embodiment 1 of the present invention.
[0069] Figure 3 This is a flow chart of a specific implementation of the range hood control method according to embodiment 1 of the present invention.
[0070] Figure 4 This is a flowchart of a specific implementation of step S16 in the range hood control method of embodiment 1 of the present invention.
[0071] Figure 5 This is a flowchart of a specific implementation of step S17 in the range hood control method of embodiment 1 of the present invention.
[0072] Figure 6 This is a flowchart of another specific implementation of step S17 in the range hood control method of embodiment 1 of the present invention.
[0073] Figure 7 This is a flow chart of another specific implementation of the range hood control method of embodiment 1 of the present invention.
[0074] Figure 8 This is a module diagram of a range hood control system according to embodiment 2 of the present invention.
[0075] Figure 9 This is a schematic structural diagram of a range hood according to embodiment 3 of the present invention. DETAILED DESCRIPTION
[0076] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0077] Example 1
[0078] This embodiment provides a control method for a range hood, referring to Figure 1 , control methods include:
[0079] S11, acquiring an image frame including the cookware, wherein the time interval between two adjacent image frames is a preset time length.
[0080] S12. Calculate and obtain the timing frame difference between the grayscale images of every two adjacent image frames.
[0081] S13: Calculate the ratio of the timing frame difference to the frame difference of the grayscale image of the latter frame in the corresponding two adjacent image frames.
[0082] S14. Generate illumination change information based on the frame difference ratio within a preset time period.
[0083] The image frames can be original frames extracted from surveillance video or partial frames extracted from the original frames based on a preset monitoring area, which includes the cookware and a certain range outside the cookware. The monitoring area can be set based on actual needs, and the monitoring area is the area where the movement of oil smoke needs to be monitored. Generally, the impact of oil smoke outside the monitoring area on the identification of oil smoke movement information is negligible.
[0084] The difference between the previous and next frames of the video stream is calculated to obtain the timing frame difference. The grayscale image of the latter frame in two adjacent image frames is F i , the grayscale image of the previous frame is F i-1 , the timing frame difference is D i The timing frame difference is D i The calculation formula is as follows:
[0085] D i =|F i -F i-1 |.
[0086] The timing frame difference is D i This is the current motion region image, which contains the smoke movement information. The preset duration can be set according to actual needs to alleviate the situation where the motion region is too small due to continuous stable frame motion.
[0087] Because the camera module monitors an open area rather than an enclosed one, ambient light has a greater impact on smoke recognition. The ambient light of the range hood is affected by both natural and artificial light. When natural light is high, turning the range hood light or ambient light on and off has little effect on the camera's adaptive adjustment. However, when natural light is low, turning the range hood light or ambient light on and off causes significant brightness changes within the camera's field of view, increasing the degree of camera adaptive adjustment. This affects the calculation results of the timed frame difference and, in turn, the calculation of smoke motion information.
[0088] The illumination change information can be generated by the frame difference ratio within a preset time period. The preset time period includes several preset durations, and multiple frame difference ratios d can be calculated. i Light change information reflects the presence of light disturbances and the extent of the disturbances if present. Only by clarifying the light disturbances and their extent can we take appropriate actions or measures to eliminate the interference caused by the switching of ambient lights and range hood lights in dimly lit environments, which can affect the range hood's wind speed. This allows the range hood's fume concentration (fume ratio) calculation to effectively suppress sudden changes in ambient light.
[0089] Frame difference ratio d i It is expressed by the following formula:
[0090] d i =D i / F i .
[0091] This embodiment generates illumination change information through the frame difference ratio within a preset time period. The illumination change information reflects whether there is illumination disturbance and the degree of disturbance. The identified oil fume movement information can be reasonably corrected according to the illumination change information, and has a good inhibitory effect on sudden changes in ambient light, making the oil fume movement information more accurate and more in line with actual conditions. Furthermore, the wind speed can be adjusted more accurately and reasonably according to the oil fume movement information to achieve a better oil fume exhaust effect and improve the user experience.
[0092] When implementing it, refer to Figure 2 , step S14 includes:
[0093] S141. Within a preset time period, when at least one frame difference ratio is greater than a preset first ratio threshold, the illumination change information indicates that severe illumination disturbance exists.
[0094] The first ratio threshold may be set according to actual conditions.
[0095] For example, assuming the preset time period includes seven periods of preset duration, eight image frames (F0-F7) are obtained, and seven frame difference ratios (d1-d7, d1 = |F1-F0| / F1, ..., d7 = |F7-F6| / F7) are calculated. Assuming that at least one of the frame difference ratios d1-d7 is greater than the first ratio threshold, the illumination change information indicates the presence of a severe illumination disturbance, indicating a severe disturbance within the camera's field of view, and the disturbance may be caused by wiping the lens or turning on a light in a dim environment.
[0096] In this embodiment, whether there is severe light disturbance is determined by using the first ratio threshold.
[0097] When implementing it, refer to Figure 2 , step S14 further includes:
[0098] S142: Within a preset time period, when all frame difference ratios are not greater than a first ratio threshold, count the number of frame difference ratios greater than a preset second ratio threshold.
[0099] S143. If the number is within a preset number threshold range, the illumination change information indicates that there is a mild illumination disturbance; otherwise, the illumination change information indicates that there is no illumination disturbance.
[0100] The second ratio threshold is smaller than the first ratio threshold.
[0101] The first ratio threshold and the second ratio threshold can be set according to actual conditions.
[0102] For example, assuming the preset time period includes seven periods of preset duration, eight image frames (F0-F7) are obtained, and seven frame difference ratios (d1-d7, d1 = |F1-F0| / F1, ..., d7 = |F7-F6| / F7) are calculated. If none of d1-d7 is greater than the first ratio threshold, then there is no severe light disturbance. In this case, the number of frame difference ratios greater than the second ratio threshold is counted.
[0103] Assuming that the number of frame difference ratios greater than the second ratio threshold is 2, the number threshold range is 1-3, and the number is within the number threshold range, then the lighting change information indicates the presence of mild lighting disturbance, indicating that there is lighting disturbance in the camera's field of view but the degree of disturbance is not severe. There may be ambient light or range hood light interfering with the image in the camera's field of view.
[0104] Assuming that the number of frame difference ratios greater than the second ratio threshold is 0, the number threshold range is 1-3, and the number is not within the number threshold range, then the lighting change information indicates that there is no lighting disturbance, indicating that the image is in a stable state and there is no corresponding interference. At this time, the current natural light may be strong, and the switching lights of the ambient light tubes and range hood lights have little impact on the camera picture.
[0105] Assuming that the number of frame difference ratios greater than the second ratio threshold is 5, the number threshold range is 1-3, and the number is not within the number threshold range, then the lighting change information indicates that there is no lighting disturbance, indicating that the image is in a stable state and there is no corresponding interference. At this time, the current natural light may be strong, and the switching lights of the ambient light tubes and range hood lights have little impact on the camera picture.
[0106] In this embodiment, in addition to determining whether there is severe light disturbance by using the first ratio threshold, determining whether there is mild light disturbance or no light disturbance by using the second ratio threshold and the number threshold range.
[0107] When implementing it, refer to Figure 3 Before step S14, the control method further includes:
[0108] S16: Remove object interference information from the timing frame difference and extract the oil smoke area image.
[0109] S17. Obtaining the oil fume ratio based on the oil fume area image and the preset monitoring area.
[0110] After step S14, the control method further includes:
[0111] S18. Obtain a corrected oil fume ratio based on the illumination change information and the oil fume ratio.
[0112] Among them, the timing frame difference is D i The smoke not only contains information about the movement of the smoke, but also may contain interference from moving hands, pots, and other objects, which need to be removed. Image processing can be used to eliminate interference from objects such as hands in the moving area, and then the smoke area can be graded using a grayscale histogram.
[0113] The oil smoke ratio needs to be corrected according to the illumination change information to obtain the corrected oil smoke ratio PSM to eliminate the influence of illumination disturbance.
[0114] When implementing it, refer to Figure 4 , step S16 includes:
[0115] S161 , converting the timing frame difference into a YCrCb color space, and removing the human hand information from the converted image frame based on the range of Cr values and Cb values corresponding to the human hand to obtain a first image.
[0116] S162: Convert the first image into the HSV color space, and extract a second image from the converted first image based on the color characteristics of the oil smoke, wherein the second image includes a potential oil smoke area.
[0117] S163 , taking an area in the grayscale image of the second image whose variance value is less than a preset variance threshold as a target fume area, and extracting an fume area image from the grayscale image of the second image based on the target fume area.
[0118] Among them, the range of Cr value and Cb value corresponding to human hands is:
[0119] 133≤Cr≤173 and 77≤Cb≤127.
[0120] The timing frame difference D i Convert to YCrCb color space, set the value that meets the above formula to 0 to eliminate the interference of hand information, and obtain the first image D1 that eliminates the interference of hand information i .
[0121] For interference from pots and other objects, the first image D1 needs to be i Converted to HSV color space, based on the color characteristics of the smoke from the converted first image D1 i Extract the second image D2 that meets the color characteristics of the smoke i .
[0122] According to the characteristics of oil smoke itself, the area where oil smoke exists in the image will often reduce the contrast of the image in this area, which is specifically manifested as the variance of the image in this area becoming smaller. Based on this feature, the second image D2 i The variance threshold S is constrained to obtain the oil smoke area image D3 i .
[0123] The variance threshold S can be set according to actual needs.
[0124] When implementing it, refer to Figure 5 , step S17 includes:
[0125] S171. Calculate the ratio of the area corresponding to the non-zero value in the oil fume area image to the area of the monitoring area to obtain an initial oil fume ratio.
[0126] S172: Smoothing and filtering the initial oil smoke ratio by using an exponential weighted average method to obtain the oil smoke ratio.
[0127] Among them, the oil smoke area image D3 i The area corresponding to the non-zero value in is SD3 i , the area of the monitoring area R is SR, and the initial oil smoke ratio ps is expressed by the following formula:
[0128]
[0129] Since the changes in oil smoke during the cooking process may be very drastic, for example, the frame difference between the moment before and after stir-frying is extremely drastic, the calculated oil smoke ratio will change accordingly very drastically. At this time, in order to avoid the frequent switching of the range hood gear, the exponential weighted average method is used for smoothing filtering, thereby ensuring that the range hood gear will not switch frequently when the oil smoke changes drastically, and the filtered result is used as the oil smoke ratio.
[0130] In one embodiment, referring to Figure 6 , step S17 includes:
[0131] S171. Calculate the ratio of the area corresponding to the non-zero value in the oil fume area image to the area of the monitoring area to obtain an initial oil fume ratio.
[0132] S173. Use the initial oil fume ratio as the oil fume ratio.
[0133] Among them, using the initial oil smoke ratio as the oil smoke ratio can cope with most cooking scenarios. In these scenarios, the calculation steps can be reduced to quickly output the calculation results.
[0134] In specific implementation, step S18 includes:
[0135] When the illumination change information indicates that there is no illumination disturbance, the oil smoke ratio is corrected to the current oil smoke ratio.
[0136] When the illumination change information indicates the presence of mild illumination disturbance, if the current oil fume ratio is greater than the gear adjustment ratio threshold, the oil fume ratio is corrected to the gear adjustment ratio threshold; if the current oil fume ratio is not greater than the gear adjustment ratio threshold, the oil fume ratio is corrected to the current oil fume ratio.
[0137] When the illumination change information indicates that there is a severe illumination disturbance, the corrected oil fume ratio adopts the value of the corrected oil fume ratio at the previous moment.
[0138] Among them, the oil smoke ratio is corrected according to the illumination change information to obtain the corrected oil smoke ratio PSM. When the illumination change information indicates that there is a severe illumination disturbance, the corrected oil smoke ratio PSM adopts the corrected oil smoke ratio value of the previous moment and is locked for a period of time until the frame difference ratio d i In the normal range.
[0139] In this embodiment, situations such as intense frame difference disturbances caused by lights and sudden occlusion of the lens are shielded, thereby greatly increasing the stability of the entire oil fume recognition system and enabling the oil fume recognition algorithm to also have good recognition effects in open scenarios.
[0140] During specific implementation, referring to Figure 7 , the control method further includes:
[0141] S19. Determine the target wind force gear according to the corrected oil fume ratio.
[0142] S20. When the target wind force gear is higher than the current wind force gear, adjust the current wind force gear to the target wind force gear.
[0143] S21. When the target wind force gear is lower than the current wind force gear and the duration of staying at the current wind force gear is greater than the preset locking duration, adjust the current wind force gear to the target wind force gear.
[0144] Among them, the range hood adjusts the wind force gear following the principle of rapid increase and slow decrease. It can shift gears up continuously, but cannot shift gears down continuously. When shifting gears down, it must meet the condition that the duration of staying at the current wind force gear is greater than the preset locking duration, that is, the current wind force gear must be locked for a certain time before shifting gears down.
[0145] Taking the adjustment of the low, medium, and high three - gear wind force gears as an example, it is as follows:
[0146] The oil fume ratio thresholds for the adjustment of the three - gear wind force gears are t1 and t2. That is, when psm < t1, after the wind force gear is unlocked, the current wind force gear is switched to the low gear; when t1 ≤ psm < t2, after the wind force gear is unlocked, the current wind force gear is switched to the medium gear; when psm > t2, after the wind force gear is unlocked, the current wind force gear is switched to the high gear. The locking and unlocking determination conditions for the wind force gear are that when the wind force gear is switched, the current wind force gear becomes the locked state, and when the locking duration reaches the specified duration, the wind force gear is unlocked.
[0147] Adjusting the wind force gear follows the principle that the locked wind force gear can shift gears up but not down. That is, when the corrected oil fume ratio psm is greater than the current wind force gear, even if the wind force gear is in the locked state at this time, the wind force gear can still be shifted up. When the corrected oil fume ratio psm is less than the current wind force gear, the wind force gear can only be shifted down when the current wind force gear is in the unlocked state. Therefore, the wind force gear can shift gears up continuously, but cannot shift gears down continuously.
[0148] When the target wind force gear to be switched is greater than the current wind force gear, the gear locking time is T1, and when the target wind force gear to be switched is less than the current wind force gear, the gear locking time is T2. Assume T1 < T2.
[0149] When the proportion of oil smoke becomes larger, the wind speed gear can be upgraded in time. When the proportion of oil smoke becomes smaller, in order to ensure that the oil smoke can be fully absorbed, it is necessary to wait until the wind speed gear lock period is over before performing the corresponding downshift operation.
[0150] Example 2
[0151] This embodiment provides a range hood control system, referring to Figure 8 The control system includes: an image frame acquisition module 1, a timing frame difference calculation module 2, a frame difference ratio calculation module 3 and an illumination change information generation module 4.
[0152] The image frame acquisition module 1 is used to acquire image frames including the cookware, wherein the time interval between two adjacent image frames is a preset time length.
[0153] The timing frame difference calculation module 2 is used to calculate the timing frame difference between the grayscale images of every two adjacent image frames.
[0154] The frame difference ratio calculation module 3 is used to calculate the frame difference ratio between the timing frame difference and the frame difference between the grayscale image of the latter frame in the corresponding two adjacent image frames.
[0155] The illumination change information generating module 4 is configured to generate illumination change information based on the frame difference ratio within a preset time period.
[0156] The image frames can be original frames extracted from surveillance video or partial frames extracted from the original frames based on a preset monitoring area, which includes the cookware and a certain range outside the cookware. The monitoring area can be set based on actual needs, and the monitoring area is the area where the movement of oil smoke needs to be monitored. Generally, the impact of oil smoke outside the monitoring area on the identification of oil smoke movement information is negligible.
[0157] The difference between the previous and next frames of the video stream is calculated to obtain the timing frame difference. The grayscale image of the latter frame in two adjacent image frames is F i , the grayscale image of the previous frame is F i-1 , the timing frame difference is D i The timing frame difference is D i The calculation formula is as follows:
[0158] D i =|F i -F i-1 |.
[0159] The timing frame difference is D i This is the current motion region image, which contains the smoke movement information. The preset duration can be set according to actual needs to alleviate the situation where the motion region is too small due to continuous stable frame motion.
[0160] Because the camera module monitors an open area rather than an enclosed one, ambient light has a greater impact on smoke recognition. The ambient light of the range hood is affected by both natural and artificial light. When natural light is high, turning the range hood light or ambient light on and off has little effect on the camera's adaptive adjustment. However, when natural light is low, turning the range hood light or ambient light on and off causes significant brightness changes within the camera's field of view, increasing the degree of camera adaptive adjustment. This affects the calculation results of the timed frame difference and, in turn, the calculation of smoke motion information.
[0161] The illumination change information can be generated by the frame difference ratio within a preset time period. The preset time period includes several preset durations, and multiple frame difference ratios d can be calculated. i Light change information reflects the presence of light disturbances and the extent of the disturbances if present. Only by clarifying the light disturbances and their extent can we take appropriate actions or measures to eliminate the interference caused by the switching of ambient lights and range hood lights in dimly lit environments, which can affect the range hood's wind speed. This allows the range hood's fume concentration (fume ratio) calculation to effectively suppress sudden changes in ambient light.
[0162] Frame difference ratio d i It is expressed by the following formula:
[0163] d i =D i / F i .
[0164] This embodiment generates illumination change information through the frame difference ratio within a preset time period. The illumination change information reflects whether there is illumination disturbance and the degree of disturbance. The identified oil fume movement information can be reasonably corrected according to the illumination change information, and has a good inhibitory effect on sudden changes in ambient light, making the oil fume movement information more accurate and more in line with actual conditions. Furthermore, the wind speed can be adjusted more accurately and reasonably according to the oil fume movement information to achieve a better oil fume exhaust effect and improve the user experience.
[0165] In a specific implementation, the illumination change information generating module 4 is specifically configured to generate illumination change information indicating the presence of severe illumination disturbance when at least one frame difference ratio is greater than a preset first ratio threshold within a preset time period.
[0166] The first ratio threshold may be set according to actual conditions.
[0167] For example, assuming the preset time period includes seven periods of preset duration, eight image frames (F0-F7) are obtained, and seven frame difference ratios (d1-d7, d1 = |F1-F0| / F1, ..., d7 = |F7-F6| / F7) are calculated. Assuming that at least one of the frame difference ratios d1-d7 is greater than the first ratio threshold, the illumination change information indicates the presence of a severe illumination disturbance, indicating a severe disturbance within the camera's field of view, and the disturbance may be caused by wiping the lens or turning on a light in a dim environment.
[0168] In this embodiment, whether there is severe light disturbance is determined by using the first ratio threshold.
[0169] In specific implementation, the illumination change information generating module 4 is further configured to count the number of frame difference ratios greater than a preset second ratio threshold when all frame difference ratios are not greater than the first ratio threshold within a preset time period.
[0170] The illumination change information generating module 4 is further configured to: if the number is within a preset number threshold range, the illumination change information indicates that there is a mild illumination disturbance; otherwise, the illumination change information indicates that there is no illumination disturbance.
[0171] The second ratio threshold is smaller than the first ratio threshold.
[0172] The first ratio threshold and the second ratio threshold can be set according to actual conditions.
[0173] For example, assuming the preset time period includes seven periods of preset duration, eight image frames (F0-F7) are obtained, and seven frame difference ratios (d1-d7, d1 = |F1-F0| / F1, ..., d7 = |F7-F6| / F7) are calculated. If none of d1-d7 is greater than the first ratio threshold, then there is no severe light disturbance. In this case, the number of frame difference ratios greater than the second ratio threshold is counted.
[0174] Assuming that the number of frame difference ratios greater than the second ratio threshold is 2, the number threshold range is 1-3, and the number is within the number threshold range, then the lighting change information indicates the presence of mild lighting disturbance, indicating that there is lighting disturbance in the camera's field of view but the degree of disturbance is not severe. There may be ambient light or range hood light interfering with the image in the camera's field of view.
[0175] Assuming that the number of frame difference ratios greater than the second ratio threshold is 0, the number threshold range is 1-3, and the number is not within the number threshold range, then the lighting change information indicates that there is no lighting disturbance, indicating that the image is in a stable state and there is no corresponding interference. At this time, the current natural light may be strong, and the switching lights of the ambient light tubes and range hood lights have little impact on the camera picture.
[0176] Assuming that the number of frame difference ratios greater than the second ratio threshold is 5, the number threshold range is 1-3, and the number is not within the number threshold range, then the lighting change information indicates that there is no lighting disturbance, indicating that the image is in a stable state and there is no corresponding interference. At this time, the current natural light may be strong, and the switching lights of the ambient light tubes and range hood lights have little impact on the camera picture.
[0177] In this embodiment, in addition to determining whether there is severe light disturbance by using the first ratio threshold, determining whether there is mild light disturbance or no light disturbance by using the second ratio threshold and the number threshold range.
[0178] During specific implementation, the control system further includes: an extraction module 5 , an oil smoke ratio calculation module 6 and a correction module 7 .
[0179] The extraction module 5 is used to remove object interference information from the timing frame difference and extract the oil smoke area image.
[0180] The oil fume ratio calculation module 6 is used to obtain the oil fume ratio based on the oil fume area image and the preset monitoring area.
[0181] The correction module 7 is used to obtain a corrected oil fume ratio according to the illumination change information and the oil fume ratio.
[0182] Among them, the timing frame difference is D i The smoke not only contains information about the movement of the smoke, but also may contain interference from moving hands, pots, and other objects, which need to be removed. Image processing can be used to eliminate interference from objects such as hands in the moving area, and then the smoke area can be graded using a grayscale histogram.
[0183] The oil smoke ratio needs to be corrected according to the illumination change information to obtain the corrected oil smoke ratio PSM to eliminate the influence of illumination disturbance.
[0184] In specific implementation, the extraction module 5 includes: a first image calculation unit 51 , a second image calculation unit 52 and a fume area image calculation unit 53 .
[0185] The first image calculation unit 51 is used to convert the timing frame difference into the YCrCb color space, and remove the human hand information from the converted image frame based on the range of Cr value and Cb value corresponding to the human hand to obtain the first image.
[0186] The second image calculation unit 52 is used to convert the first image into the HSV color space and extract the second image from the converted first image based on the color characteristics of the oil smoke, wherein the second image includes the potential oil smoke area.
[0187] The fume region image calculation unit 53 is configured to take a region in the grayscale image of the second image whose variance value is less than a preset variance threshold as a target fume region, and extract a fume region image from the grayscale image of the second image based on the target fume region.
[0188] Among them, the range of Cr value and Cb value corresponding to human hands is:
[0189] 133≤Cr≤173 and 77≤Cb≤127.
[0190] The timing frame difference D i Convert to YCrCb color space, set the value that meets the above formula to 0 to eliminate the interference of hand information, and obtain the first image D1 that eliminates the interference of hand information i .
[0191] For interference from pots and other objects, the first image D1 needs to be i Converted to HSV color space, based on the color characteristics of the smoke from the converted first image D1 i Extract the second image D2 that meets the color characteristics of the smoke i .
[0192] According to the characteristics of oil smoke itself, the area where oil smoke exists in the image will often reduce the contrast of the image in this area, which is specifically manifested as the variance of the image in this area becoming smaller. Based on this feature, the second image D2 i The variance threshold S is constrained to obtain the oil smoke area image D3 i .
[0193] The variance threshold S can be set according to actual needs.
[0194] In specific implementation, the oil fume ratio calculation module 6 includes: an initial oil fume ratio calculation unit 61 and an oil fume ratio calculation unit 62 .
[0195] The initial oil fume ratio calculation unit 61 is used to calculate the ratio of the area corresponding to the non-zero value in the oil fume area image to the area of the monitoring area to obtain the initial oil fume ratio.
[0196] The oil fume ratio calculation unit 62 is used to perform smoothing filtering on the initial oil fume ratio by using an exponential weighted average method to obtain the oil fume ratio.
[0197] Among them, the oil smoke area image D3 i The area corresponding to the non-zero value in is SD3 i , the area of the monitoring area R is SR, and the initial oil smoke ratio ps is expressed by the following formula:
[0198]
[0199] Since the changes in oil smoke during the cooking process may be very drastic, for example, the frame difference between the moment before and after stir-frying is extremely drastic, the calculated oil smoke ratio will change accordingly very drastically. At this time, in order to avoid the frequent switching of the range hood gear, the exponential weighted average method is used for smoothing filtering, thereby ensuring that the range hood gear will not switch frequently when the oil smoke changes drastically, and the filtered result is used as the oil smoke ratio.
[0200] In one embodiment, the initial oil fume ratio calculation unit 61 is configured to calculate the ratio of the area corresponding to the non-zero value in the oil fume region image to the area of the monitoring region to obtain the initial oil fume ratio.
[0201] The oil fume ratio calculation unit 62 is configured to use the initial oil fume ratio as the oil fume ratio.
[0202] Among them, using the initial oil smoke ratio as the oil smoke ratio can cope with most cooking scenarios. In these scenarios, the calculation steps can be reduced to quickly output the calculation results.
[0203] In specific implementation, the correction module 7 includes: a no-light-disturbance correction unit 71 , a mild-light-disturbance correction unit 72 and a severe-light-disturbance correction unit 73 .
[0204] The no-light-disturbance correction unit 71 is configured to correct the oil fume ratio to the current oil fume ratio when the light change information indicates that there is no light disturbance.
[0205] The mild light disturbance correction unit 72 is used to correct the oil fume ratio to the gear adjustment ratio threshold if the current oil fume ratio is greater than the gear adjustment ratio threshold when the light change information indicates the presence of mild light disturbance; if the current oil fume ratio is not greater than the gear adjustment ratio threshold, then the oil fume ratio is corrected to the current oil fume ratio.
[0206] The severe light disturbance correction unit 73 is configured to correct the oil fume ratio by using the value of the corrected oil fume ratio at the previous moment when the light change information indicates the presence of severe light disturbance.
[0207] Among them, the oil smoke ratio is corrected according to the illumination change information to obtain the corrected oil smoke ratio PSM. When the illumination change information indicates that there is a severe illumination disturbance, the corrected oil smoke ratio PSM adopts the corrected oil smoke ratio value of the previous moment and is locked for a period of time until the frame difference ratio d i In the normal range.
[0208] In this embodiment, severe disturbances in frame differences caused by lighting and sudden lens occlusion are shielded, thereby greatly increasing the stability of the entire oil fume recognition system and enabling the oil fume recognition algorithm to achieve good recognition results even in open scenes.
[0209] In specific implementation, the control system further includes: a target wind speed gear determination module 8 and a gear adjustment module 9.
[0210] The target wind speed gear determination module 8 is used to determine the target wind speed gear according to the corrected oil fume ratio.
[0211] The gear adjustment module 9 is used to adjust the current wind speed gear to the target wind speed gear when the target wind speed gear is higher than the current wind speed gear.
[0212] The gear adjustment module 9 is further used to adjust the current wind speed gear to the target wind speed gear when the target wind speed gear is lower than the current wind speed gear and the duration of staying at the current wind speed gear is greater than a preset locking duration.
[0213] Among them, the oil fume machine adjusts the wind speed gear following the principle of rapid increase and slow decrease. It can shift up gears continuously, but cannot shift down gears continuously. When shifting down gears, it must meet the condition that the duration of staying at the current wind speed gear is greater than the preset locking duration, that is, the current wind speed gear must be locked for a certain time before shifting down gears.
[0214] Taking the adjustment of the wind speed gear in low, medium, and high gears as an example, it is as follows:
[0215] The oil fume ratio thresholds for the adjustment of the three - gear wind speed gear are t1 and t2. That is, when psm < t1, after the wind speed gear is unlocked, the current wind speed gear is switched to the low gear; when t1 ≤ psm < t2, after the wind speed gear is unlocked, the current wind speed gear is switched to the medium gear; when psm > t2, after the wind speed gear is unlocked, the current wind speed gear is switched to the high gear. The determination condition for locking and unlocking the wind speed gear is that when the wind speed gear is switched, the current wind speed gear becomes the locked state, and when the locking duration reaches the specified duration, the wind speed gear is unlocked.
[0216] Adjusting the wind speed gear follows the principle that the locked wind speed gear can be shifted up but not down. That is, when the corrected oil fume ratio psm is greater than the current wind speed gear, even if the wind speed gear is in the locked state at this time, the up - shifting operation of the wind speed gear can still be performed. When the corrected oil fume ratio psm is less than the current wind speed gear, the wind speed gear can only be shifted down when the current wind speed gear is in the unlocked state. Therefore, the wind speed gear can be shifted up continuously, but cannot be shifted down continuously.
[0217] When the target wind speed gear to be switched is greater than the current wind speed gear, the gear locking time is T1, and when the target wind speed gear to be switched is less than the current wind speed gear, the gear locking time is T2. Assume T1 < T2.
[0218] When the oil fume ratio increases, the up - shifting operation of the wind speed gear can be carried out in a timely manner. When the oil fume ratio decreases, to ensure that the oil fume can be fully absorbed, the corresponding down - shifting operation can only be carried out after the wind speed gear lock - up period has passed.
[0219] Example 3
[0220] Figure 9 This is a schematic diagram of the structure of a range hood provided in Example 3 of the present invention. The range hood 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 range hood control method in Example 1 is implemented. Figure 9 The range hood 30 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0221] The range hood 30 may be implemented as a general-purpose computing device, such as a server. Components of the range hood 30 may include, but are not limited to, the at least one processor 31, the at least one memory 32, and a bus 33 connecting various system components (including the memory 32 and the processor 31).
[0222] The bus 33 includes a data bus, an address bus, and a control bus.
[0223] 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 .
[0224] 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.
[0225] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32 , such as the range hood control method in Embodiment 1 of the present invention.
[0226] The range hood 30 can also communicate with one or more external devices 34 (e.g., buttons, pointing devices, etc.). Such communication can be performed through an input / output (I / O) interface 35. In addition, the model-generated range hood 30 can 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) through a network adapter 36. As shown, the network adapter 36 communicates with other modules of the model-generated range hood 30 via a 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 range hood 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0227] It should be noted that although the above detailed description mentions several modules / modules or submodules / modules of the range hood, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules / modules described above may be embodied in a single module / module; conversely, the features and functions of a single module / module described above may be further divided and embodied by multiple modules / modules.
[0228] Example 4
[0229] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the range hood control method of embodiment 1 is implemented.
[0230] Specifically, 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 thereof.
[0231] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes 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 range hood control method in Example 1.
[0232] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely 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 entirely on the remote device.
[0233] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the 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, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A range hood control method, characterized in that: include: Acquire an image frame including the cookware; wherein the time interval between two adjacent image frames is a preset time length; Calculating the timing frame difference between the grayscale images of every two adjacent image frames; Calculating a frame difference ratio between the timing frame difference and a frame difference of a grayscale image of a latter frame in the corresponding two adjacent image frames; generating illumination change information based on the frame difference ratio within a preset time period; Before the step of generating illumination change information based on the frame difference ratio within a preset time period, the control method further includes: removing object interference information from the timing frame difference and extracting an oil smoke area image; Obtaining a fume ratio based on the fume area image and a preset monitoring area; After the step of generating illumination change information based on the frame difference ratio within a preset time period, the control method further includes: Obtaining a corrected oil smoke ratio according to the illumination change information and the oil smoke ratio; The target wind speed level of the range hood is determined according to the corrected oil smoke ratio.
2. The range hood control method according to claim 1, wherein: Generating illumination change information based on the frame difference ratio within a preset time period includes: In the preset time period, when at least one of the frame difference ratios is greater than a preset first ratio threshold, the illumination change information indicates that severe illumination disturbance exists.
3. The range hood control method according to claim 2, wherein: The generating of illumination change information based on the frame difference ratio within a preset time period further includes: Within the preset time period, when all the frame difference ratios are not greater than the first ratio threshold, counting the number of the frame difference ratios greater than a preset second ratio threshold; If the number is within a preset number threshold range, the illumination change information indicates that there is a mild illumination disturbance; otherwise, the illumination change information indicates that there is no illumination disturbance; The second ratio threshold is smaller than the first ratio threshold.
4. The range hood control method according to claim 1, wherein: The removing of object interference information from the timing frame difference and extracting the oil smoke area image includes: Converting the timing frame difference into a YCrCb color space, and removing the human hand information from the converted image frame based on the range of Cr and Cb values corresponding to the human hand to obtain a first image; Converting the first image into an HSV color space, and extracting a second image from the converted first image based on the color characteristics of the oil smoke; wherein the second image includes a potential oil smoke area; An area in the grayscale image of the second image whose variance value is less than a preset variance threshold is taken as a target fume area, and the fume area image is extracted from the grayscale image of the second image based on the target fume area.
5. The range hood control method according to claim 1, wherein: The obtaining of the oil smoke ratio based on the oil smoke area image and the preset monitoring area includes: Calculating the ratio of the area corresponding to the non-zero value in the oil smoke area image to the area of the monitoring area to obtain an initial oil smoke ratio; The initial oil fume ratio is smoothed and filtered by using an exponential weighted average method to obtain the oil fume ratio, or the initial oil fume ratio is used as the oil fume ratio.
6. The range hood control method according to claim 1, wherein: The step of obtaining a corrected oil fume ratio according to the illumination change information and the oil fume ratio includes: When the illumination change information indicates that there is no illumination disturbance, the corrected oil fume ratio is the current oil fume ratio; When the illumination change information indicates the presence of a mild illumination disturbance, if the current oil fume ratio is greater than the gear adjustment ratio threshold, the corrected oil fume ratio is the gear adjustment ratio threshold; if the current oil fume ratio is not greater than the gear adjustment ratio threshold, the corrected oil fume ratio is the current oil fume ratio; When the illumination change information indicates that there is a severe illumination disturbance, the corrected oil fume ratio adopts the value of the corrected oil fume ratio at the previous moment.
7. The range hood control method according to claim 1, wherein: The control method further includes: When the target wind speed level is higher than the current wind speed level, adjusting the current wind speed level to the target wind speed level; When the target wind speed level is lower than the current wind speed level and the duration of being in the current wind speed level is longer than a preset locking duration, the current wind speed level is adjusted to the target wind speed level.
8. A range hood control system, characterized in that: include: Image frame acquisition module, timing frame difference calculation module, frame difference ratio calculation module, illumination change information generation module, extraction module, oil smoke ratio calculation module and correction module; The image frame acquisition module is used to acquire image frames including the cookware; wherein the time interval between two adjacent image frames is a preset time length; The timing frame difference calculation module is used to calculate the timing frame difference between the grayscale images of every two adjacent image frames; The frame difference ratio calculation module is used to calculate the frame difference ratio between the timing frame difference and the frame difference between the grayscale image of the latter frame in the two adjacent image frames; The illumination change information generating module is configured to generate illumination change information based on the frame difference ratio within a preset time period; The extraction module is used to remove object interference information from the timing frame difference and extract the oil smoke area image; The oil smoke ratio calculation module is used to obtain the oil smoke ratio based on the oil smoke area image and the preset monitoring area; The correction module is used to obtain a corrected oil smoke ratio according to the illumination change information and the oil smoke ratio; The control system further includes: a target wind speed gear determination module; The target wind speed level determination module is used to determine the target wind speed level according to the corrected oil smoke ratio.
9. A range hood comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the range hood control method according to any one of claims 1 to 7 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 range hood control method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and system for detecting indoor smog
CN101738394A
Kitchen ventilator with light self-adaption visual function and lampblack concentration detection method
CN109028224A