Heart rate measurement method and device based on mobile phone camera

By controlling the mobile phone camera and flash interface, setting the threshold range and filtering, and combining the accelerometer to determine the stationary state, the anti-interference problem of mobile phone camera heart rate measurement is solved, and the reliability and stability of heart rate measurement are achieved.

CN116708966BActive Publication Date: 2026-04-17GUANGDONG ICOMON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG ICOMON TECH CO LTD
Filing Date
2023-06-14
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing heart rate measurement methods based on mobile phone cameras have poor anti-interference capabilities, resulting in unstable heart rate measurements.

Method used

By calling the mobile phone's camera and flash interface, setting threshold ranges and filtering processes, combining the accelerometer to determine the stationary state, calculating the heartbeat cycle, and performing interval statistics and confidence analysis of heart rate values, a reliable heart rate value is output.

Benefits of technology

It improves the reliability of heart rate measurement, can identify abnormal situations and prompt users to adjust their measurement posture, and outputs stable heart rate values ​​and confidence levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708966B_ABST
    Figure CN116708966B_ABST
Patent Text Reader

Abstract

This invention discloses a heart rate measurement method and device based on a mobile phone camera. The heart rate measurement method includes: S1, calling the interface on the mobile phone that controls the camera and flash; S2, acquiring each frame image returned from the camera and the sampling rate A1, calculating the average value of the pixels in the three RGB channels of the image and recording them as Pr, Pg, and Pb, and recording the average value of the data after dimensionality reduction of the three channels as Prgb; ​​S3, setting threshold ranges H1, H2, and H3, and continuously judging whether Pr, Pg, and Pb are within H1, H2, and H3 respectively. If they all meet the criteria, proceed to step S4; otherwise, proceed to step S1; S4, filtering the acquired data; S5, calculating the heart rate cycle on the filtered data and converting it into a heart rate value; S6, performing interval statistics on the heart rate value, and outputting the heart rate value and confidence level after determining the heart rate center point; The heart rate value calculated by this method has high reliability, and can remind the user to complete the measurement as required by identifying abnormal situations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of heart rate measurement, and particularly to a method and device for heart rate measurement based on a mobile phone camera. Background Technology

[0002] With the development of technology, heart rate measurement can be achieved using mobile phones, mainly including the following steps: placing a finger at the camera position, with the finger covering both the flash and the camera; the camera taking pictures, extracting signals from multiple consecutive pictures, and calculating the heart rate by calculating the periodicity of the signals; however, this heart rate measurement method has the disadvantage of poor anti-interference ability, and the measured heart rate value is unstable once the signal is poor; therefore, there is an urgent need for a heart rate measurement method and device based on mobile phone cameras to solve the above problems. Summary of the Invention

[0003] This invention aims to solve at least one of the technical problems existing in the prior art. To this end, this invention proposes a heart rate measurement method and device based on a mobile phone camera.

[0004] One embodiment of the present invention provides a technical solution to solve its technical problem: a heart rate measurement method based on a mobile phone camera, comprising:

[0005] S1. Call the interface on the phone to control the camera and flash, and keep the flash on and enable the camera's continuous shooting or video shooting mode.

[0006] S2. Obtain each frame image returned from the camera and the sampling rate A1. Calculate the average value of the pixels in the three RGB channels of the image and record them as Pr, Pg and Pb. Record the average value of the data after dimensionality reduction of the three channels as Pr gb.

[0007] S3. Set the first threshold range H1, the second threshold range H2 and the third threshold range H3, and continuously determine whether Pr is within the first threshold range H1, whether Pg is within the second threshold range H2 and whether Pb is within the third threshold range H3. If all are met, proceed to step S4; otherwise, proceed to step S1.

[0008] S4. Filter the collected data;

[0009] S5. Calculate the heart rate cycle and convert the filtered data into a heart rate value;

[0010] S6. Perform interval statistics on heart rate values, and output the heart rate value and confidence level after determining the center point of the heart rate.

[0011] Furthermore, the following steps are included between steps S1 and S2:

[0012] Data from the phone's accelerometer is acquired to determine if there is any movement during the measurement process. If significant movement is detected, the user is prompted to complete the measurement while stationary.

[0013] Further, step S4 includes the following steps:

