Heart Rate Detection Method, Device and Storage Medium Based on Camera Anti-Shake
The method allows for hands-free heart rate detection using camera stabilization techniques, enhancing remote monitoring accuracy by processing facial video data to calculate heart rate values.
Patent Information
- Application Number
- CN202210057311.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-01-18
AI Technical Summary
The existing heart rate detection technology requires the use of fingers, which cannot completely free your hands, cannot use facial information to identify expressions and emotions, and needs to find specific items to fix the camera.
Face videos are taken by cameras for face recognition and area of interest extraction, and heart rate value is calculated using blind source separation algorithm and fast Fourier transform to realize anti-shake heart rate detection without the need for a fixed camera.
It realizes anti-shake heart rate detection without a fixed camera, improves the accuracy of remote heart rate detection, and provides feasibility for testing anytime, anywhere.
Smart Images

Figure CN114511903B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of heart rate detection, and particularly to a heart rate detection method, device, and storage medium based on camera anti-shake. Background Art
[0002] With the development of smart devices and people's increasing attention to health, smart devices can now be equipped with health detection applications to detect users' health, such as heart rate detection apps. This is a professional heart rate monitoring software that can be completed with just one smart device without the need to rely on health devices. The specific operation method is that the user only needs to place their finger on the camera and flash of the smart device, and gently press to automatically collect your heart rate data, thereby realizing self-detection of heart rate.
[0003] However, current heart rate detection still has the following disadvantages: the detection process requires the use of fingers and cannot completely free the hands; there is no facial information, which cannot provide a basis for subsequent facial expression, emotion recognition, and attention judgment; a specific place or item is needed to fix the mobile phone. Summary of the Invention
[0004] This application provides a heart rate detection method, device, and storage medium based on camera anti-shake to solve the problem in the prior art that a specific place or item is needed to fix the camera.
[0005] To solve the above technical problems, this application proposes a heart rate detection method based on camera anti-shake, including: shooting an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; performing data preprocessing and filtering on the initial data to obtain a variation signal; using a blind source separation algorithm to obtain the source signal of the variation signal, performing a fast Fourier transform on the source signal, obtaining the absolute value of the complex number, and normalizing to obtain a single-sided amplitude spectrum; calculating a heart rate value according to the single-sided amplitude spectrum.
[0006] Optionally, performing face recognition and region of interest extraction on the original video to obtain initial data includes: transcoding the original data from YUV format or RAW format to RGB format; performing face recognition on the RGB format video and extracting the human face skin as the region of interest; calculating the mean values of the R, G, and B channels of the region of interest.
[0007] Optionally, performing data preprocessing and filtering on the initial data to obtain a variation signal includes: sampling the initial data at a sampling frequency of a preset multiple of the frame rate to obtain a sampling signal; filtering the sampling signal using a low-pass Butterworth digital filter to obtain a filtered signal; subtracting the filtered signal after filtering from the preprocessed sampling signal to obtain a variation signal.
[0008] Optionally, the heart rate value is calculated based on the unilateral amplitude spectrum, including: obtaining the maximum value within the unilateral amplitude spectrum, where the frequency corresponding to the maximum value is the heart rate frequency; multiplying the heart rate frequency by 60 seconds to obtain the heart rate value per minute.
[0009] Optionally, the initial data is sampled at a sampling frequency of a preset multiple of the frame rate to obtain a sampling signal, including: using the pchip interpolation method, piecewise cubic Hermite interpolation polynomial interpolation, and sampling the initial data at a sampling frequency of 2 times the frame rate.
[0010] Optionally, the sampling signal is further filtered using a low-pass Butterworth digital filter to obtain a filtered signal, including: substituting the parameter order of six and the normalized cut-off frequency of 0.04 into the butter function to obtain the filter coefficients Aj and Ak of the low-pass Butterworth digital filter A; using the filtfilt function of the zero-phase digital filter to implement the filtering function of the low-pass Butterworth digital filter A to obtain the filtered signal after filtering.
[0011] Optionally, it further includes: transposing the variation signal into a one-dimensional vector with three rows; obtaining the corresponding three unilateral amplitude spectra through the source signals of the three one-dimensional vectors.
[0012] To solve the above technical problems, the present application also proposes a heart rate detection device based on camera anti-shake, including: an initial data module for shooting an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; a variation signal module for performing data preprocessing and filtering on the initial data to obtain a variation signal; a unilateral amplitude spectrum module for obtaining the source signal of the variation signal using a blind source separation algorithm, performing a fast Fourier transform on the source signal, obtaining the absolute value of the complex number, and normalizing it to obtain a unilateral amplitude spectrum; a heart rate value module for calculating the heart rate value based on the unilateral amplitude spectrum.
[0013] To solve the above technical problems, the present application also proposes an electronic device, including a memory and a processor, the memory is connected to the processor, the memory stores a computer program, and when the computer program is executed by the processor, it implements the above-mentioned heart rate detection method based on camera anti-shake.
[0014] To solve the above technical problems, the present application also proposes a computer-readable storage medium storing a computer program, and when the computer program is executed, it implements the above-mentioned heart rate detection method based on camera anti-shake.
[0015] The present application provides a heart rate detection method, device, and storage medium based on camera anti-shake. The heart rate detection method based on camera anti-shake includes: capturing an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; performing data preprocessing and filtering on the initial data to obtain a variation signal; using a blind source separation algorithm to obtain the source signal of the variation signal, performing a fast Fourier transform on the source signal, calculating the absolute value of the complex number, and normalizing it to obtain a single-sided amplitude spectrum; calculating a heart rate value based on the single-sided amplitude spectrum. In the above manner, the present application does not require finding a suitable item to fix the camera, and the anti-shake function can be achieved even when held by hand, which can improve the accuracy of remote heart rate detection and provide feasibility for detecting heart rate anytime and anywhere. Description of the Drawings
[0016] To more clearly illustrate the technical solutions of the present application, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0017] Figure 1 is a schematic structural diagram of an embodiment of the heart rate detection method based on camera anti-shake of the present application;
[0018] Figure 2 is a schematic structural diagram of an embodiment of the heart rate detection device based on camera anti-shake of the present application;
[0019] Figure 3 is a schematic structural diagram of an embodiment of an electronic device of the present application;
[0020] Figure 4 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application. Detailed Embodiments
[0021] To enable those skilled in the art to better understand the technical solutions of the present application, the heart rate detection method, device, and storage medium provided by the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0022] The present application provides a heart rate detection method based on camera anti-shake. Please refer to Figure 1 , Figure 1 is a schematic structural diagram of an embodiment of the heart rate detection method based on camera anti-shake of the present application. In this embodiment, the heart rate detection method based on camera anti-shake may include steps S110 to S140, and the specific steps are as follows:
[0023] S110: Capture the original video including the human face through a camera, perform face recognition and extract the region of interest on the original video to obtain the initial data.
[0024] The heart rate detection method based on camera anti-shake in this application can be implemented in intelligent devices, where the intelligent devices can include smartphones, smart tablets, smart glasses, computers, etc. equipped with cameras and processors. In this embodiment, a smartphone is taken as an example for illustration.
[0025] For example, the user can hold the mobile phone or place it on a stand, and try to keep the mobile phone stable as much as possible. Turn on the front camera, face the human face towards the mobile phone screen, keep a distance of about 30 centimeters, and try to keep relatively still between the human face and the mobile phone, and capture an original video with a duration of 20 seconds.
[0026] Since the user will have actions such as gently touching the camera screen switch and adjusting the posture when recording the video, the data of the first two seconds of the entire video is removed here, that is, the number of data at the front is deleted, and the value is the data value of the video frame rate multiplied by two seconds.
[0027] In order to extract the required RGB three-channel data, each video frame is passed through the ffjpeg library (a simple JPEG encoding and decoding implementation), and the original data is transcoded from the YUV format or RAW format to the RGB format. Perform face recognition on the RGB format video, and extract the human face skin as the region of interest; calculate the mean values of the R, G, and B channels of the region of interest.
[0028] For example, in some mobile phones, the video captured by the mobile phone will be processed by the Qualcomm ISP pipeline, and operations that damage the original data such as filtering and white balance are performed on the video. Therefore, the original data in the raw format in the camera buffer can be directly extracted, and then these data are converted into RGB format video frames.
[0029] During the video capture process, there will be inevitable jitters in the human face image, and these subtle jitters will cause motion errors. Since the rppg signal focuses on the weak changes caused by blood flow, face detection needs to be performed on each video frame to reduce the motion errors caused by the natural jitters of the user during the video capture process.
[0030] Remote photoplethysmography (rPPG) detects subtle color changes on the surface of the human skin caused by capillary pulses through a camera, and obtains the human heart rate value through the changes caused by these physical signals, so as to complete the non-contact detection of human physiological activities. The region of interest refers to the human skin surface we select. There are rich capillaries on the human face, which is an excellent choice for the region of interest. If the face area of each video frame is fragmented and partitioned, it requires a relatively high graphics card requirement for the mobile phone and is relatively time-consuming. Here, while performing face recognition and tracking, we also perform recognition and tracking on the eye area, because blinking and eye movements have an impact on the experimental results. Finally, the selected region of interest is the entire human face, excluding the eye area.
[0031] Here, the mean value of the region of interest refers to calculating the mean values of the R, G, and B channels within the region to be calculated. Since the video frames have been transcoded into the RGB format, the mean values of the R, G, and B channels within the region of interest can be directly calculated. To avoid variable value overflow, the channel mean values are extracted line by line, and then the mean values of all lines are averaged. Finally, a set of R, G, and B channel mean values will be obtained for each video frame. Each detected video will obtain three-channel mean values with the number equal to the duration multiplied by the video frame rate.
[0032] S120: Perform data preprocessing and filtering on the initial data to obtain a variation signal.
[0033] Sample the initial data at the sampling frequency of the preset multiple frame rate to obtain a sampling signal; use a low-pass Butterworth digital filter to filter the sampling signal to obtain a filtered signal; subtract the filtered signal after filtering from the preprocessed sampling signal to obtain a variation signal.
[0034] Optionally, the pchip interpolation method, piecewise cubic Hermite interpolation polynomial interpolation can be adopted, and the initial data is sampled at the sampling frequency of 2 times the frame rate.
[0035] In real life, the maximum heart rate value is about 220, corresponding to a frequency of about 3.67HZ, and the video frame rate is 30 frames per second. After calculation, the normalized cut-off frequency is 0.04 at this time, which is the best.
[0036] Therefore, the steps of filtering processing can include: substituting the parameter order of six and the normalized cut-off frequency of 0.04 into the butter function to obtain the filter coefficients Aj and Ak of the low-pass Butterworth digital filter A; using the filtfilt function of the zero-phase digital filter to implement the filtering function of the low-pass Butterworth digital filter A to obtain the filtered signal after filtering. Compared with the filter function, the filtfilt function realizes zero phase, and the signal spectrum will not generate phase shift after filtering.
[0037] Note that the rPPG signal obtained from the video refers to the subtle color change of the reflected light generated by the capillary pulse on the human skin surface. What needs to be concerned here is this change, and this change signal is the key to the subsequent processing. The change signal is finally obtained by subtracting the filtered signal from the preprocessed signal.
[0038] S130: Use the blind source separation algorithm to obtain the source signal of the change signal, perform a fast Fourier transform on the source signal, obtain the absolute value of the complex number, and normalize it to obtain the single-sided amplitude spectrum.
[0039] The blind source separation algorithm (FastICA) refers to analyzing the unobserved original signal from multiple observed mixed signals. Usually, the observed mixed signals come from the outputs of multiple sensors, and the output signals of the sensors are independent (linearly uncorrelated).
[0040] The "blind" in the blind signal emphasizes two points: 1) The original signal is unknown; 2) The method of signal mixing is also unknown. The main goal of blind signal separation is to restore the original signal to the original single signal. A classic example is the cocktail party effect. When many people are talking in the same space, the listener can focus on what one person is saying. The human brain can instantaneously process such speech signal separation problems.
[0041] The blind source separation algorithm regards the above change signal as a mixed signal and estimates the source signal according to the change signal obtained in the above steps.
[0042] First, transpose the change signal into a one-dimensional vector with 3 rows. Use the parameter control program algorithm of the stable version. If it is stable, then the value of the step number can be temporarily halved if the program feels that the algorithm is stuck between two points (this is called a stroke). Similarly, if convergence is not achieved before reaching half of the maximum number of iterations, then the step number will be halved in the remaining rounds. Set the maximum number of iterations to 2000.
[0043] The blind source separation algorithm can be solved by the Newton iteration method. The iterative step for obtaining a demixing vector is as follows:
[0044] 1. Select a random initial vector w;
[0045] 2. Let
[0046] 3. Let
[0047] 4. Convergence judgment condition abs(w T w + -1) < ε, if not convergent, return to the second step.
[0048] There are two methods for solving all solution mixing vectors, namely the traversal method and the parallel method. In this embodiment, the parallel method is adopted, specifically as follows:
[0049] 1. Select a random initial demixing matrix w;
[0050] 2. Let
[0051] 3. Let
[0052] 4. Let Repeat this process until W no longer changes;
[0053] 5. Convergence judgment condition abs(w T w + -1) < ε, if not convergent, return to the second step.
[0054] Above, after obtaining the source signal of the varying signal through the blind source separation algorithm, it is necessary to perform a fast Fourier transform on the source signal, obtain the absolute value of the complex number, and normalize it. The normalized spectrum is a bilateral amplitude spectrum, which is symmetric on both sides. Only keep the left part. Use a Butterworth low-pass digital filter with an order of 8 and a normalized cut-off frequency of 0.2 to filter out the unilateral amplitude spectrum.
[0055] S140: Calculate the heart rate value based on the unilateral amplitude spectrum.
[0056] The three one-dimensional source signals correspond to three unilateral amplitude spectra. Obtain the maximum value within the unilateral amplitude spectrum. Among them, the frequency corresponding to the maximum value is the heart rate frequency; multiply the heart rate frequency by 60 seconds to obtain the heart rate value per minute.
[0057] The normal heart rate range of a person is 45 to 220 beats per minute, 0.75Hz - 3.67Hz. Therefore, within the normal heart rate range of a person, find the maximum value within the unilateral amplitude spectrum. The frequency corresponding to this maximum value is the required heart rate frequency. Multiply the heart rate frequency by 60 seconds to obtain the heart rate value per minute.
[0058] In some other embodiments, the algorithm can also be optimized, such as using moving segmented function domain sampling.
[0059] Specifically, a moving average time series filter is adopted. In order to reduce the root mean square error (RMSE), mean absolute error (MAE), and standard deviation (STD), the piecewise function of different time periods is used to intercept the initial data and repeat the second and third parts. The specific implementation is as follows: First, set the sampling time period of the piecewise function to 5 seconds, intercept the initial data from the 1st second to the 5th second, and send it to the initial data preprocessing of the second part. After going through the key process of physiological index measurement in the third part, the heart rate value 5-1 is obtained; the entire video is 20 seconds, excluding the first 2 seconds of data, leaving 18 seconds of initial data. Each time 5 seconds are intercepted, with an interval of 1 second between each segment, a total of 13 times can be intercepted. The initial data from the 2nd second to the 6th second is intercepted to obtain the heart rate value 5-2, the initial data from the 3rd second to the 7th second is intercepted to obtain the heart rate value 5-3, until the heart rate value 5-13 is obtained. Finally, the average value of these 13 values is calculated to obtain the heart rate value 5. Then change the sampling time period of the piecewise function to 6 seconds, repeat the above steps, and obtain the heart rate value 6. Continue to change the sampling time period of the piecewise function to 7 seconds, 8 seconds to 18 seconds, and obtain the heart rate value 7, the heart rate value 8, to the heart rate value 18. The heart rate value 18 is the value obtained without using the moving piecewise function sampling for the entire video and is the control value of this algorithm.
[0060] Finally, this embodiment also gives the data verification calculation error:
[0061] In the experiment, multiple groups of people were used to simultaneously hold the mobile phone to shoot videos and wear Omron blood pressure monitors to measure the standard heart rate values. The above algorithm was practiced and tested. The calculation errors of the heart rate values measured by different piecewise function sampling time period methods were compared with the standard heart rate values, and the calculation errors of the heart rate values measured by the method without using the moving piecewise function sampling were compared with the standard heart rate values. It can be seen that when the sampling time period of the piecewise function is 10 seconds, the root mean square error (RMSE), mean absolute error (MAE), and standard deviation (STD) are the lowest, which are 6.6929, 5.1365, and 6.6165 respectively. The errors compared with those without using the moving piecewise function sampling are 13.53, 10.79, and 14.09 respectively, and the errors are reduced by 50.5%, 52.4%, and 53.04% respectively.
[0062] In summary, through the solution of this embodiment, measuring the heart rate with a mobile phone in hand can get rid of the constraints of the environment without finding a suitable item to fix the mobile phone, providing feasibility for detecting the heart rate anytime and anywhere. In the case of holding the mobile phone in hand, the accuracy of remote heart rate detection is improved, providing a basis for subsequent video research; moreover, this embodiment also realizes the function of anti-shake, and the data are all video data collected by the experimenters holding the mobile phone to record videos. It fits the scope of daily use. People's demand for heart rate detection is to detect it at any time. And detecting with a mobile phone in hand can meet this demand. There is no need to measure in front of a fixed camera, nor to fix the mobile phone in place or need a mobile phone stand.
[0063] Based on the above heart rate detection method based on camera anti-shake, the present application also proposes a heart rate detection device based on camera anti-shake. Please refer to Figure 2 , Figure 2 FIG. Figure 2 is a schematic structural diagram of an embodiment of the heart rate detection device based on camera anti-shake in the present application. In this embodiment, the heart rate detection device based on camera anti-shake may include an initial data module 210, a change signal module 220, a single-sided amplitude spectrum module 230, and a heart rate value module 240.
[0064] The initial data module 210 is configured to capture an original video including a human face through a camera, perform face recognition and region of interest extraction on the original video, and obtain initial data;
[0065] The change signal module 220 is configured to perform data preprocessing and filtering on the initial data to obtain a change signal;
[0066] The single-sided amplitude spectrum module 230 is configured to use a blind source separation algorithm to obtain the source signal of the change signal, perform a fast Fourier transform on the source signal, obtain the absolute value of the complex number, and normalize it to obtain a single-sided amplitude spectrum;
[0067] The heart rate value module 240 is configured to calculate a heart rate value based on the single-sided amplitude spectrum.
[0068] Based on the above heart rate detection method based on camera anti-shake, the present application also proposes an electronic device, as Figure 3 shown, Figure 3 FIG. Figure 3 is a schematic structural diagram of an embodiment of the electronic device of the present application. The electronic device 300 may include a memory 31 and a processor 32. The memory 31 is connected to the processor 32. A computer program is stored in the memory 31. When the computer program is executed by the processor 32, the method of any of the above embodiments is implemented. The steps and principles have been introduced in detail in the above method and will not be elaborated here.
[0069] In this embodiment, the processor 32 may also be referred to as a CPU (central processing unit, central processing unit). The processor 32 may be an integrated circuit chip with signal processing capabilities. The processor 32 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0070] Based on the above heart rate detection method based on camera anti-shake, the present application also proposes a computer-readable storage medium. Please refer to Figure 4 , Figure 4It is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. A computer program 41 is stored on the computer-readable storage medium 400. When the computer program 41 is executed by a processor, the method of any of the above embodiments is implemented. The steps and principles have been introduced in detail in the above method and will not be repeated here.
[0071] Furthermore, the computer-readable storage medium 400 may also be various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic tape, or an optical disc.
[0072] The present application proposes a heart rate detection method, device, and storage medium based on camera anti-shake. The heart rate detection method based on camera anti-shake includes: capturing an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; performing data preprocessing and filtering on the initial data to obtain a variation signal; using a blind source separation algorithm to obtain the source signal of the variation signal, performing a fast Fourier transform on the source signal, obtaining the absolute value of the complex number, and normalizing it to obtain a single-sided amplitude spectrum; calculating the heart rate value according to the single-sided amplitude spectrum. In this way, the present application does not need to find a suitable item to fix the camera, and the anti-shake function can be achieved even when held by hand, which can improve the accuracy of remote heart rate detection and provide feasibility for detecting heart rate anytime and anywhere.
[0073] It can be understood that the specific embodiments described herein are only for explaining the present application and not for limiting the present application. In addition, for the convenience of description, only the parts related to the present application are shown in the drawings instead of all the structures. The step numbers used in the text are only for convenient description and do not limit the execution order of the steps. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0074] The terms "first", "second", etc. in the present application are used to distinguish different objects rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0075] References to "embodiments" in this specification mean that particular features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0076] The above are only the embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A heart rate detection method based on camera anti-shake, characterized in that, including: capturing an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; performing data preprocessing and filtering on the initial data to obtain a change signal; the performing data preprocessing and filtering on the initial data to obtain a change signal includes: sampling the initial data at a sampling frequency of a preset multiple frame rate to obtain a sampling signal; filtering the sampling signal using a low-pass Butterworth digital filter to obtain a filtered signal; subtracting the filtered signal after filtering from the sampled signal after preprocessing to obtain the change signal; using a blind source separation algorithm to obtain the source signal of the change signal, performing a fast Fourier transform on the source signal, obtaining the absolute value of the complex number, and normalizing to obtain a single-sided amplitude spectrum; calculating a heart rate value based on the single-sided amplitude spectrum.
2. The heart rate detection method based on camera anti-shake according to claim 1, wherein the performing face recognition and region of interest extraction on the original video to obtain initial data includes: transcoding the original video from YUV format or RAW format to RGB format; performing face recognition on the RGB format video and extracting the human face skin as the region of interest; calculating the mean values of the R, G, and B channels of the region of interest.
3. The heart rate detection method based on camera anti-shake according to claim 1, wherein the calculating a heart rate value based on the single-sided amplitude spectrum includes: obtaining the maximum value within the single-sided amplitude spectrum, where the frequency corresponding to the maximum value is the heart rate frequency; multiplying the heart rate frequency by 60 seconds to obtain the heart rate value per minute.
4. The heart rate detection method based on camera anti-shake according to claim 1, characterized in that the sampling the initial data at a sampling frequency of a preset multiple frame rate to obtain a sampling signal includes: using the pchip interpolation method, piecewise cubic Hermite interpolation polynomial interpolation, and sampling the initial data at a sampling frequency of 2 times the frame rate.
5. The heart rate detection method based on camera anti-shake according to claim 1, characterized in that, the filtering the sampling signal using a low-pass Butterworth digital filter to obtain a filtered signal includes: bringing the parameter order of six and the normalized cut-off frequency of 0.04 into the butter function to obtain the filter coefficients Aj and Ak of the low-pass Butterworth digital filter A; using the zero-phase digital filter filtfilt function to implement the filtering function of the low-pass Butterworth digital filter A to obtain the filtered signal after filtering.
6. The heart rate detection method based on camera anti-shake according to claim 5, wherein, also including: transposing the change signal into a one-dimensional vector with three rows; obtaining corresponding three single-sided amplitude spectra through the source signals of the three one-dimensional vectors.
7. A heart rate detection device based on camera anti-shake, characterized in that, including: an initial data module for capturing an original video including a human face through a camera, performing face recognition and region of interest extraction on the original video to obtain initial data; a change signal module for performing data preprocessing and filtering on the initial data to obtain a change signal; wherein, the performing data preprocessing and filtering on the initial data to obtain a change signal includes: sampling the initial data at a sampling frequency of a preset multiple frame rate to obtain a sampling signal; filtering the sampling signal using a low-pass Butterworth digital filter to obtain a filtered signal; subtracting the filtered signal after filtering from the sampled signal after preprocessing to obtain the change signal; The single-sided amplitude spectrum module is used to obtain the source signal of the variation signal by using the blind source separation algorithm, perform a fast Fourier transform on the source signal, obtain the absolute value of the complex number, and normalize it to obtain the single-sided amplitude spectrum; The heart rate value module is used to calculate the heart rate value according to the single-sided amplitude spectrum.
8. An electronic device, characterized in that, It includes a memory and a processor, the memory is connected to the processor, the memory stores a computer program, and when the computer program is executed by the processor, it implements the heart rate detection method based on camera anti-shake according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed, it implements the heart rate detection method based on camera anti-shake according to any one of claims 1-6.