Indoor environment health degree adjusting method and system based on machine vision
Technical Field
The invention relates to a method for judging the health degree of an indoor environment, in particular to a method for adjusting the health degree of the indoor environment based on machine vision. The method relates to the technical field of intelligent home furnishing.
Background
In recent years, people pay more and more attention to the comfort and health of living environments. According to survey statistics, more than 80% of the time of people spent indoors every day, and the indoor temperature has important influence on the health of people. Therefore, an appropriate indoor environment temperature is an important factor for judging the health of the indoor environment.
At present, when the indoor environment temperature is detected, a sensor detection mode is mostly adopted, and then the acquired numerical value is compared with the subjectively set numerical value to judge whether the environment is healthy. The environmental temperature requirements vary with each individual's constitution and age. Therefore, subjectively setting the numerical value cannot accurately judge whether the environment is healthy or not. Second, existing heart rate detection methods require contact with a person's body or wearing equipment. The prior art can be seen to lack a method for more conveniently and accurately judging the health degree of the indoor living environment through the problems.
Disclosure of Invention
In order to more conveniently and accurately judge the health degree of the indoor living environment, the invention provides an indoor environment health degree adjusting method and system based on machine vision.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides a machine vision-based indoor environment health degree adjusting method, which comprises the following steps of:
(1) collecting face data of a person, and analyzing periodic signals from the face data by applying independent vector analysis so as to detect a heart rate;
(2) preprocessing acquired heart rate data in a healthy environment to construct an environmental health degree language word model;
(3) and comparing the heart rate data collected in the actual environment with the data in the constructed environment health degree model, and judging whether the environment is healthy.
Preferably, the step (1) is as follows:
the method comprises the steps of shooting data of a plurality of skin areas on a face in real time by means of a high-definition camera, adopting a remote photoplethysmography heart rate monitoring method based on a combined blind source separation algorithm, and applying independent vectors to carry out combined analysis, so that heart rate data of a person are obtained.
Preferably, the specific steps of step (1) are as follows:
firstly, selecting a skin area for data acquisition; then calculating the spatial mean value of the RGB color of the collected skin data; secondly, applying a signal processing method to the calculated spatial mean value to obtain a component of each skin area containing heart rate information; thirdly, common signal components of different mixed signal groups are extracted by utilizing independent vector analysis; finally, a fast fourier transform is applied to the component in order to estimate the number of peaks Ns during the corresponding frequency or processing duration t(s). The heart rate in beats per minute will be calculated as 60 x Fs or Ns/T x 60.
Preferably, the specific steps of step (2) are as follows:
step 1: conversion of monitoring data into interval data
1) Statistical calculation of daily acquired data:
assuming that the data collected on day i are processed, the mean m of the samples is first calculatediSum sample standard deviation σiRespectively expressed as:
wherein n isiRepresents the total amount of data collected on day i, datai,jExpressed as the jth data collected on day i;
2) daily data preprocessing:
on the basis of the stage 1), for each datai,jJudging whether the following equation is satisfied:
|datai,j-mi|≤k*σi (3)
if the equation is satisfied, accepting; otherwise, the data are removed; k represents a constraint coefficient, and the general k value is 2; after this processing, the data for the i-th day will be left n "i(n”i≤ni) A plurality of;
3) statistical calculation of all remaining data over n days:
calculate the sample mean m and sample standard deviation σ of all remaining data over n days:
4) preprocessing data in n days: for each datai,jJudging whether the data meets the equation (3) or not, wherein the data is accepted, and if not, the data is rejected;
5) acquiring a daily interval:
from the data collected each day, the maximum and minimum values were selected to make up the daily interval, and the interval on day i was expressed as:
where I1, n, I denotes the amount of daily data left after the above-mentioned preprocessing stage, ciAnd diLeft and right endpoints representing the day interval of the ith day, respectively;
step 2: interval data preprocessing
1) Abnormal value processing: first to ciAnd diBox and Whisser tests were performed and L was calculatedi=ci-di(ii) a If the end point values of the interval satisfy the following equation:
ci∈[Qc(.25)-1.5IQRc,Qc(.75)+1.5IQRc]
di∈[Qd(.25)-1.5IQRd,Qd(.75)+1.5IQRd] (7)
Li∈[QL(.25)-1.5IQRL,QL(.75)+1.5IQRL]
the interval is reserved, otherwise, the interval is removed; where Q (.25) is referred to as the lower four-digit score, indicating that one-fourth of all observations are smaller than it; q (.75) is called the upper four-digit score, indicating that one-fourth of all observations are larger than it; IQR is called the interquartile range, which is the difference between the upper and lower quartile scores;
after the processing, reserving a data interval with m' less than or equal to n; calculation of ci,diAnd LiSample mean and standard deviation of (e.g., (m)c,σc),(md,σd),(mL,σL) Wherein i ═ 1.., m';
2) and (4) processing a tolerance value: if the endpoint values of the remaining m' data intervals satisfy the following equation:
ci∈[mc-kσc,mc+kσc]
di∈[md-kσd,md+kσd] (8)
Li∈[mL-kσL,mL+kσL]
the interval is reserved; otherwise, it will be kicked away. Wherein i is 1., m', k represents a constraint coefficient, and k takes a value of 2;
thereafter, m ≦ n data intervals are retained; recalculate ci,diAnd LiSample mean and standard deviation of (e.g., (m)c',σc'),(md',σd'),(mL',σL'), wherein i ═ 1,. m ";
3) and (3) rationality treatment: computing
ξ*={(mc'(σ'd)2-md'(σ'c)2)±σc'σd'[(mc'-md')2+2((σ'c)2-(σ'd)2)ln(σc'/σd')]1/2}/((σ'c)2-(σ'd)2) (9)
When m isc'≤ξ*≤md', this interval is to be reserved; otherwise, the interval is rejected;
the remaining n '(1. ltoreq. n'. ltoreq.n) data intervals are renumbered with 1,2i l,ti r],(i=1,2,...,n′);
And step 3: constructing environmental health degree language word model
Selecting two representative intervals from n '(n' is more than or equal to 1 and less than or equal to n) reserved intervals by applying a percentile method, and constructing an environmental health degree language word model;
left and right end points of section data assumed to be left are arranged in order
For a given q (q)<0.5), assuming 100q th and 100(1-q) th percentiles are represented as [ T ] respectivelyq,T1-q]The interval contains data points in the ratio of (1-2 q). For the left endpoint, its 100q and 100(1-q) th percentiles were calculated as
Tq L=tl [n'*q]+rem(n'*q,1)(tl [n'*q+1]-tl [n'*q]) (10)
Wherein
And
100q th and 100(1-q) th percentiles, respectively, representing the left endpoints.]The integrated part of the corresponding value is represented using a floor function, rem (·, 1) the remainder of the corresponding value after dividing by 1 is calculated using a mod function. Likewise, for the right endpoint, its 100q and 100(1-q) th percentiles may be calculated and expressed as the right endpoint, respectively
And
Tq R=tr [n'*q]+rem(n'*q,1)(tr [n'*q+1]-tr [n'*q]) (12)
the left and right representative intervals of the environmental health degree language word model are set as
And constructing an environment health degree language word model.
Preferably, the facial data in the actual environment are collected in the step (3), then a heart rate recognition module is called, the facial data are subjected to joint analysis by using an ultra-perception heart rate monitoring method based on a joint blind source separation algorithm to obtain heart rate data in the environment, and then the data are compared with an environment health degree language word model to judge whether the environment temperature is higher or lower, so that the air conditioner can make corresponding actions.
Preferably, the specific judgment rule in step (3) is as follows:
let the monitored heart rate value of the actual environment be x
(1) x is less than LL, the ambient temperature is very low, and the set temperature of the air conditioner is increased to RR value;
(2) when x is LL, the ambient temperature is lower, and the set temperature of the air conditioner is increased by an RL value;
(3) LL < x < LR, comfortable ambient temperature and 1-degree temperature rise of the air conditioner;
(4) x is more than or equal to LR and less than or equal to RL, the ambient temperature is comfortable, and the set temperature of the air conditioner is not changed;
(5) RL < x < RR, the ambient temperature is more comfortable, and the set temperature of the air conditioner is reduced by 1 DEG;
(6) when RR is x, the ambient temperature is higher, and the set temperature of the air conditioner is reduced to an LR value;
(7) RR is less than x, the ambient temperature is very high, and the set temperature of the air conditioner is reduced to LL value.
The invention also provides an indoor environment health degree adjusting system based on machine vision, which is used for executing the steps of the indoor environment health degree adjusting method based on machine vision, and comprises the following steps:
a heart rate identification module for performing the method of step (1);
an environmental health modeling module for performing the method of step (2);
and (4) an environmental health degree judging and adjusting module which is used for executing the method in the step (3).
The technical scheme of the invention has the following beneficial effects:
1. the heart rate monitoring adopts an ultra-sensing method, so that data collection is quicker and more convenient, and the intelligence of the home is improved.
2. The remote photoplethysmography heart rate monitoring method based on the combined blind source separation algorithm analyzes multiple facial subregions, can overcome the influence of illumination change and movement, and improves the accuracy of heart rate monitoring numerical values.
3. The 'feeling' of a person is quantified through the heart rate, the interference of subjective consciousness is eliminated, the heart rate is stable, and the judgment result is more accurate.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a diagram of an environmental health language word model of the present invention;
fig. 2 is a flow chart of the present invention for determining and adjusting the health of the indoor environment.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In order to more conveniently and accurately judge the health degree of the indoor living environment, a method and a system for regulating the health degree of the indoor environment based on machine vision are provided. The method comprises the steps of collecting facial data of people living in a healthy environment within a period of time by using a high-definition camera, analyzing the heart rate data from the facial data by using a remote photoplethysmography heart rate monitoring method based on a joint blind source separation algorithm, preprocessing the data, converting the collected data into interval data, processing the interval data, and constructing an environment health degree language word model on the basis. And then, acquiring heart rate data of people in an actual environment, and comparing the heart rate data with data in the environmental health degree language word model, so as to judge whether the environmental temperature is higher or lower, and further give out an adjusting strategy.
The invention is composed of a heart rate identification module, an environmental health degree modeling module and an environmental health degree judging and adjusting module. The heart rate identification module mainly utilizes a high-definition camera to collect face data of a person, and applies independent vector analysis to separate out periodic signals from the face data, so that the heart rate is detected. The environment health degree modeling module calls a heart rate recognition module to recognize the heart rate in the health environment, and then preprocesses heart rate data to construct an environment health degree language word model. The environment health degree judging and adjusting module collects facial data in an actual environment, calls the heart rate identification module to obtain heart rate data, compares the heart rate data with data in the constructed environment health degree model, judges whether the environment is healthy or not, and gives a proper adjusting strategy.
1. Heart rate identification module
The module functions to extract heart rate data of the person from the face data of the person. The method comprises the steps of shooting data of a plurality of skin areas on a face in real time by means of a high-definition camera, adopting a remote photoplethysmography heart rate monitoring method based on a combined blind source separation algorithm, and applying independent vectors to carry out combined analysis, so that heart rate data of a person are obtained.
Firstly, selecting a skin area for data acquisition; then calculating the spatial mean value of the RGB color of the collected skin data; secondly, applying a signal processing method to the calculated spatial mean value to obtain a component of each skin area containing heart rate information; thirdly, common signal components of different mixed signal groups are extracted by utilizing independent vector analysis; finally, a fast fourier transform is applied to the component in order to estimate the corresponding frequency (or number of peaks Ns during the processing duration t (s)). The heart rate in beats per minute will be calculated as 60 × Fs (or Ns/T × 60).
2. Environmental health degree modeling module
Utilize high definition digtal camera to gather people's facial data under healthy environment, call rhythm of the heart identification module, obtain the rhythm of the heart data that corresponds constantly, need carry out the preliminary treatment to the rhythm of the heart data that come to gather again. Then converting the daily heart rate data into a heart rate interval, and then preprocessing the interval data by three steps of singular value, tolerance value and reasonable value. And constructing the processed interval data into an environmental health degree language word model by using a percentile method. The method comprises the following specific steps:
1. conversion of monitoring data into interval data
(1) Statistical calculation of daily acquired data:
assuming that the data collected on day i are processed, the mean m of the samples is first calculatediSum sample standard deviation σiRespectively expressed as:
wherein n isiRepresents the total amount of data collected on day i, datai,jExpressed as the jth data collected on day i;
(2) daily data preprocessing:
on the basis of the stage (1), for each datai,jJudging whether the following equation is satisfied:
|datai,j-mi|≤k*σi (3)
if the equation is satisfied, accepting; otherwise, the data are removed; k is a constraint coefficient, and the general k value is 2; after this processing, the data for the i-th day will be left n "i(n”i≤ni) A plurality of;
(3) statistical calculation of all remaining data over n days:
calculate the sample mean m and sample standard deviation σ of all remaining data over n days:
(4) preprocessing data in n days: for each datai,jJudging whether the data meets the equation (3) or not, wherein the data is accepted, and if not, the data is rejected;
(5) acquiring a daily interval:
from the data collected each day, the maximum and minimum values were selected to make up the daily interval, and the interval on day i was expressed as:
where I1, n, I denotes the amount of daily data left after the above-mentioned preprocessing stage, ciAnd diLeft and right endpoints representing the day interval of the ith day, respectively;
2. interval data preprocessing
(1) Abnormal value processing: first to ciAnd diBox and Whisser tests were performed and L was calculatedi=ci-di(ii) a If the end point values of the interval satisfy the following equation:
ci∈[Qc(.25)-1.5IQRc,Qc(.75)+1.5IQRc]
di∈[Qd(.25)-1.5IQRd,Qd(.75)+1.5IQRd] (7)
Li∈[QL(.25)-1.5IQRL,QL(.75)+1.5IQRL]
the interval is reserved, otherwise, the interval is removed; where Q (.25) is referred to as the lower four-digit score, indicating that one-fourth of all observations are smaller than it; q (.75) is called the upper four-digit score, indicating that one-fourth of all observations are larger than it; IQR is called the interquartile range, which is the difference between the upper and lower quartile scores;
after the processing, reserving a data interval with m' less than or equal to n; calculation of ci,diAnd LiSample mean and standard deviation of (e.g., (m)c,σc),(md,σd),(mL,σL) Wherein i ═ 1.., m';
(2) and (4) processing a tolerance value: if the endpoint values of the remaining m' data intervals satisfy the following equation:
ci∈[mc-kσc,mc+kσc]
di∈[md-kσd,md+kσd] (8)
Li∈[mL-kσL,mL+kσL]
the interval is reserved; otherwise, the utility model is kicked; wherein i is 1., m', k represents a constraint coefficient, and k takes a value of 2;
thereafter, m ≦ n data intervals are retained; recalculate ci,diAnd LiSample mean and standard deviation of (e.g., (m)c',σc'),(md',σd'),(mL',σL'), wherein i ═ 1,. m ";
3) and (3) rationality treatment: computing
ξ*={(mc'(σ'd)2-md'(σ'c)2)±σc'σd'[(mc'-md')2+2((σ'c)2-(σ'd)2)ln(σc'/σd')]1/2}/((σ'c)2-(σ'd)2) (9)
When m isc'≤ξ*≤md', this interval is to be reserved; otherwise, the interval is rejected;
the remaining n '(1. ltoreq. n'. ltoreq.n) data intervals are renumbered with 1,2i l,ti r],(i=1,2,...,n′);
3. Constructing environmental health degree language word model
Selecting two representative intervals from n '(n' is more than or equal to 1 and less than or equal to n) reserved intervals by applying a percentile method, and constructing an environmental health degree language word model;
left and right end points of section data assumed to be left are arranged in order
For a given q (q)<0.5), assuming 100q th and 100(1-q) th percentiles are represented as [ T ] respectivelyq,T1-q]The interval contains data points in the ratio of (1-2 q); for the left endpoint, its 100q and 100(1-q) th percentiles were calculated as
Tq L=tl [n'*q]+rem(n'*q,1)(tl [n'*q+1]-tl [n'*q]) (10)
Wherein
And
100q th and 100(1-q) th percentiles, respectively, representing the left endpoints.]The integrated part of the corresponding value is represented using a floor function, rem (·, 1) the remainder of the corresponding value after dividing by 1 is calculated using a mod function. Likewise, for the right endpoint, its 100q and 100(1-q) th percentiles may be calculated and expressed as the right endpoint, respectively
And
Tq R=tr [n'*q]+rem(n'*q,1)(tr [n'*q+1]-tr [n'*q]) (12)
the left and right representative intervals of the environmental health degree language word model are set as
The environmental health language word model as shown in fig. 1 is constructed.
3. Environment health degree judging module
The method comprises the steps of collecting facial data in an actual environment, calling a heart rate recognition module, carrying out combined analysis on the facial data by using an ultra-perception heart rate monitoring method based on a combined blind source separation algorithm to obtain heart rate data in the environment, comparing the heart rate data with an environment health degree language word model (shown in figure 1), and judging whether the environment temperature is higher or lower so as to enable an air conditioner to make corresponding actions. The specific judgment rule is as follows: let the monitored heart rate value of the actual environment be x
(1) x is less than LL, the ambient temperature is very low, and the set temperature of the air conditioner is increased to RR value;
(2) when x is LL, the ambient temperature is lower, and the set temperature of the air conditioner is increased by an RL value;
(3) LL < x < LR, comfortable ambient temperature and 1-degree temperature rise of the air conditioner;
(4) x is more than or equal to LR and less than or equal to RL, the ambient temperature is comfortable, and the set temperature of the air conditioner is not changed;
(5) RL < x < RR, the ambient temperature is more comfortable, and the set temperature of the air conditioner is reduced by 1 DEG;
(6) when RR is x, the ambient temperature is higher, and the set temperature of the air conditioner is reduced to an LR value;
(7) RR is less than x, the ambient temperature is very high, and the set temperature of the air conditioner is reduced to LL value.
The overall steps of the present invention are shown in figure 2.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.