[0014] S4.1 Baseline filtering: The first two Pr gb data points are used as the baseline, and the baseline is subtracted from all collected data.

[0015] S4.2 Bandpass filtering: Perform bandpass filtering on the baseline filtered data.

[0016] Further, step S5 includes the following steps:

[0017] S5.1 Buffer the filtered data within T1 seconds and calculate the average amplitude difference F n (k)

[0018]

[0019] Where n is the current cached data sequence, N is the data length, k is the distance between two data points, and 0 is the distance between the two data points. <k<N-1;

[0020] k is the horizontal axis, F n (k) is the vertical axis. The position of the first trough of k from small to large is the number of sampling points between two heartbeats. The number of sampling points between two heartbeats divided by the sampling rate A1 is the period of the signal.

[0021] S5.2 Heart rate value HR=60*A1 / INTV, where INTV is the number of sampling points between two heartbeats.

[0022] Furthermore, between steps S5.1 and S5.2, the following step is also included: using quadratic spline interpolation to improve the accuracy of the heartbeat cycle.

[0023] Further, step S6 includes the following steps:

[0024] S6.1 Update the cached filtered data every T2 seconds, retain the latest N data points, and calculate the heart rate value;

[0025] S6.2 The obtained heart rate values ​​are placed into a queue of length M. When the data in the queue exceeds a threshold B, interval statistics begin, where 0 <B<M;

[0026] S6.3. Using K1 bpm as an interval, perform weighted statistics on the heart rate values ​​in the queue. When a heart rate value falls within an interval, the score of that interval is increased by C1, and the scores of the two adjacent intervals are increased by C2. Where 0 <C2<C1;

[0027] S6.4. Calculate the sum of the scores of two adjacent intervals and record the one with the maximum score. If the maximum scores are the same, select the interval with a smaller heart rate range. If the difference between the scores of two adjacent heart rate intervals is greater than C3, take the middle value of the heart rate interval with a higher score as the center point. If the difference between the scores of two adjacent heart rate intervals is ≤ C3, take the centers of the two heart rate intervals as the center point.

[0028] S6.5. Use the center point ± K2 bpm of the heart rate statistics as the effective interval, take all the heart rate values within this effective interval, and when the number of heart rate values is greater than D, determine and output the heart rate values and confidence levels.

[0029] If the latest E heart rate values all fall within this effective interval and the maximum value - minimum value < C4, then the confidence level is set to F1 and the heart rate value is the average of these E data points.

[0030] If the latest E heart rate values all fall within this effective interval and the maximum value - minimum value < C5, where C4 < C5, then the confidence level is set to F2, F2 < F1, and the heart rate value is the average of these E data points.

[0031] If E out of the latest E + 1 heart rate values fall within this effective interval and the maximum value - minimum value of the heart rate values that fall within this effective interval < C6, where C4 < C6, then the confidence level is set to F3, F3 < F2, and the heart rate value is the average of these E data points.

[0032] The higher the confidence level, the more reliable the output heart rate value.

[0033] Furthermore, when the difference between the latest real-time heart rate value and the previous heart rate value is greater than C7, delay the output by G heart rate values and output the previous heart rate value during the delay period.

[0034] A heart rate measurement device based on a mobile phone camera applies the described heart rate measurement method.

[0035] The beneficial effects of this invention are as follows: A heart rate measurement method and device based on a mobile phone camera. The heart rate measurement method includes: S1, calling the interface on the mobile phone that controls the camera and flash, and keeping the flash constantly on and activating the camera's continuous shooting or video shooting mode; S2, acquiring each frame image returned from the camera and the sampling rate A1, calculating the average value of the pixels in the three RGB channels of the image, and recording them as Pr, Pg, and Pb, and recording the average value of the data after dimensionality reduction of the three channels as Prgb; ​​S3, setting a first threshold range H1, a second threshold range H2, and a third threshold... The range is H3, and it is continuously judged whether Pr is within the first threshold range H1, whether Pg is within the second threshold range H2, and whether Pb is within the third threshold range H3. If all are met, proceed to step S4; otherwise, proceed to step S1. S4: Filter the collected data. S5: Calculate the heart rate cycle of the filtered data and convert it into a heart rate value. S6: Perform interval statistics on the heart rate value, and output the heart rate value and confidence level after determining the heart rate center point. The heart rate value calculated by this method has high reliability, and it can remind the user to complete the measurement as required by identifying abnormal situations. Attached Figure Description

