A control method, device and medium applied to a mirror cabinet
Patent Information
- Application Number
- CN202310709804.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2043-06-15
AI Technical Summary
[0003]而现有常用的是基于红外的智能家居,一方面,红外检测区域窄,只能检测较小角度范围,无法实现宽角度范围内的检测、人员的精准定位以及微动检测;另一方面,只能检测手势的有无,一般在识别出有人体手势后,再从手势变化的逻辑上进行判断人体做出的具体手势,需要大量的算力,甚至需要通过AI等运算才能得到人体做出的手势
[0052]1、高精度的测距:本发明采用的是毫米波雷达,毫米波雷达可以实现大角度范围的人员精准定位,具有厘米级的距离分辨率,动目标在距离上的变化实时响应,将距离与灯光档位相结合,不同的距离会自动控制相应的档位,提高了智能家居的用户体验;
Smart Images

Figure CN116997054B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mirror cabinet technology, and in particular to a control method, device and medium for mirror cabinets. Background Technology
[0002] Millimeter-wave radar is a type of radar that operates in the millimeter-wave band. Millimeter waves typically refer to the 30–300 GHz frequency range (wavelength 1–10 mm). Since the wavelength of millimeter waves falls between microwaves and centimeter waves, millimeter-wave radar combines some advantages of both microwave and photoelectric radar. With the widespread application of millimeter-wave radar in smart homes, the demand for it is increasing.
[0003] Currently, the commonly used smart home technology is based on infrared. On the one hand, infrared detection has a narrow detection range and can only detect a small angle range, making it impossible to achieve wide-angle detection, precise positioning of people, and micro-motion detection. On the other hand, it can only detect the presence or absence of gestures. Generally, after recognizing a human gesture, the specific gesture made by the human body is judged from the logic of the gesture change, which requires a lot of computing power and may even require AI and other calculations to obtain the human body's gesture.
[0004] The purpose of this invention is to design a control method, device, and medium for mirror cabinets that addresses the problems existing in the prior art. Summary of the Invention
[0005] In view of this, the purpose of this invention is to propose a control method for mirror cabinets.
[0006] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows:
[0007] This invention provides a control method for a mirror cabinet, comprising the following steps:
[0008] Step 1: The radar transmits a detection signal and receives multiple frames of ADC data reflected from the target, and obtains the 2DFFT spectrum of the multiple frames of ADC data;
[0009] Step 2: Perform gesture detection and human presence detection simultaneously. The gesture detection is performed in steps 3-5; the human presence detection is performed in step 6.
[0010] Step 3: Determine if the target is in a hovering state; if yes, the gesture is activated and proceed to Step 4; if no, proceed to Step 6.
[0011] Step 4: Determine whether the target makes a gesture. If yes, enter gesture mode to lock it and control the brightness and color temperature of the light according to the gesture. If no, return to step 3.
[0012] Step 5: If no hand gesture is detected from the target within the first set time, exit the gesture mode. When it is necessary to judge the gesture again, re-enter step 3 to perform the next gesture detection.
[0013] Step 6: Determine whether there is a moving target within a second set time period based on the 2DFFT spectrum of the current frame ADC data, or determine whether there is a micro-moving target within a third set time period based on the sampled 2DFFT spectrum obtained by sampling the 2DFFT spectrum of multiple frames ADC data. If yes, output the distance of the target closest to the radar and control the brightness and color temperature level of the light according to the target distance; otherwise, turn off the light.
[0014] Furthermore, step 1 specifically includes:
[0015] Step 11: Sample the intermediate frequency signal reflected from the target by the radar's transmitted detection signal to obtain ADC data;
[0016] Step 12: Perform an M-point FFT operation on the ADC data to obtain the distance spectrum of M / 2 targets as a 1DFFT; where M represents the number of samples.
[0017] Step 13: Perform an N-point FFT operation on each distance dimension to obtain a 2DFFT, thereby obtaining the velocity spectrum and velocity index range [-N / 2, N / 2] of N targets, and obtain the 2DFFT spectrum of one frame of ADC data; where N represents the number of chirps;
[0018] Step 14: Repeat steps 11-13 several times to obtain the 2DFFT spectrum of multiple frames of ADC data.
[0019] Furthermore, step 3, determining whether the target is in a hovering state, specifically includes:
[0020] Step 31: Calculate the polar coordinates of the target using the phase difference of the radar antenna;
[0021] Step 32: Project the polar coordinates into a rectangular coordinate system;
[0022] Step 33: Perform weighted processing on all values of each frame of ADC data in the Cartesian coordinate system to obtain the distance values of each frame of ADC data in the x-axis, y-axis and z-axis directions;
[0023] Step 34: Determine whether the following conditions are met simultaneously: the distance value in the x-axis direction of each frame of ADC data is within the x-axis detection range, the distance value in the z-axis direction is within the z-axis detection range, and the pose holding time is greater than the time threshold. If yes, the target is determined to be in a hovering state; otherwise, the target is determined not to be in a hovering state.
[0024] Furthermore, step 4, determining whether the target makes a gesture, specifically includes:
[0025] Step 41: Select sliding window regions on the x-axis and z-axis respectively:
[0026] In the x-axis direction, starting from the detection of the target, all point cloud data is retained until the target disappears; the region from the start of the target's detection to its disappearance is used as the x-axis sliding window region.
[0027] In the z-axis direction, starting from the detection of the target, retain all point cloud data until the target disappears; use the area from the start of the target's detection to its disappearance as the z-axis sliding window area.
[0028] Step 42: Within the x-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the x-axis calculation area based on the interval between the maximum and minimum values; at the same time, within the z-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the z-axis calculation area based on the interval between the maximum and minimum values.
[0029] Step 43: Perform weighted processing on all point cloud data in the x-axis calculation area and z-axis calculation area, and calculate the difference between the previous and next frames on the processed point cloud data to obtain the calculation result of the next frame minus the previous frame in each adjacent pair of frames.
[0030] Step 44: If all calculation results in the x-axis calculation area and all calculation results in the z-axis calculation area are 0, it is determined that the target has not made a gesture; if all calculation results in the x-axis calculation area are not 0 and / or all calculation results in the z-axis calculation area are not 0, it is determined that the target has made a gesture.
[0031] Furthermore, after step 44, the following steps are also included:
[0032] Step 45: After determining that the target has made a gesture, a voting judgment is made based on all the calculation results in the x-axis calculation area and / or all the calculation results in the z-axis calculation area;
[0033] Step 46: If the number of results greater than 0 in all calculation results within the z-axis calculation area is greater than the number of results less than 0, then it is determined as an upward wave; if the number of results less than 0 in all calculation results within the z-axis calculation area is greater than the number of results greater than 0, then it is determined as a downward wave; if the number of results less than 0 in all calculation results within the x-axis calculation area is greater than the number of results greater than 0, then it is determined as a leftward wave; if the number of results greater than 0 in all calculation results within the x-axis calculation area is greater than the number of results less than 0, then it is determined as a rightward wave.
[0034] Furthermore, in step 6, it is determined whether there is a moving target within a second set time period based on the 2DFFT spectrum of the current frame ADC data; if so, the distance to the target closest to the radar is output; specifically including:
[0035] The target distance index is obtained by selecting the maximum value from each velocity spectrum in the 2DFFT spectrum of the current frame ADC data;
[0036] If the target distance index in the current frame contains a distance index greater than the first threshold, then it is determined that a moving target exists;
[0037] Save the distance indices of the target distance in the current frame that are greater than the first threshold;
[0038] The saved distance indices are sorted in ascending order of distance, and then output after mean filtering.
[0039] Furthermore, in step 6, the sampled 2DFFT spectrum obtained by sampling the 2DFFT spectrum of multiple frames of ADC data is used to determine whether there is a micro-moving target within a third set time period. If so, the distance to the target closest to the radar is output. Specifically, this includes:
[0040] Extract the nth chirp spectrum of the same row from the 2DFFT spectrum of each frame of ADC data to obtain the sampled 2DFFT spectrum, where n is an integer and the value of n is 0≤n≤N-1;
[0041] The low-speed sampled spectrum is obtained by performing an N-point FFT operation on multiple sampled 2DFFT spectra.
[0042] If the low-speed sampling spectrum contains spectral lines greater than the second threshold, it is determined that a micro-moving target exists;
[0043] Record the distance of the target closest to the radar in each frame, filter it, and then output the result.
[0044] Furthermore, step 6, which involves controlling the brightness and color temperature of the light based on the target distance, specifically includes:
[0045] The color temperature and brightness level of the light are determined based on the radar's maximum detection distance;
[0046] The adjustable levels per unit distance are calculated based on the maximum detection distance and the color temperature and brightness levels of the light.
[0047] Find the corresponding color temperature and brightness values for the appropriate setting based on the target distance;
[0048] The color temperature and brightness values are converted into PWM waves and input into the H-bridge circuit for light output.
[0049] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a control method for a mirror cabinet as described above.
[0050] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a control method for a mirror cabinet as described above.
[0051] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0052] 1. High-precision ranging: This invention uses millimeter-wave radar, which can achieve accurate positioning of people over a wide angle range and has centimeter-level distance resolution. It responds in real time to changes in distance of moving targets and combines distance with light level. Different distances will automatically control the corresponding level, improving the user experience of smart homes.
[0053] 2. High stability of micro-motion target (standing person) detection: It obtains real-time human sensing information, which includes two states: movement and micro-motion. High-precision positioning outputs corresponding brightness and color temperature of the light, so that the light becomes brighter when people approach and dimmer when they leave, and the light remains unchanged when there is micro-motion. High-precision and stable positioning combines distance with light level. Different distances will automatically control the corresponding level, which improves the user experience of smart homes. For example, in the bathroom mirror, if someone is putting on makeup in front of you, it is a micro-motion. If someone comes from behind and then leaves, the distance will not exceed the first person (crossing). At this time, the target in front will not be lost. The target is locked on the first person, and the light will not jump to the second person.
[0054] 3. Multi-gesture recognition: Up, down, left, right, and hover. Utilizing the characteristics of millimeter waves, multi-gesture functions are realized to enhance the user experience of home products. To ensure accurate gesture recognition, a hover gesture is added to activate the radar's gesture function, thus avoiding false alarms when people are at close range. The number of gestures is combined with the light level, automatically adjusting the light level based on the number of gestures, improving the user experience of smart homes.
[0055] 4. Suitable for scenarios with multiple users;
[0056] 5. No environmental adaptation is required; it is applicable in any environment.
[0057] 6. It does not require excessive computing power, saving memory. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart of a control method for a mirror cabinet provided in an embodiment of the present invention.
[0060] Figure 2 This is a diagram showing the change of the z-axis during the upward waving process provided in an embodiment of the present invention.
[0061] Figure 3 This is a diagram showing the change of the z-axis during the downward waving process provided in an embodiment of the present invention.
[0062] Figure 4 This is a diagram showing the change of the x-axis during the leftward waving process provided in an embodiment of the present invention.
[0063] Figure 5 This is a diagram showing the change of the x-axis during the rightward waving process provided in an embodiment of the present invention.
[0064] Figure 6 This is a diagram illustrating the changes in distance and color temperature provided in an embodiment of the present invention.
[0065] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention.
[0066] Figure 8 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation
[0067] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0068] This invention provides a control method for mirror cabinets that can achieve high-precision distance measurement. It combines distance and the number of hand gestures with the light level, and automatically controls the corresponding level for different distances and the number of gestures, thereby improving the user experience of smart homes.
[0069] Please see Figure 1 , Figure 1 This invention relates to a control method for a mirror cabinet, comprising the following steps:
[0070] Step 1: The radar transmits a detection signal and receives multiple frames of ADC data reflected from the target, and obtains the 2DFFT spectrum of the multiple frames of ADC data;
[0071] Specifically, step 1 includes:
[0072] Step 11: Sample the intermediate frequency signal reflected from the target by the radar's transmitted detection signal to obtain ADC data;
[0073] Step 12: Perform an M-point FFT operation on the ADC data to obtain the distance spectrum of M / 2 targets as a 1DFFT (one-dimensional Fourier transform); where M represents the number of samples.
[0074] Step 13: Perform an N-point FFT operation on each distance dimension to obtain a 2DFFT, thereby obtaining the velocity spectrum and velocity index range [-N / 2, N / 2] of N targets, and obtain the 2DFFT spectrum of one frame of ADC data; where N represents the number of chirps;
[0075] Step 14: Repeat steps 11-13 several times to obtain the 2DFFT spectrum of multiple frames of ADC data; this provides a basis for subsequent ranging of moving and micro-moving targets.
[0076] In this embodiment, the invention uses electromagnetic waves to detect human bodies in an area 0-2m in front of the radar with a field of view (FOV) of [-60°, 60°]. The radar is installed at a suitable height so that the strongest direction of the radar beam is towards the human body. This is so that when the human body is stationary in front of the radar, the radar can detect subtle movements, preventing target loss due to the person's stillness. Radar installation location: The radar is installed at a height of 0-150cm above the ground. This embodiment is suitable for scenarios with no obstructions in front, but it is also applicable behind panels, mirrors, and light strips, for recognizing user actions, micro-movements, and gestures. During use, the user's hand gesture must pass over the center plane of the radar; therefore, there is no specific limitation on the installation pitch angle. The strongest direction of the radar beam is the normal direction, and the FOV coverage range for both horizontal and pitch angles is [-60°, 60°]. During installation, the strongest direction of the radar beam should be towards the area to be detected. By adjusting the radar's installation position, a large-angle detection range can be achieved.
[0077] In this embodiment, short-range compensation is performed upon power-on. This is because the radar may be installed behind a mirror or glass, and the different installation locations will result in different deviations. The compensation value is applied to calibrate the point cloud data at close range (within 30cm) to 0cm. For example, if the close-range distance is 2cm, a -2cm compensation is needed to calibrate the data to 0cm. After compensation, the close-range calibration is complete, improving the subsequent detection accuracy.
[0078] In this embodiment, the radar bandwidth is 6 GHz, and the range resolution is 5 cm. When a target is present in the detection area, the radar samples the intermediate frequency signal returned by the target to obtain ADC data (raw data). A 128-point FFT is performed on each chirp (linear frequency modulation) signal through windowing to obtain the range spectrum of 64 targets. A 16-point FFT is performed on different chirps in each range dimension to obtain 16 velocity spectra and a velocity index range [-8, 8]. One frame of ADC data contains 16 chirp signals, with a frame period of 10 ms. After two Fourier operations, a 2DFFT spectrum is obtained, making the calculated range parameters more accurate.
[0079] Step 2: Perform gesture detection and human presence detection simultaneously. The gesture detection is performed in steps 3-5; the human presence detection is performed in step 6.
[0080] Step 3: Determine if the target is in a hovering state; if yes, the gesture is activated and proceed to Step 4; if no, proceed to Step 6.
[0081] Specifically, step 3, determining whether the target is in a hovering state, includes:
[0082] Step 31: Calculate the polar coordinates of the target using the phase difference of the radar antenna;
[0083] Step 32: Project the polar coordinates into a rectangular coordinate system;
[0084] Step 33: Weight all values of each frame of ADC data in the Cartesian coordinate system to obtain the distance values of each frame of ADC data in the x-axis, y-axis and z-axis directions;
[0085] Step 34: Determine whether the following conditions are met simultaneously: the distance value in the x-axis direction of each frame of ADC data is within the x-axis detection range, the distance value in the z-axis direction is within the z-axis detection range, and the pose holding time is greater than the time threshold. If yes, the target is determined to be in a hovering state; otherwise, the target is determined not to be in a hovering state.
[0086] In this embodiment, targets at close range (within 30cm) are detected using 2DFFT.
[0087] The target's elevation angle γ is calculated using the phase difference Δψ, wavelength λ, and distance d between the two antennas. Polar coordinates (R, γ, θ) are then obtained using the radar radial distance R, elevation angle γ, and horizontal angle θ.
[0088]
[0089] Where λ is the wavelength, Δψ is the phase difference of the antenna, and d is the distance between the two antennas.
[0090] Then project the polar coordinates (R, γ, θ) onto the rectangular coordinate system (x, y, z), specifically the rectangular coordinate system as follows:
[0091] x=Rsinθ
[0092] y = Rcosθ * cosγ
[0093] z=Rsinγ
[0094] Where x is the value in the x-axis direction, y is the value in the y-axis direction, z is the value in the z-axis direction, R is the radar radial distance, θ is the horizontal angle, and γ is the elevation angle.
[0095] The weighting value is set to 1, which means that the average distance value of all targets in each frame is calculated to obtain a distance value (the distance value of xyz).
[0096] Activation of a gesture is determined when both of the following conditions are met: ① There is a target within a certain area, with the x-axis range [-15cm, 15cm] and the y-axis range [-15cm, 15cm]; ② The gesture is held for 2 seconds.
[0097] After the gesture is activated, the configuration is switched, changing the distance resolution from 5cm to 2.5cm. At this time, the bandwidth is set to 6G. Increasing the distance resolution helps to detect multiple gestures more accurately.
[0098] Step 4: Determine whether the target makes a gesture. If yes, enter gesture mode and lock it (at this time, only gesture mode will be executed). Control the brightness and color temperature level of the light according to the gesture. In this embodiment, it is set that one wave of the hand will adjust the current function (color temperature / brightness) level by one level. If no, return to step 3.
[0099] Specifically, step 4, determining whether the target makes a gesture, includes:
[0100] Step 41: Select sliding window regions on the x-axis and z-axis respectively:
[0101] In the x-axis direction, starting from the detection of the target, retain all point cloud data until the target disappears; use the region from the start of the target's detection to its disappearance as the x-axis sliding window region.
[0102] Starting from the detection of the target along the z-axis, retain all point cloud data until the target disappears; use the area from the start of the target's detection to its disappearance as the z-axis sliding window area.
[0103] In this embodiment, the starting point of the sliding window region is determined when a target is detected in 5 consecutive frames, and the ending point of the sliding window region is determined when no nearby point cloud data is output in 10 consecutive frames, indicating that the point cloud target has disappeared.
[0104] Step 42: Within the x-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the x-axis calculation area based on the interval between the maximum and minimum values; simultaneously, within the z-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the z-axis calculation area based on the interval between the maximum and minimum values; the purpose is to narrow the scope of calculation and judgment, reduce the amount of calculation, and improve efficiency.
[0105] Step 43: Perform weighted processing on all point cloud data in the x-axis calculation area and z-axis calculation area, and calculate the difference between the previous and next frames on the processed point cloud data to obtain the calculation result of the next frame minus the previous frame in each adjacent pair of frames, and determine the flag bits that are greater than 0 and less than 0 based on the calculation result.
[0106] Step 44: If all calculation results in the x-axis calculation area and all calculation results in the z-axis calculation area are 0, it is determined that the target has not made a gesture; if all calculation results in the x-axis calculation area are not 0 and / or all calculation results in the z-axis calculation area are not 0, it is determined that the target has made a gesture.
[0107] Specifically, after step 44, the method further includes:
[0108] Step 45: After determining that the target has made a gesture, a voting judgment is made based on all the calculation results in the x-axis calculation area and / or all the calculation results in the z-axis calculation area;
[0109] Step 46: If the number of results greater than 0 in all calculation results within the z-axis calculation area is greater than the number of results less than 0, then it is determined as an upward wave; if the number of results less than 0 in all calculation results within the z-axis calculation area is greater than the number of results greater than 0, then it is determined as a downward wave; if the number of results less than 0 in all calculation results within the x-axis calculation area is greater than the number of results greater than 0, then it is determined as a leftward wave; if the number of results greater than 0 in all calculation results within the x-axis calculation area is greater than the number of results less than 0, then it is determined as a rightward wave.
[0110] In this embodiment,
[0111] Voting: A voting process is performed on the point cloud data of the entire sliding window area to determine the gesture result. For example, consider a hand gesture involving waving up, down, left, or right.
[0112] (1) As Figure 2 As shown, the waving process spans frames 30-63, which can be further narrowed down to frames 41-58. Calculating the difference between consecutive frames, out of 17 frames on the z-axis, 10 are greater than 0 and 7 are less than 0. Since the number of frames greater than 0 exceeds 50% of the total, it is determined to be an upward wave.
[0113] (2) Figure 3 As shown, the waving process spans frames 30-65, which can be further narrowed down to frames 43-58. Calculating the difference between consecutive frames, out of 15 frames on the z-axis, 6 frames are greater than 0 and 9 frames are less than 0. Since the number of frames less than 0 exceeds 50% of the total, it is determined to be a downward wave.
[0114] (3) Figure 4 As shown, the waving process spans frames 16-36, which can be further narrowed down to frames 18-35. Calculating the difference between consecutive frames, out of a total of 17 frames on the x-axis, 4 frames are greater than 0 and 13 frames are less than 0. Since the number of frames less than 0 exceeds 50% of the total, it is determined that the hand is waving to the left.
[0115] (4) Figure 5 As shown, the waving process spans frames 24-38, which can be further narrowed down to frames 27-34. Calculating the difference between two consecutive frames, if the x-axis has values less than 0 in 5 out of 7 frames and 2 frames less than 0, and the number of values greater than 0 exceeds 50% of the total, then it is determined to be a rightward wave.
[0116] Step 5: If no gesture is detected within the first set time (the first set time can be set by the user according to their needs, and is not limited here), exit the gesture mode. When it is necessary to judge the gesture again, re-enter step 3 to perform the next gesture detection.
[0117] Step 6: Determine whether the target has a moving target within a second set time period (the second set time can be set by the user according to their needs, and is not limited here) based on the 2DFFT spectrum of the current frame ADC data, or determine whether the target has a micro-moving target within a third set time period (the third set time can be set by the user according to their needs, and is not limited here) based on the sampled 2DFFT spectrum of multiple frames of ADC data. If yes, output the distance of the target closest to the radar, and control the brightness and color temperature level of the light according to the target distance; if no, turn off the light (the light will turn off after 60 seconds).
[0118] Specifically, in step 6, it is determined whether there is a moving target (i.e., the target makes a large movement, such as a human walking within the radar detection range) within a second set time period based on the 2DFFT spectrum of the current frame ADC data. If so, the distance to the target closest to the radar is output; specifically including:
[0119] The target distance index is obtained by selecting the maximum value from each velocity spectrum in the 2DFFT spectrum of the current frame ADC data;
[0120] If the target distance index in the current frame contains a distance index greater than the first threshold (the first threshold can be set by the user according to their needs, and is not limited here), then it is determined that there is a moving target;
[0121] Save the distance indices of the target distance in the current frame that are greater than the first threshold;
[0122] The saved distance indices are sorted in ascending order of distance, and then output after being filtered by mean.
[0123] In this embodiment, the first threshold is 800. In other embodiments, the value of the first threshold can also be set according to the actual working conditions of the radar or based on judgment experience. No limitation is made here.
[0124] Considering DC leakage, the maximum value is selected from each velocity spectrum (range [-8, 8]) in the 2DFFT spectrum of each frame of ADC data to obtain the target distance index. If each frame's target distance index contains a distance index greater than a first threshold of 800, a moving target is determined to exist. The distance indices greater than the first threshold of 800 in each frame are saved. The saved distance indices are sorted in ascending order of distance and then processed with mean filtering before being output. This process filters out the nearest moving target. The purpose of this step is to improve the accuracy of ranging.
[0125] In this embodiment, before sorting the saved distance indices by distance from smallest to largest and performing mean filtering, the method further includes: determining the position state of the moving target.
[0126] The velocity indices corresponding to the distance indices greater than the first threshold in the target distance index of the current frame are saved. The target's position on the radar is determined based on the saved velocity indices. If the velocity index is positive, the target is moving away; if the velocity index is negative, the target is moving closer. When a target disappears after approaching the radar, counting begins. It is determined whether a new target with the same distance appears within a fourth preset time (the fourth preset time is set according to user needs and is not limited here, for example: 50ms). If so, it is recorded as a crossover, and the target distance is recorded; otherwise, it is not a crossover. The method for determining association is that the distance data before disappearance and the distance data of the newly re-entering target must be consistent, and no micro-motion signals must be detected.
[0127] In this embodiment, mean filtering and delay processing are performed before outputting the target distance of the moving target: the sorted distance indexes are subjected to mean filtering. When the number of moving target frames is greater than a preset number of frames, if the number of data points in the moving target frames is greater than or equal to a preset percentage, mean filtering is performed to obtain the filtered target distance. If the number of data points in the moving target frames is less than the preset percentage, no processing or output is performed. In this embodiment, when the number of moving target frames is greater than the preset number of frames (20 frames), if data points are greater than or equal to 60% of the moving target frames, mean filtering is performed to obtain the output data. If data points are less than 60% of the moving target frames, no output is performed, thus ensuring a smoother data output.
[0128] In this embodiment, after the sorted distance indexes are filtered by mean, when a new moving target appears, its distance correlation with the micro-moving target needs to be considered, and the distance difference Δd1 between the micro-moving target and the moving target is calculated. The correlation between the new moving target and the micro-moving target is determined based on the distance difference Δd1 and the error D1. If the distance difference Δd1 ≤ error D1 (in this embodiment, D1 = 10cm, but the specific value can be set according to user needs), it is considered to be associated with the micro-moving target, and the micro-moving target is no longer output. If the distance difference Δd1 > error D1 (in this embodiment, D1 = 10cm, but the specific value can be set according to user needs), the new moving target and the micro-moving target are considered not to be the same target, and both targets are output. The purpose of this step is to make the output target distance more stable and improve measurement accuracy.
[0129] Specifically, in step 6, the sampled 2DFFT spectrum obtained by sampling the 2DFFT spectrum of multi-frame ADC data is used to determine whether the target has a micro-movement target (i.e., the target produces micro-movements, such as a human body standing within the radar detection range without moving) exists within a third set time period. If so, the distance to the target closest to the radar is output; specifically including:
[0130] Extract the nth chirp spectrum of the same row from the 2DFFT spectrum of each frame of ADC data to obtain the sampled 2DFFT spectrum, where n is an integer and the value of n is 0≤n≤N-1;
[0131] The low-speed sampled spectrum is obtained by performing an N-point FFT operation on multiple sampled 2DFFT spectra.
[0132] If the low-speed sampling spectrum contains spectral lines greater than the second threshold (the second threshold can be set by the user according to their needs, and is not limited here), then it is determined that there is a micro-moving target.
[0133] Record the distance of the target closest to the radar in each frame, filter it, and then output the result.
[0134] In this embodiment, the second threshold is 600. In other embodiments, the value of the second threshold can also be set according to the actual working conditions of the radar or based on judgment experience. No limitation is made here.
[0135] Extracting chirp signals from the same row in the 2DFFT spectrum of each frame of data means that the 2DFFT spectrum of each frame of data contains chirp0, chirp1, ..., chirpN-1. Therefore, this step can extract the nth chirp spectrum from the 2DFFT spectrum of all frames of data, where n is an integer and its value ranges from 0 to n to N-1. This is used to form the low-speed sampling spectrum. The purpose of this step is to lengthen the frame period (sampling period) of the radar data, thereby reducing velocity resolution and improving velocity accuracy. This improved accuracy makes it easier to detect low-speed targets, thus making it suitable for detecting minute movements.
[0136] In this embodiment, the FFT value of the first chirp in each frame of the 2DFFT spectrum is taken. W (e.g., 64) frames of data are accumulated and 2DFFT is performed on different range dimensions (M / 2 range dimensions) to obtain a sampled 2DFFT. At this point, the velocity resolution is reduced to 1 / 64 of the original, which can be used for micro-motion detection. Since micro-motion is equivalent to being stationary, target detection is considered on both sides of the DC velocity spectrum: when the velocity exceeds the second threshold of 600, the distance value of the target closest to the radar is recorded. This distance value is the target distance closest to the radar. Filtering the distance of the target closest to the radar is to avoid multiple targets within the radar's detection range performing different actions; only the target closest to the radar is selected as the target to be tracked subsequently. If other targets are moving behind the target closest to the radar, they are ignored.
[0137] In this embodiment, filtering is required before outputting the target distance of the micro-moving target: Since there is a certain error (e.g., 10cm) during human detection, filtering the target distance of the micro-moving target can stabilize the output. The distance difference Δd2 between two frames of micro-movement data is calculated. If the distance difference Δd2 > the error D2 (in this embodiment, D2 = 10cm, but the specific value can be set according to user needs), the latest micro-movement value is used as the filtered target distance and output. If the distance difference Δd2 ≤ the error D2, the micro-movement value of the previous frame is retained as the filtered target distance. The purpose of this step is to make the output target distance more stable and improve measurement accuracy.
[0138] Specifically, step 6, which involves controlling the brightness and color temperature of the light based on the target distance, includes:
[0139] The color temperature and brightness level of the light are determined based on the radar's maximum detection distance;
[0140] The adjustable levels per unit distance are calculated based on the maximum detection distance and the color temperature and brightness levels of the light.
[0141] Find the corresponding color temperature and brightness values for the appropriate setting based on the target distance;
[0142] The color temperature and brightness values are converted into PWM waves and input into the H-bridge circuit for light output.
[0143] In this embodiment, as Figure 6As shown, the lighting control output first requires determining the light brightness and color difference. Assuming the radar's maximum detection distance is 2m and the field of view (FOV) is in the range of -60° to 60°, this indicates the radar can detect human presence within 2m and the FOV range of -60° to 60°. If there are 200 levels of color temperature and brightness, meaning one level corresponds to one unit of color temperature and brightness per centimeter, and assuming the detected target is 1m away, and the level is set to 100, the corresponding values for cool and warm lights are 339 and 251, respectively. The color temperature and brightness values are then converted into PWM waves and input into the H-bridge circuit for the final lighting effect.
[0144] This invention employs millimeter-wave radar (a one-transmitter, three-receiver wide-beam frequency-modulated continuous wave radar) to achieve human presence detection and multi-gesture recognition. By acquiring radar echo signals, it detects human movement and presence, achieving dynamic human detection and presence sensing. Based on millimeter-wave radar, it detects human movement (including walking (entering, exiting, crossing) and micro-movements) within a range of 0-2m and [-60°, 60°]. The detection distance for movement and micro-movements can control the brightness of the light. A universal gesture activation is used to determine the gesture, enabling adjustment of brightness and color temperature levels.
[0145] like Figure 7 As shown, this embodiment of the invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement one of the methods described above.
[0146] like Figure 8 As shown, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0147] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0148] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0149] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A control method for a mirror cabinet, characterized in that, Includes the following steps: Step 1: The radar transmits a detection signal and receives multiple frames of ADC data reflected from the target, and obtains the 2DFFT spectrum of the multiple frames of ADC data; Step 2: Perform gesture detection and human presence detection simultaneously. The gesture detection is performed in steps 3-5; the human presence detection is performed in step 6. Step 3: Determine if the target is in a hovering state; if yes, the gesture is activated and proceed to Step 4; if no, proceed to Step 6. Step 4: Determine whether the target makes a gesture. If so, enter gesture mode to lock it and control the brightness and color temperature of the light according to the gesture. If not, return to step 3; wherein, determining whether the target has made a gesture includes: Step 41: Select sliding window regions on the x-axis and z-axis respectively: In the x-axis direction, starting from the detection of the target, all point cloud data is retained until the target disappears; the region from the start of the target's detection to its disappearance is used as the x-axis sliding window region. In the z-axis direction, starting from the detection of the target, retain all point cloud data until the target disappears; use the area from the start of the target's detection to its disappearance as the z-axis sliding window area. Step 42: Within the x-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the x-axis calculation area based on the interval between the maximum and minimum values; at the same time, within the z-axis sliding window area, find the maximum value of the positive half-axis waveform and the minimum value of the negative half-axis waveform, and determine the z-axis calculation area based on the interval between the maximum and minimum values. Step 43: Perform weighted processing on all point cloud data in the x-axis calculation area and z-axis calculation area, and calculate the difference between the previous and next frames on the processed point cloud data to obtain the calculation result of the next frame minus the previous frame in each adjacent pair of frames. Step 44: If all calculation results in the x-axis calculation area and all calculation results in the z-axis calculation area are 0, it is determined that the target has not made a gesture; if all calculation results in the x-axis calculation area are not 0 and / or all calculation results in the z-axis calculation area are not 0, it is determined that the target has made a gesture. Step 45: After determining that the target has made a gesture, a voting judgment is made based on all the calculation results in the x-axis calculation area and / or all the calculation results in the z-axis calculation area; Step 46: If the number of results greater than 0 in all calculation results within the z-axis calculation area is greater than the number of results less than 0, then it is determined as an upward wave; if the number of results less than 0 in all calculation results within the z-axis calculation area is greater than the number of results greater than 0, then it is determined as a downward wave; if the number of results less than 0 in all calculation results within the x-axis calculation area is greater than the number of results greater than 0, then it is determined as a leftward wave; if the number of results greater than 0 in all calculation results within the x-axis calculation area is greater than the number of results less than 0, then it is determined as a rightward wave. Step 5: If no hand gesture is detected from the target within the first set time, exit the gesture mode. When it is necessary to judge the gesture again, re-enter step 3 to perform the next gesture detection. Step 6: Determine whether there is a moving target within the second set time period based on the 2D FFT spectrum of the current frame ADC data, or determine whether there is a micro-moving target within the third set time period based on the sampled 2D FFT spectrum obtained by sampling the 2D FFT spectrum of multiple frames ADC data. If yes, output the distance of the target closest to the radar and control the brightness and color temperature level of the light according to the target distance; otherwise, turn off the light.
2. The control method for a mirror cabinet as described in claim 1, characterized in that, Step 1 specifically includes: Step 11: Sample the intermediate frequency signal reflected from the target by the radar's transmitted detection signal to obtain ADC data; Step 12: Perform an M-point FFT operation on the ADC data to obtain the range spectrum of M / 2 targets as a 1D FFT; where M represents the number of samples. Step 13: Perform an N-point FFT operation on each distance dimension to obtain a 2D FFT, thereby obtaining the velocity spectrum and velocity index range [-N / 2, N / 2] of N targets, and obtain the 2D FFT spectrum of one frame of ADC data; where N represents the number of chirps; Step 14: Repeat steps 11-13 several times to obtain the 2D FFT spectrum of multiple frames of ADC data.
3. The control method for a mirror cabinet as described in claim 1, characterized in that, Step 3, determining whether the target is in a hovering state, specifically includes: Step 31: Calculate the polar coordinates of the target using the phase difference of the radar antenna; Step 32: Project the polar coordinates into a rectangular coordinate system; Step 33: Weight all values of each frame of ADC data in the Cartesian coordinate system to obtain the distance values of each frame of ADC data in the x-axis, y-axis and z-axis directions; Step 34: Determine whether the following conditions are met simultaneously: the distance value in the x-axis direction of each frame of ADC data is within the x-axis detection range, the distance value in the z-axis direction is within the z-axis detection range, and the pose holding time is greater than the time threshold. If yes, the target is determined to be in a hovering state; otherwise, the target is determined not to be in a hovering state.
4. The control method for a mirror cabinet as described in claim 2, characterized in that, In step 6, the system determines whether there is a moving target within a second set time period based on the 2D FFT spectrum of the current frame ADC data. If so, it outputs the distance to the target closest to the radar. Specifically, this includes: The target distance index is obtained by selecting the maximum value from each velocity spectrum in the 2D FFT spectrum of the current frame ADC data. If the target distance index in the current frame contains a distance index greater than the first threshold, then it is determined that a moving target exists; Save the distance indices of the target distance in the current frame that are greater than the first threshold; The saved distance indices are sorted in ascending order of distance, and then output after mean filtering.
5. The control method for a mirror cabinet as described in claim 2, characterized in that, In step 6, the sampled 2D FFT spectrum obtained by sampling the 2D FFT spectrum of multi-frame ADC data is used to determine whether there is a micro-moving target within a third set time period. If so, the distance to the target closest to the radar is output. Specifically, this includes: Extract the nth chirp spectrum of the same row from the 2D FFT spectrum of each frame of ADC data to obtain the sampled 2D FFT spectrum, where n is an integer and the value of n is 0≤n≤N-1; The low-speed sampled spectrum is obtained by performing an N-point FFT operation on multiple sampled 2D FFT spectra. If the low-speed sampling spectrum contains spectral lines greater than the second threshold, it is determined that a micro-moving target exists; Record the distance of the target closest to the radar in each frame, filter it, and then output the result.
6. The control method for a mirror cabinet as described in claim 1, characterized in that, Step 6, which involves controlling the brightness and color temperature of the lights based on the target distance, specifically includes: The color temperature and brightness level of the light are determined based on the radar's maximum detection distance; The adjustable levels per unit distance are calculated based on the maximum detection distance and the color temperature and brightness levels of the light. Find the corresponding color temperature and brightness values for the appropriate setting based on the target distance; The color temperature and brightness values are converted into PWM waves and input into the H-bridge circuit for light output.
7. 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 program, it implements a control method for a mirror cabinet as described in any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a control method for a mirror cabinet as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Radio frequency radar structure capable of enhancing induction sensitivity, circuit and control method thereof
CN115291170A
Function adjusting method and related device
CN115729343A
Gesture control mirror cabinet
CN215264704U