[0036] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0037] Figure 1 This is a flowchart of a heart rate measurement method based on a mobile phone camera;

[0038] Figure 2 This is an example of a heart rate measurement method based on a mobile phone camera, showing the values ​​of the first 30 pixels.

[0039] Figure 3 The waveform before baseline filtering;

[0040] Figure 4 This is a waveform diagram after baseline filtering;

[0041] Figure 5 The waveform after bandpass filtering;

[0042] Figure 6 The waveform diagram after bandpass filtering and average amplitude difference calculation;

[0043] Figure 7 A simulation diagram of quadratic spline interpolation;

[0044] Figure 8 A diagram showing the derivation of the parabola;

[0045] Figure 9 A schematic diagram illustrating an example of weighted statistics based on heart rate values;

[0046] Figure 10 A schematic diagram of the first embodiment for determining the center point;

[0047] Figure 11 A schematic diagram of the second embodiment for determining the center point;

[0048] Figure 12 A schematic diagram of the third embodiment for determining the center point;

[0049] Figure 13 This is a schematic diagram for delayed output. Detailed Implementation

[0050] This section will describe in detail specific embodiments of the present invention. Preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and overall technical solution of the present invention, but they should not be construed as limiting the scope of protection of the present invention.

[0051] In the description of this invention, "multiple" means two or more; "greater than," "less than," and "exceeding" are understood to exclude the stated number; "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0052] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0053] In this invention, unless otherwise explicitly defined, the terms "setting," "installing," and "connecting" should be interpreted broadly. For example, they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to a fixed connection, a detachable connection, or an integrally formed connection; they can refer to a mechanical connection; they can refer to the internal connection of two components or the interaction between two components. Those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0054] Reference Figures 1 to 13 Heart rate measurement methods based on mobile phone cameras include:

[0055] S1. Call the interface on the phone to control the camera and flash, and keep the flash on and enable the camera's continuous shooting or video shooting mode.

[0056] S2. Obtain each frame image returned from the camera and the sampling rate A1. Calculate the average value of the pixels in the three RGB channels of the image and record them as Pr, Pg and Pb. Record the average value of the data after dimensionality reduction of the three channels as Pr gb.

[0057] S3. Set the first threshold range H1, the second threshold range H2 and the third threshold range H3, and continuously determine whether Pr is within the first threshold range H1, whether Pg is within the second threshold range H2 and whether Pb is within the third threshold range H3. If all are met, proceed to step S4; otherwise, proceed to step S1.

[0058] S4. Filter the collected data;

[0059] S5. Calculate the heart rate cycle and convert the filtered data into a heart rate value;

[0060] S6. Perform interval statistics on heart rate values, and output the heart rate value and confidence level after determining the center point of the heart rate.

[0061] As a preferred embodiment of the present invention:

[0062] ① Call the interface on the phone that controls the camera and flash to keep the flash constantly on, start the continuous shooting or video shooting mode of the camera, and acquire each frame of image returned by the camera and the sampling rate, which is generally 20-30Hz; and acquire data from the phone's accelerometer to determine if there is movement during the measurement. If obvious movement is detected, the user is prompted to complete the measurement while stationary; furthermore, there are many ways to determine whether there is movement by using acceleration, such as acquiring the data of the most recent second, calculating the difference between adjacent data and then averaging the absolute values. If the average value is greater than a certain threshold, it is considered that there is movement.

[0063] ② The image captured by the camera has three channels: RGB. Each channel has M pixels, and the size of M is related to the resolution of the image. The value of each pixel ranges from 0 to 255. To simplify the subsequent processing steps, the average value of the pixels in each channel is calculated, so that the 3xM data will be reduced to 3 dimensions. The data of the three RGB channels after dimensionality reduction are recorded as Pr, Pg, and Pb, and the average value of the data of the three channels after dimensionality reduction is recorded as Prgb.

[0064] ③ Continuously determine whether Pr, Pg, and Pb are within the threshold range. If all are within the range, it is considered that the finger has been closely attached to the camera. The judgment principle is as follows: When the finger is closely attached to the camera, most of the captured images are red, the average value of each pixel in the R channel of the image is relatively large, and the values of the G and B channels fluctuate within a certain range. Only when Pr, Pg, and Pb are all within the threshold range will the heart rate measurement process be entered. Otherwise, the heart rate measurement will be re-initialized, and the user will be informed through the mobile application that the current conditions do not allow for heart rate measurement. Preferably, the threshold range can be set as: Pr > 230, 40 < Pg < 80, 20 < Pb < 60; and Figure 2 In an embodiment of the present invention, the values of the first 30 pixel points are approximately Pr ≈ 255, Pgr ≈ 59, and Pbr ≈ 43;

[0065] ④ After meeting the conditions for heart rate measurement, first record the values of the first two Prgb, and calculate the average as the baseline. Then, subtract the baseline from the subsequently collected data before proceeding to the next step. Baseline filtering offsets the data used to calculate the heart rate to around 0, which can accelerate the convergence speed of the subsequent band-pass filter and avoid large disturbances. Refer to Figure 3 for the waveform diagram before baseline filtering, and Figure 4 for the waveform diagram after baseline filtering;

[0066] ⑤ Refer to Figure 5 for the waveform diagram after band-pass filtering. Perform band-pass filtering on the data after baseline filtering. The passband can be set to 0.5 - 4 Hz;

[0067] ⑥ Use the average amplitude difference to calculate the period for the data after band-pass filtering. The calculation method is as follows:

[0068] Cache the data after band-pass filtering for a recent period of time, which can be 4s, 6s, 8s, 10s, 12s, etc. The more data cached, the smoother the output result, but the output time and calculation time will also be longer; the shorter the cached data, the more sensitive the output result. When the cached data meets the calculation conditions, calculate a new sequence using the following formula:

[0069]

[0070] where n represents the current sequence of data after band-pass filtering cached, N is the data length, and k is the distance between two data points;

[0071] The average amplitude difference is the sum of the absolute values ​​of the differences between points at different distances. The value of k ranges from 0 to N-1, resulting in a new set of data. If the data after bandpass filtering is a periodic signal, then when the distance divided by the sampling rate is consistent with the period, the calculated result is a local minimum, also known as a trough. The period of the current signal can be obtained by the location of the trough.

[0072] Reference Figure 6 The waveform is shown after bandpass filtering and average amplitude difference calculation, with k on the horizontal axis and F... n (k) is the vertical axis. The position of the first trough of k from small to large is the number of sampling points between two heartbeats. The number of sampling points between two heartbeats divided by the sampling rate A1 is the period of the signal.

[0073] ⑦ The formula for converting a heartbeat cycle into a heart rate value is:

[0074] HR = 60 * A1 / INTV, where INTV is the number of sampling points between two heartbeats. Specifically, A1 / INTV is the reciprocal of the period. 60 multiplied by the reciprocal of the heartbeat period is the heart rate.

[0075] Let INTV = 19, A1 = 30; and INTV = 20, A1 = 30, then the heart rate values ​​can be calculated as HR1 = 60 * 30 / 19 = 94.7 (rounded to 95), HR2 = 60 * 30 / 20 = 90;

[0076] It can be seen that a difference of even one sampling point introduces a quantization error of 5 bmps. Therefore, quadratic spline interpolation is needed to reduce the quantization error, which involves finding the vertex of the curve using sampling points. Specifically:

[0077] The vertex of the parabola can be calculated using three points, employing the vertex form: y = a(xb). 2 +k(a≠0) describes the parabola. We are only interested in b. Using vertex form simplifies the calculation. Assume:

[0078] The point preceding the trough is (x1, y1), defined as point 1.

[0079] The trough is (x2, y2), defined as point 2.

[0080] The point following the trough is (x3, y3), defined as point 3.

[0081] Let (x1, y1) be the origin (0, 0), x2 = 1, x3 = 2,

[0082] Since the interval of the X coordinate of each point is 1, solving the equation yields the result of b relative to the origin coordinate: b = 1 + (y3) / 2 * (2 * y2 - y3). b is a floating-point number, representing a more accurate vertex X coordinate. Substituting this into the formula for the heart rate value during the cycle, we can obtain a heart rate value with a smaller error. Since y1 is set to 0, the values ​​of y2 and y3 should be the actual Y coordinates of points 2 and 3 minus the actual Y coordinate of point 1.

[0083] ⑧ As described in point ⑦ above, the previously cached bandpass filtered data is updated every 0.5 seconds, retaining only the latest N data points. Using the latest N data points, the heart rate value is calculated through average amplitude difference and quadratic spline interpolation. The heart rate value is placed in a queue of length 20. If the queue is full, the oldest data is deleted and the latest data is pushed in. When the data in the queue exceeds a threshold, such as 10, interval statistics are performed to determine which interval the heart rate value is most likely to fall into.

[0084] Using 10 bpm intervals, the heart rate values ​​in the queue are weighted and statistically analyzed. When a heart rate value falls within a certain interval, the score for that interval is increased by 3, and the scores for the two adjacent intervals are increased by 1. Figure 9 For heart rate values ​​of 85, add 3 to the score in the interval [80, 90), and add 1 to the scores in the intervals [70, 80) and [90-100).

[0085] After all heart rate values ​​in the queue have been counted, the center point is found first according to the following rules:

[0086] Reference Figure 10 First, calculate the sum of the scores of two adjacent intervals, find the one with the largest score, and record it. If there are cases where the highest scores are the same, take the one with the smaller heart rate interval, which is the heart rate interval in the left box of the figure.

[0087] Reference Figure 11 Compare the two intervals with the largest sum of scores. If the difference between the scores of the two intervals is greater than 2, take the midpoint of the interval with the higher score as the center point for heart rate statistics, that is, (60+70) / 2=65.

[0088] Reference Figure 12 Compare the two intervals with the largest sum of scores. If the difference between the scores of the two intervals is ≤2, take the center of the two intervals as the center point of the heart rate statistics, that is, (60+80) / 2=70.

[0089] ⑨ The effective interval is ±15 bpm of the center of the heart rate statistics. All heart rate values ​​in this interval are used to determine the output heart rate and confidence level. The confidence level of the heart rate value is judged only if the number of heart rate values ​​in the effective interval is greater than 5; otherwise, the confidence level is 0.

[0090] a) The latest 6 heart rate values ​​all fall within this range, and the maximum value minus the minimum value is less than 8. The confidence level is 3, and the heart rate value is the average of the 6 data points.

[0091] b) The latest 6 heart rate values ​​all fall within this range, and the maximum value minus the minimum value is less than 10, with a confidence level of 2. The heart rate value is the average of the 6 data points.

[0092] c) Of the latest 7 heart rate values, 6 fall within this range, and the maximum value minus the minimum value among the heart rate values ​​falling within the range is less than 6, with a confidence level of 1. The heart rate value is the average of the 6 data points.

[0093] d) The higher the confidence level, the more reliable the output heart rate value. Generally, a confidence level of 3 is used for locking by default. If certain application scenarios require fast locking and accuracy is not so important, you can choose a confidence level greater than or equal to 2 or a confidence level of 1 to lock. A confidence level of 0 will not lock.

[0094] It will also output the timeout heart rate, which is the average of all data within the valid interval. If it is not locked, the timeout heart rate can be output when the measurement times out. The timeout time is determined by the application layer according to the business logic.

[0095] ⑩Reference Figure 13 During measurement, if real-time heart rate display is required, to prevent sudden changes in heart rate values ​​caused by interference, if the difference between the latest real-time heart rate and the previous output heart rate value is greater than 20, the output needs to be delayed by two measurements. During this period, the previous heart rate value is output first. In other words, if the sudden change in heart rate is greater than 20, three consecutive heart rate measurements need to show a change greater than 20 in the same direction than before the change before the significant change is output and displayed. If only one heart rate shows a change greater than 20, and the second heart rate returns to normal, the second result is output directly. If only two heart rate shows a change greater than 20, and the third heart rate returns to normal, the third result is output directly. This filters out some abnormal sudden changes.

[0096] The following steps are also included between steps S1 and S2:

[0097] Data from the phone's accelerometer is acquired to determine if there is any movement during the measurement process. If significant movement is detected, the user is prompted to complete the measurement while stationary.

[0098] Step S4 includes the following steps:

[0099] S4.1 Baseline filtering: The first two Pr gb data points are used as the baseline, and the baseline is subtracted from all collected data.

[0100] S4.2 Bandpass filtering: Perform bandpass filtering on the baseline filtered data.

[0101] Step S5 includes the following steps:

[0102] S5.1 Buffer the filtered data within T1 seconds and calculate the average amplitude difference F n (k)

[0103]

[0104] Where n is the current cached data sequence, N is the data length, k is the distance between two data points, and 0 is the distance between the two data points. <k<N-1;

[0105] k is the horizontal axis, F n (k) is the vertical axis. The position of the first trough of k from small to large is the number of sampling points between two heartbeats. The number of sampling points between two heartbeats divided by the sampling rate A1 is the period of the signal.

[0106] S5.2 Heart rate value HR=60*A1 / INTV, where INTV is the number of sampling points between two heartbeats.

[0107] The following steps are also included between steps S5.1 and S5.2:

[0108] Use quadratic spline interpolation to improve the accuracy of heart rate cycles.

[0109] Step S6 includes the following steps:

[0110] S6.1 Update the cached filtered data every T2 seconds, retain the latest N data points, and calculate the heart rate value;

[0111] S6.2 The obtained heart rate values ​​are placed into a queue of length M. When the data in the queue exceeds a threshold B, interval statistics begin, where 0 <B<M;

[0112] S6.3. Using K1 bpm as an interval, perform weighted statistics on the heart rate values ​​in the queue. When a heart rate value falls within an interval, the score of that interval is increased by C1, and the scores of the two adjacent intervals are increased by C2. Where 0 <C2<C1;

[0113] S6.4 Calculate the sum of the scores of two adjacent intervals and record the one with the largest score. If the largest scores are the same, take the one with the smaller score. If the difference between the scores of two adjacent heart rate intervals is greater than C3, take the middle value of the heart rate interval with the higher score as the center point. If the difference between the scores of two adjacent heart rate intervals is less than or equal to C3, take the center of the two heart rate intervals as the center point.

[0114] S6.5: Take the center point of the heart rate statistics ± K2 bpm as the effective interval, take all the heart rate values within this effective interval, and when the number of heart rate values is greater than D, determine and output the heart rate value and the confidence level.

[0115] If the latest E pen heart rate values all fall within this effective interval, and the maximum value - the minimum value < C4, then the confidence level is set to F1, and the heart rate value is the average value of these E pen data.

[0116] If the latest E pen heart rate values all fall within this effective interval, and the maximum value - the minimum value < C5, where C4 < C5, then the confidence level is set to F2, F2 < F1, and the heart rate value is the average value of these E pen data.

[0117] If among the latest E + 1 pen heart rate values, E pen all fall within this effective interval, and for the heart rate values that fall within this effective interval, the maximum value - the minimum value < C6, where C4 < C6, then the confidence level is set to F3, F3 < F2, and the heart rate value is the average value of these E pen data.

[0118] The higher the confidence level, the more reliable the output heart rate value.

[0119] When the difference between the latest real-time heart rate value and the previous heart rate value is greater than C7, delay the output by G pen heart rate values, and output the previous heart rate value during the delay period.

[0120] A heart rate measurement device based on a mobile phone camera applies the described heart rate measurement method.

[0121] The advantages of the present invention are as follows: A heart rate measurement method and device based on a mobile phone camera are proposed. The heart rate value calculated by this method has high reliability, and it can remind the user to complete the measurement according to the requirements by identifying abnormal situations.

[0122] Certainly, the present invention is not limited to the above embodiments. Those skilled in the art can make equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations and substitutions are all included within the scope defined by the claims of this application.

Claims

1. A heart rate measurement method based on a mobile phone camera, characterized in that, Including: S1. Call the interfaces on the mobile phone to control the camera and the flash, and make the flash in a constant-on state and turn on the continuous shooting or video shooting mode of the camera; S2. Obtain each frame of image and the sampling rate A1 returned by the camera, calculate the average values of the pixel points in the RGB three channels of the image respectively, and record them as Pr, Pg, and Pb, calculate the average value of Pr, Pg, and Pb and record it as Prgb; S3. Set the first threshold range H1, the second threshold range H2, and the third threshold range H3, and continuously judge whether Pr is within the first threshold range H1, whether Pg is within the second threshold range H2, and whether Pb is within the third threshold range H3. If all are met, enter step S4; Otherwise, enter step S1; S4. Filter the collected data; S5. Calculate the heartbeat cycle of the filtered data and convert it into a heart rate value; S6. Conduct interval statistics on the heart rate value, and output the heart rate value and confidence level after determining the heart rate center point; In step S6, it includes the following steps: S6.

1. Update the cached filtered data every T2 seconds, retain the latest N pieces of data, and calculate the heart rate value; S6.

2. Put the obtained heart rate value into a queue with a length of M. When the number of data in the queue is greater than the threshold B, start interval statistics, where 0 < B < M; S6.

3. Take K1 bpm as an interval, conduct weighted statistics on the heart rate values in the queue. When the heart rate value falls within an interval, the score of this interval + C1, and the scores of the adjacent two intervals + C2, where 0 < C2 < C1; S6.

4. Calculate the sum of the scores of two adjacent intervals and record the two adjacent intervals with the largest scores. If the maximum scores are the same, take the one with a smaller heart rate interval; if the difference between the scores of two adjacent heart rate intervals is greater than C3, take the middle value of the heart rate interval with a higher score as the center point; if the difference between the scores of two adjacent heart rate intervals ≤ C3, take the centers of the two heart rate intervals as the center point; S6.

5. Take the center point ± K2 bpm of the heart rate value statistics as the effective interval, take all the heart rate values in this effective interval, and determine and output the heart rate value and confidence level when the number of heart rate values is greater than D; If the latest E pieces of heart rate values all fall within this effective interval, and the maximum value - the minimum value < C4, then the confidence level is set to F1, and the heart rate value is the average value of these E pieces of data; If the latest E pieces of heart rate values all fall within this effective interval, and the maximum value - the minimum value < C5, where C4 < C5, then the confidence level is set to F2, F2 < F1, and the heart rate value is the average value of these E pieces of data; If E out of the latest E + 1 pieces of heart rate values all fall within this effective interval, and the maximum value - the minimum value of the heart rate values falling within this effective interval < C6, where C4 < C6, then the confidence level is set to F3, F3 < F2, and the heart rate value is the average value of these E pieces of data; The higher the confidence level, the more reliable the output heart rate value.

2. The heart rate measurement method based on a mobile phone camera according to claim 1, characterized in that, Between step S1 and S2, it also includes the following steps: Data from the phone's accelerometer is acquired to determine if there is any movement during the measurement process. If significant movement is detected, the user is prompted to complete the measurement while stationary.

3. The heart rate measurement method based on a mobile phone camera according to claim 1, characterized in that, Step S4 includes the following steps: S4.1 Baseline filtering: The average of the first two Prgb data collected is used as the baseline, and the baseline is subtracted from all collected data. S4.2 Bandpass filtering: Perform bandpass filtering on the baseline filtered data.

4. The heart rate measurement method based on a mobile phone camera according to claim 1, characterized in that, Step S5 includes the following steps: S5.1, cache filtered data within T1 seconds and calculate average amplitude difference F n (k) Where n is the current cached data sequence, N is the data length, k is the distance between two data points, and 0 is the distance between the two data points. <k<N-1; k is the horizontal axis, F n (k) is the vertical axis. The position of the first trough of k from small to large is the number of sampling points between two heartbeats. The number of sampling points between two heartbeats divided by the sampling rate A1 is the period of the signal. S5.2 Heart rate value HR=60*A1 / INTV, where INTV is the number of sampling points between two heartbeats.

5. The heart rate measurement method based on a mobile phone camera according to claim 4, characterized in that, The following steps are also included between steps S5.1 and S5.2: For the average amplitude difference F n (k) Use quadratic spline interpolation to improve the accuracy of the heartbeat cycle.

6. The heart rate measurement method based on a mobile phone camera according to claim 5, characterized in that: When the difference between the latest real-time heart rate value and the previous heart rate value is greater than C7, output the heart rate value after a delay of G times, and output the previous heart rate value during the delay period.

7. A heart rate measurement device based on a mobile phone camera, characterized in that: The heart rate measurement method according to any one of claims 1-6 is applied.

Citation Information

Patent Citations

  • Method for measuring human body heart rate on basis of mobile phone image

    CN103932693A

  • Method and device for measuring heart rate

    CN106725412A