WO2022083130A1 - Temperature measurement method and apparatus, electronic device, and storage medium - Google Patents

Temperature measurement method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022083130A1
WO2022083130A1 PCT/CN2021/098352 CN2021098352W WO2022083130A1 WO 2022083130 A1 WO2022083130 A1 WO 2022083130A1 CN 2021098352 W CN2021098352 W CN 2021098352W WO 2022083130 A1 WO2022083130 A1 WO 2022083130A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
area
face frame
temperature
pixel
Prior art date
Application number
PCT/CN2021/098352
Other languages
French (fr)
Chinese (zh)
Inventor
高哲峰
彭恩厚
李若岱
刘杰
左冬冬
Original Assignee
深圳市商汤科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市商汤科技有限公司 filed Critical 深圳市商汤科技有限公司
Publication of WO2022083130A1 publication Critical patent/WO2022083130A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/166Detection; Localisation; Normalisation using acquisition arrangements
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J5/0022Radiation pyrometry, e.g. infrared or optical thermometry for sensing the radiation of moving bodies
    • G01J5/0025Living bodies
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J5/48Thermography; Techniques using wholly visual means
    • G01J5/485Temperature profile
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J5/00Radiation pyrometry, e.g. infrared or optical thermometry
    • G01J2005/0077Imaging

Definitions

  • the image to be processed may be any image.
  • the image to be processed can contain a human face or a human face and an object.
  • the embodiments of the present disclosure do not limit the content included in the image to be processed.
  • an RGB camera and an infrared imaging camera are installed on the temperature measuring device. Place a square card about 1 meter in front of the temperature measuring device, and take two images first through the RGB camera and the infrared imaging camera. Then, get the RGB image of the square card through the RGB camera. An infrared imaging image of the square card is obtained by an infrared imaging camera.
  • the temperature measuring device can determine the temperature corresponding to any pixel point in the temperature thermogram.
  • the temperature measuring device can obtain the temperature of the temperature measurement object corresponding to the first face area based on the temperature of the pixel points included in the second face area.
  • the position of the first face region needs to be determined first.
  • the position of the first face region is determined by the coordinates of the four corners of the face frame including the first face region.
  • the face detection obtains the first face area, it can also obtain the face frame including the first face area. Therefore, the temperature measurement device performs the following steps in the process of executing step 102:
  • a face frame whose resolution of the pixel area included in the at least one first face frame is greater than a resolution threshold is selected to obtain the second face frame.
  • the face pixels for face detection are at least 60 ⁇ 60 or more. That is, the resolution threshold is at least 60x60.
  • the resolution threshold is at least set to be greater than or equal to 60 ⁇ 60, but the value of the resolution threshold is not limited in this embodiment of the present disclosure.
  • a second face frame is obtained, and the first face frame is The two face frames are used as face frames of the temperature measurement object in the above image to be processed.
  • the overlap ratio between any two face frames in at least one first face frame is less than or equal to the overlap ratio threshold, that is, there is a distance between each face frame in the at least one first face frame, and That is, the area of the overlapping part of the pixel area contained in any two face frames is 0, that is to say, the overlap rate between any two face frames is 0%. Then, the pixel area included in any one face frame in the at least one first face frame can be used as the above-mentioned first face area. Therefore, set the overlap rate threshold to 0.
  • the overlap ratio between face frame b and face frame c is less than or equal to the overlap ratio threshold, that is, the pixel area contained in face frame b does not overlap with the pixel area contained in face frame c. . Therefore, the pixel area included in the face frame b can be used as the first face area, and the pixel area included in the face frame c can also be used as the first face area.
  • the overlap ratio between the face frame b and the face frame c is greater than the overlap ratio threshold, that is, the pixel area included in the face frame b and the pixel area included in the face frame c overlap. Therefore, the pixel area included in the face frame b cannot be used as the first face area, and the pixel area included in the face frame c cannot be used as the first face area either.
  • a possible situation is that the overlap ratio between the third face frame and the fourth face frame is greater than the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap ratio threshold,
  • the overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap. There is no overlapping part of the area, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, and the pixel area included in the fourth face frame cannot be used as the first face area, only the pixel area included in the fifth face frame. Can be used as the first face area.
  • the pixel area included in the third face frame cannot be used as the first face area
  • the pixel area included in the fourth face frame cannot be used as the first face area
  • the pixel area included in the fifth face frame cannot be used as the first face area. as the first face area.
  • the pixel area included in the third face frame can be used as the first face area
  • the pixel area included in the fourth face frame can be used as the first face area
  • the pixel area included in the fifth face frame can also be used as the first face area. as the first face area.
  • the resolution of the pixel region contained in the above at least one first face frame is greater than the number of face frames with a resolution threshold greater than 1, the resolution is greater than the resolution threshold.
  • the resolution of the pixel area included in at least one first face frame in the above-mentioned to-be-processed image is greater than the number of face frames with a resolution threshold greater than 1, and the resolution of the pixel area included in the at least one first face frame is greater than 1.
  • the resolution of the pixel point region included in the face frame is greater than the resolution threshold, and the pixel point region included in any face frame in the face frame is used as the first face region. That is to say, in any face frame in which the resolution of the pixel area contained in the at least one first face frame is greater than the resolution threshold, there is at least one face frame different from it, so that these two When the overlap ratio between the face frames is greater than the overlap ratio threshold, the pixels included in any face frame in the face frame whose resolution of the pixel area included in at least one first face frame is greater than the resolution threshold cannot be used.
  • the point area is used as the above-mentioned first face area.
  • At least one of the first face frames has three face frames with pixel area resolutions greater than the resolution threshold, and the three face frames are set as the third face frame, the third face frame Four face frames and fifth face frames.
  • the overlap rate between the third face frame and the fourth face frame is greater than the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap ratio threshold,
  • the overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold.
  • the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap.
  • the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, and the pixel area included in the fourth face frame cannot be used as the first face area, only the pixel area included in the fifth face frame. Can be used as the first face area.
  • the overlap rate between the third face frame and the fourth face frame is greater than the overlap rate threshold
  • the overlap rate between the third face frame and the fifth face frame is greater than the overlap rate threshold
  • the third face frame is greater than the overlap rate threshold.
  • the overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap.
  • the area has an overlapping part
  • the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part.
  • the pixel area included in the third face frame cannot be used as the first face area
  • the pixel area included in the fourth face frame cannot be used as the first face area
  • the pixel area included in the fifth face frame cannot be used as the first face area. as the first face area.
  • the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold
  • the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap rate threshold
  • the overlap rate between the fourth face frame and the fifth face frame is less than or equal to the overlap rate threshold.
  • the sides of the two face frames are both parallel to the x-axis or the y-axis, that is, to the pixel coordinate system of the above-mentioned image to be processed.
  • the face frame aligned with the horizontal or vertical axis. It is assumed that there are two face frames in the above image to be processed: A face frame and B face frame.
  • the overlap rate between the B face frame and the A face frame is less than or equal to the overlap ratio threshold: in the first case, the B face frame is above the A face frame; in the second case, The B face frame is below the A face frame; in the third case, the B face frame is to the left of the A face frame; in the fourth case, the B face frame is to the right of the A face frame.
  • the ordinate of p1 is smaller than the ordinate of p4; in the case of the B face frame below the A face frame, the ordinate of p3 is smaller than the ordinate of p2;
  • the abscissa of p1 is greater than the abscissa of p4; when the B face frame is to the right of the A face frame, the abscissa of p2 is smaller than that of p3. abscissa.
  • the overlap rate between the A face frame and the B face frame is less than or equal to the overlap rate threshold. Then, both the pixel point area included in the face frame A and the pixel point area included in the face frame B in the above image to be processed can be used as the first face area.
  • the pixel area included in the third face frame and the fourth face frame can be used as the first face area, but it involves the scene of queuing for body temperature detection such as security check. Generally speaking, the closer you are to the temperature measuring device, the larger the corresponding face area will be. . Therefore, the pixel point area contained in the larger face frame in the third face frame and the fourth face frame is taken as the first face area, and the temperature measuring device performs the following steps in the process of executing step 23:
  • Step 24 taking the pixel area contained in the face frame with the largest size measure in the above-mentioned third face frame and the above-mentioned fourth face frame as the above-mentioned first face area; the size measurement of the above-mentioned third face frame is the above-mentioned No.
  • the front person in the queue shows a larger corresponding face area on the display interface of the temperature measurement device. Therefore, when there are multiple face frames in the image to be processed, the pixel area contained in the largest face frame in the multiple face frames is selected as the first face area. The size of each face frame is measured as the maximum side length of the face frame. Therefore, the maximum value of the side length of each face frame in the multiple face frames in the above image to be processed is obtained first, and then the face frame with the largest size measurement is selected.
  • the two face frames there are two face frames in at least one first face frame, so that the overlap ratio between the two face frames is less than or equal to the overlap ratio threshold, and the two face frames are set as the third person.
  • Face frame and fourth person face frame When the maximum side length of the third face frame is greater than the maximum side length of the fourth face frame, the pixel area included in the third face frame is used as the first face area.
  • the length of the third face frame is 40 pixels and the width is 45 pixels. Then the size measurement of the third face frame is 45 pixels.
  • the fourth face frame has a length of 36 pixels and a width of 32 pixels. Then the size measurement of the fourth face frame is 36 pixels.
  • the size measure of the third face frame is 45 pixels
  • the size measure of the fourth face frame is 36 pixels.
  • the size measure of the third face frame is greater than the size measure of the fourth face frame, so the pixel area included in the third face frame is used as the first face area.
  • the resolution of the pixel area contained in two face frames in at least one first face frame is greater than the resolution threshold, and the overlap ratio between the two face frames is less than or equal to Overlap rate threshold, set the two face frames as the third face frame and the fourth face frame.
  • the maximum side length of the third face frame is greater than the maximum side length of the fourth face frame
  • the pixel area included in the third face frame is used as the first face area.
  • the length of the third face frame is 40 pixels and the width is 45 pixels.
  • the size measurement of the third face frame is 45 pixels.
  • the fourth face frame has a length of 36 pixels and a width of 32 pixels. Then the size measurement of the fourth face frame is 36 pixels.
  • the size measure of the third face frame is 45 pixels
  • the size measure of the fourth face frame is 36 pixels.
  • the size measure of the third face frame is greater than the size measure of the fourth face frame, so the pixel area included in the third face frame is used as the first face area.
  • the embodiment of the present disclosure only provides an implementation manner of selecting the largest face frame from two face frames, but this method is also applicable to selecting the largest face frame from the number of face frames greater than 2.
  • the present disclosure does not limit the number of face frames.
  • the temperature measuring device performs the following steps in the process of performing step 103:
  • the coordinates of the four corners of the face frame of the temperature measurement object in the image to be processed include the coordinates of the first corner, and according to the homography matrix and the coordinates of the four corners, we obtain The coordinates of the corresponding four pixel points in the temperature heat map.
  • the homography matrix obtained by performing square card calibration on each temperature measuring device is a 3x3 matrix. Assume that the coordinates of the four corners of the face frame are the coordinates of the first corner (a1, b1), the coordinates of the second corner (a2, b2), the coordinates of the third corner (a3, b3), and the coordinates of the fourth corner.
  • the coordinates of the four pixel points obtained are the first coordinates (x1, y1), the second coordinates (x2, y2), and the third coordinates. (x3, y3), the fourth coordinate (x4, y4).
  • the process of obtaining the first coordinates (x1, y1) is similar to the process of obtaining the first coordinates (x1, y1) through the first corner coordinates (a1, b1) and the homography matrix H. Then, through the second corner coordinates (a2, b2) and the homography matrix H, the second coordinates (x2, y2) can be obtained; through the third corner coordinates (a3, b3) and the homography matrix H, we can obtain The third coordinates (x3, y3); the fourth coordinates (x4, y4) can be obtained through the fourth corner coordinates (a4, b4) and the homography matrix H.
  • the above four pixel points are points on the temperature heat map, and a quadrilateral area can be obtained by using these four pixel points as the four vertices of a quadrilateral.
  • Each pixel in the temperature heat map carries the temperature information of the corresponding pixel.
  • the temperature heat map is collected by an infrared thermal imaging device on the temperature measuring device. The temperature measuring device obtains a quadrilateral area on the temperature heat map, and uses the quadrilateral area as the second face area, that is, the pixel point area corresponding to the first face area.
  • the temperature measuring device performs the following steps in the process of performing step 32:
  • intersection point of the diagonal lines of the quadrilateral area take the distance between the first point and the intersection point as the first distance; the first point is the pixel point closest to the intersection point among the four pixel points; the intersection point is The center of the circle and the above-mentioned first distance are the radius, and the first area is constructed; the intersection of the above-mentioned first area and the above-mentioned quadrilateral area is determined to obtain the second area;
  • the coordinates of the four pixels in the temperature heat map are obtained through the homography matrix and the coordinates of the four corners of the face frame of the RGB image.
  • the quadrilateral area determined by four pixels in the temperature heat map if the quadrilateral area is directly used as the second face area, the pixels in the second face area may exist other than those corresponding to the first face area. Pixels corresponding to other areas will cause a decrease in the accuracy of the temperature measurement results of the measurement object. It should be understood that the embodiment of the present disclosure involves a single-person short-range temperature measurement, so the middle part of the quadrilateral area may be a part of the first face area.
  • the pixel corresponding to the intersection of the diagonal lines of the quadrilateral area may be a pixel corresponding to the first face area .
  • the first area is an area with the intersection as the center and the first distance as the radius.
  • the pixel area contained in the first area may be larger than the pixel area contained in the quadrilateral. Therefore, a second area is selected from the first area, and the second area is an overlapping area of the pixel point area included in the first area and the quadrilateral area.
  • the second area constructed is the area of the middle part of the quadrangular area.
  • the pixels corresponding to the intersection points are used as the second face region.
  • the pixel point area included in the largest inscribed circle of the second area or the pixel point area included in the largest inscribed rectangle is used as the second face area.
  • the pixel point area included in the largest inscribed circle with the intersection as the center in the second area is used as the second face area.
  • the temperature measuring device performs the following steps in the process of performing step 32:
  • the above-mentioned maximum inscribed area is a rectangular area or a circular area including the above-mentioned intersection point;
  • the above-mentioned largest inscribed area is used as the above-mentioned second face area;
  • the coordinates of the four pixels in the temperature heat map can be obtained through the homography matrix and the coordinates of the four corners of the face frame of the RGB image.
  • the area or the largest inscribed circular area can contain the pixel area corresponding to the first face area in the temperature heat map.
  • the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Calculate the distances from the intersection point E to AB, BD, CD, and AC, respectively. Let the edge closest to the intersection point be AB, and record the distance between AB and the intersection point E as the second distance. Taking the above-mentioned intersection as the center of the circle and the second distance as the radius, the pixel area contained in the circle is the largest inscribed area.
  • the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E.
  • the four sides of the quadrilateral area are AB, BD, CD, and AC. Find a point A* on AB so that A*E is perpendicular to AB; find a point B* on BD so that B*E is perpendicular to BD; find a point C* on CD so that C*E is perpendicular to CD; find a point on AC D*, such that D*E is perpendicular to AC.
  • the distance between point D* and point B* is taken as the third distance
  • the distance between point A* and point C* is taken as the fourth distance.
  • Compare the size of the third distance and the fourth distance assuming that the third distance is smaller than the fourth distance, take the midpoint of the connection line D*B* corresponding to the third distance as F, and take half of the third distance as the fifth distance. Taking the midpoint F as the center of the circle and the fifth distance as the radius, the pixel area contained in the circle is the largest inscribed area.
  • the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E.
  • the four sides of the quadrilateral area are AB, BD, CD, and AC. Find a point A* on AB so that A*E is perpendicular to AB; find a point B* on BD so that B*E is perpendicular to BD; find a point C* on CD so that C*E is perpendicular to CD; find a point on AC D*, such that D*E is perpendicular to AC.
  • the distance between point D* and point B* is taken as the third distance
  • the distance between point A* and point C* is taken as the fourth distance.
  • the four pixels of the quadrilateral area are set as A, B, C, and D. Then the four sides of the quadrilateral area are AB, BD, CD, and AC.
  • AB is the shortest of the four sides of the quadrilateral area. Then, find a point H on CD so that HA is perpendicular to AB; find a point I on CD so that IB is perpendicular to AB. Then find a little J on BI so that HJ is perpendicular to BI. Because the quadrilateral area enclosed by the four pixels A, B, I, and H has three right angles, the quadrilateral ABIH is a rectangle. The pixel area contained in the rectangle ABIH is the largest inscribed area.
  • the four pixel points of the quadrilateral region are set as A, B, C, and D, and the intersection point is set as E.
  • the lengths of EA, EB, EC and ED are the shortest. Find a point K on BE so that the length of EK equals the length of EA; find a point L on DE so that the length of EL equals the length of EA; find a point M on CE so that the length of EM equals the length of EA.
  • E is the midpoint of the line segment KM
  • point E is also the midpoint of the line segment AL.
  • the quadrilateral AKLM is a rectangle.
  • the pixel area contained in the rectangle AKLM is the largest inscribed area.
  • the four pixels of the quadrilateral area are set as A, B, C, and D. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Take the midpoint of AB as N; take the midpoint of BD as O; take the midpoint of CD as P; take the midpoint of AC as R. Because the quadrilateral enclosed by the midpoints of any quadrilateral is a parallelogram. That is, the quadrilateral NOPR is a parallelogram. Among them, PN and OR are the two diagonals corresponding to the parallelogram NOPR, and the intersection of the two diagonals is S.
  • PN is taken as the diagonal of the rectangular area, where the length of NS is equal to the length of SP.
  • PN is taken as the diagonal of the rectangular area, where the length of NS is equal to the length of SP.
  • T on SO so that the length of TS is equal to the length of NS;
  • the quadrilateral NPTU is a rectangle.
  • the pixel area contained in the rectangular NPTU is the largest inscribed area.
  • the temperature measuring device performs the following steps in the process of determining the maximum inscribed area of the above quadrilateral area:
  • the four pixel points are set as A, B, C, and D, respectively.
  • the coordinates of A are (X1, Y1); the coordinates of B are (X2, Y2); the coordinates of C are (X3, Y3); the coordinates of D are (X4, Y4).
  • X1>X2>X3>X4 then the first abscissa is X2, and the second abscissa is X3.
  • the first ordinate is Y2, and the second ordinate is Y3.
  • the coordinates of the second point are (X2, Y2), the coordinates of the third point are (X2, Y3), the coordinates of the fourth point are (X3, Y2), and the coordinates of the fifth point are (X3, Y3).
  • the quadrilateral area obtained by sequentially connecting the second point, the third point, the fourth point and the fifth point is a rectangular area.
  • the rectangular area obtained above be the above-mentioned maximum inscribed area.
  • the temperature measurement device uses the temperature of the forehead region of the first face region as the temperature of the temperature measurement object, and the temperature measurement device executes in the process of performing step 104 The following steps:
  • Step 41 Perform forehead detection on the above-mentioned first face area, and obtain the forehead detection result of the above-mentioned first face area;
  • performing forehead detection on the first face area, and obtaining a detection result includes: the forehead of the person in the first face area is in a blocked state or the forehead of the person in the first face area is in the unblocked state. occlusion state.
  • the temperature measurement device performs a first feature extraction process on the first face region to obtain first feature data, wherein the first feature data carries whether the forehead of the person in the first face region is blocked status information.
  • the temperature measuring device obtains the detection result based on the first characteristic data obtained by the forehead detection.
  • the embodiments of the present disclosure do not limit the manner used for forehead detection.
  • the temperature measuring device is placed outdoors and may be exposed to direct sunlight. And because the third face area may contain pixel area corresponding to the direct sun area. If the temperature of the pixel point corresponding to the direct sunlight area and the temperature of the actual face area are averaged as the temperature of the temperature measurement object in the above image to be processed, there will be a relatively large error.
  • the temperature of direct sunlight is about 50 degrees, and the temperature that the human body can tolerate is generally below 45 degrees. Therefore, read the temperature of each pixel in the pixel area of the third face area, exclude the pixels whose temperature is higher than 45 degrees, and average the temperature of the pixels whose temperature is lower than 45 degrees as the above-mentioned pending processing The temperature of the thermometric object in the image.
  • the average value of the temperature of a part of the pixel points included in the third face area may be used as the temperature of the temperature measurement object, or the temperature of a part of the pixel points included in the third face area may be used.
  • the highest value of the temperature is used as the temperature of the temperature measurement object, which is not limited in the embodiment of the present disclosure.
  • an acquisition part 11 configured to acquire an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image;
  • the detection part 12 is configured to perform face detection on the to-be-processed image to obtain a first face area
  • the first processing part 13 is configured to determine the pixel area corresponding to the first face area from the temperature heat map based on the homography matrix to obtain a second face area;
  • the second processing part 14 is configured to determine the temperature of the temperature measurement object corresponding to the first face area based on the temperature of the pixels included in the second face frame.
  • the first processing part 13 is further configured to:
  • the second face area is determined based on the quadrilateral area determined by the four pixel points.
  • the detection part 12 is further configured to:
  • the pixel area included in the second face frame in the at least one first face frame is used as the first face area; the resolution of the pixel area included in the second face frame is greater than the resolution threshold face frame.
  • the number of the first face frames is greater than 1, and the at least one first face frame includes a third face frame and a fourth face frame;
  • the detection part 12 is also configured to:
  • any one of the third face frame and the fourth face frame is The pixel area included in the face frame is used as the first face area.
  • the pixel area contained in the face frame with the largest size measure in the third face frame and the fourth face frame is taken as the first face area;
  • the size measure of the third face frame is The maximum value of the side length of the third face frame;
  • the size measurement of the fourth face frame is the maximum value of the side length of the fourth face frame.
  • the second processing part 14 is further configured to:
  • the temperature measurement is obtained based on the temperature of the pixels included in the third face area
  • the temperature of the object; the third face region is the region corresponding to the forehead region in the second face region.
  • the first processing part 13 is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; take the distance between the first point and the intersection as the first distance; The first point is the pixel point closest to the intersection point among the four pixel points; taking the intersection point as the center of the circle and the first distance as the radius, a first area is constructed; The intersection of the quadrilateral areas is obtained to obtain a second area; the area including the intersection is selected from the second area as the second face area.
  • the first processing part 13 is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; determine the maximum inscribed area of the quadrilateral area; the maximum inscribed area is a rectangular area or a circular area including the intersection point; the largest inscribed area is taken as the second face area.
  • the first processing part 13 is further configured to: select the second largest abscissa from the abscissas of the four pixel points to obtain the first abscissa, and obtain the first abscissa from the abscissas of the four pixels. From the abscissa of the pixel point, select the third largest abscissa to obtain the second abscissa, select the second largest ordinate from the ordinate of the four pixel points to obtain the first ordinate, and obtain the first ordinate from the four pixel points.
  • the functions or included parts of the apparatus may be configured to execute the methods described in the above method embodiments, and for implementation, reference may be made to the descriptions in the above method embodiments, for the sake of brevity , which will not be repeated here.
  • FIG. 3 is a schematic diagram of a hardware structure of a temperature measuring device according to an embodiment of the present disclosure.
  • the temperature measuring device 2 includes a processor 21 , a memory 22 , an input device 23 , and an output device 24 .
  • the processor 21, the memory 22, the input device 23, and the output device 24 are coupled through a connector, and the connector includes various types of interfaces, transmission lines, or buses, etc., which are not limited in this embodiment of the present disclosure. It should be understood that, in various embodiments of the present disclosure, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, and buses.
  • the processor 21 may be one or more graphics processing units (graphics processing units, GPUs).
  • the GPU may be a single-core GPU or a multi-core GPU.
  • the processor 21 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses.
  • the processor may also be another type of processor, etc., which is not limited in this embodiment of the present disclosure.
  • the memory 22 can not only store relevant instructions, but also store relevant data.
  • the memory 22 can store the image to be processed and the temperature heat map obtained through the input device 23 , or the memory 22
  • the temperature of the temperature measurement object obtained through the processor 21 and the like may also be stored, and the data stored in the memory is not limited in this embodiment of the present disclosure.
  • FIG. 3 only shows a simplified design of the temperature measuring device.
  • the temperature measurement device may also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all temperature measurement devices that can implement the embodiments of the present disclosure are included in this disclosure. within the scope of the disclosed embodiments.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the parts is only a logical function division, and there may be other division methods in the actual implementation process, for example, multiple parts or components may be divided into Incorporation may either be integrated into another system, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or parts, and may be in electrical, mechanical or other forms.
  • the parts described as separate parts may or may not be physically separated, and the parts shown as parts may or may not be physical parts, that is, they may be located in one place, or may be distributed over multiple network parts. Some or all of them may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional part in each embodiment of the present disclosure may be integrated into one processing part, or each part may exist physically alone, or two or more parts may be integrated into one part.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the embodiments of the present disclosure are produced in whole or in part.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • the computer instructions can be sent from a website site, computer, server, or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) another website site, computer, server or data center for transmission.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital versatile disc (DVD)), or semiconductor media (eg, solid state disk (SSD) ))Wait.
  • the process may include the flow of each method embodiment described above.
  • the aforementioned storage medium includes: read-only memory (read-only memory, ROM) or random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • Embodiments of the present disclosure provide a temperature measurement method and device, an electronic device, and a storage medium.
  • the method includes: acquiring an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image; performing face detection on the to-be-processed image to obtain a first face region; The pixel area corresponding to the first face area is determined from the temperature heat map based on the homography matrix to obtain a second face area; based on the temperature of the pixels included in the second face area , and determine the temperature of the temperature measurement object corresponding to the first face region. It can accurately determine the face area of the temperature measurement object from the image to be processed to obtain the first face area, improve the accuracy of the temperature measurement object's face area determined from the temperature thermogram, and then improve the temperature of the temperature measurement object. accuracy.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)
  • Testing Electric Properties And Detecting Electric Faults (AREA)
  • Crystals, And After-Treatments Of Crystals (AREA)
  • Image Analysis (AREA)
  • Radiation Pyrometers (AREA)

Abstract

The embodiments of the present disclosure provide a temperature measurement method and apparatus, an electronic device, and a storage medium. Said method comprises: acquiring an image to be processed, a temperature thermogram, and a homography matrix between the temperature thermogram and said image; performing face detection on said image to obtain a first face region; on the basis of the homography matrix, determining, from the temperature thermogram, a pixel point region corresponding to the first face region, so as to obtain a second face region; and on the basis of the temperatures of pixel points contained in the second face region, determining the temperature of a temperature measurement object corresponding to the first face region.

Description

测温方法及装置、电子设备及存储介质Temperature measurement method and device, electronic equipment and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202011148359.5、申请日为2020年10月23日,申请名称为“测温方法及装置、电子设备及存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。This disclosure is based on the Chinese patent application with the application number of 202011148359.5 and the application date of October 23, 2020, and the application name is "temperature measurement method and device, electronic equipment and storage medium", and claims the priority of the Chinese patent application, The entire contents of this Chinese patent application are hereby incorporated by reference into the present disclosure.
技术领域technical field
本公开实施例涉及测温技术领域,尤其涉及一种测温方法及装置、电子设备及存储介质。The embodiments of the present disclosure relate to the technical field of temperature measurement, and in particular, to a temperature measurement method and device, an electronic device, and a storage medium.
背景技术Background technique
目前,在测温领域对非接触式测温的需求暴增。非接触式测温可以有效避免人群的交叉感染,对防疫起了积极作用。At present, the demand for non-contact temperature measurement in the field of temperature measurement has exploded. Non-contact temperature measurement can effectively avoid cross-infection of the crowd and play a positive role in epidemic prevention.
在目前的非接触式测温方法中,测温设备通过对采集到的温度热力图进行人脸检测,得到温度热力图中的人脸区域。基于温度热力图中的人脸区域包含的像素点的温度,可得到测温对象的温度。但通过该种方法得到的测温对象的温度的准确度比较低。In the current non-contact temperature measurement method, the temperature measurement device obtains the face area in the temperature heat map by performing face detection on the collected temperature heat map. Based on the temperature of the pixels included in the face area in the temperature heat map, the temperature of the temperature measurement object can be obtained. However, the accuracy of the temperature of the temperature measurement object obtained by this method is relatively low.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供一种测温方法及装置、电子设备及存储介质。Embodiments of the present disclosure provide a temperature measurement method and device, an electronic device, and a storage medium.
本公开实施例提供了一种测温方法,所述方法包括:获取待图像、温度热力图以及所述温度热力图和所述待图像之间的单应性矩阵;对所述待图像进行人脸检测,得到第一人脸区域;基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;基于所述第二人脸区域包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。An embodiment of the present disclosure provides a temperature measurement method, the method includes: acquiring a to-be-image, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-image; face detection to obtain a first face area; determine a pixel area corresponding to the first face area from the temperature heat map based on the homography matrix to obtain a second face area; based on the first face area The temperature of the pixels included in the two face regions determines the temperature of the temperature measurement object corresponding to the first face region.
在一些可能实现的方式中,所述基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域,包括:基于所述单应性矩阵和包含所述第一人脸区域的人脸框的四个角点,从所述温度热力图中确定与所述四个角点对应的四个像素点;基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域。In some possible implementation manners, the determining a pixel area corresponding to the first face area from the temperature heat map based on the homography matrix, to obtain a second face area, includes: based on the The homography matrix and the four corners of the face frame containing the first face region, and four pixels corresponding to the four corners are determined from the temperature heat map; based on the The quadrilateral area determined by the four pixel points determines the second face area.
在一些可能实现的方式中,所述对所述待处理图像进行人脸检测,得到第一人脸区域,包括:对所述待处理图像进行人脸检测,得到至少一个第一人脸框;将所述至少一个第一人脸框中的第二人脸框包含的像素点区域作为所述第一人脸区域;所述第二人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框。In some possible implementations, performing face detection on the to-be-processed image to obtain a first face region includes: performing face detection on the to-be-processed image to obtain at least one first face frame; The pixel area included in the second face frame in the at least one first face frame is used as the first face area; the resolution of the pixel area included in the second face frame is greater than the resolution threshold face frame.
在一些可能实现的方式中,所述第一人脸框的数量大于1,所述至少一个第一人脸框包括第三人脸框和第四人脸框;所述将所述至少一个第一人脸框中的第二人脸框包含的像素点区域作为所述第一人脸区域,包括:在所述第三人脸框和所述第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域。In some possible implementations, the number of the first face frames is greater than 1, and the at least one first face frame includes a third face frame and a fourth face frame; the at least one first face frame The pixel area included in the second face frame in the face frame is used as the first face area, including: the overlap ratio between the third face frame and the fourth face frame is less than or When it is equal to the overlap rate threshold, the pixel point area included in any one of the third face frame and the fourth face frame is used as the first face area.
在一些可能实现的方式中,所述将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域,包括:将所述第三人脸框和所述第四人脸框中大小测度最大的人脸框包含的像素点区域,作为所述第一 人脸区域;所述第三人脸框的大小测度为所述第三人脸框的边长的最大值;所述第四人脸框的大小测度为所述第四人脸框的边长的最大值。In some possible implementation manners, the pixel point area included in any one of the face frames in the third face frame and the fourth face frame as the first face area includes: The pixel area contained in the face frame with the largest size measure in the third face frame and the fourth face frame is used as the first face area; the size measure of the third face frame is The maximum value of the side length of the third human face frame; the size measurement of the fourth human face frame is the maximum value of the side length of the fourth human face frame.
在一些可能实现的方式中,所述基于所述第二人脸区域包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度,包括:对所述第一人脸区域进行额头检测,得到所述第一人脸区域的额头检测结果;在所述第一人脸区域的额头检测结果为所述第一人脸区域中的额头区域处于未被遮挡的情况下,基于第三人脸区域包含的像素点的温度,得到所述测温对象的温度;所述第三人脸区域为所述第二人脸区域中与所述额头区域对应的区域。In some possible implementation manners, the determining the temperature of the temperature measurement object corresponding to the first human face region based on the temperature of the pixels included in the second human face region includes: measuring the temperature of the first human face region. Performing forehead detection on the face area to obtain the forehead detection result of the first face area; in the case where the forehead detection result of the first face area is that the forehead area in the first face area is not blocked , the temperature of the temperature measurement object is obtained based on the temperature of the pixels included in the third face area; the third face area is the area corresponding to the forehead area in the second face area.
在一些可能实现的方式中,所述基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域,包括:获取所述四边形区域的对角线的交点;将第一点与所述交点之间的距离作为第一距离;所述第一点为所述四个像素点中距离所述交点最近的像素点;以所述交点为圆心、所述第一距离为半径,构建第一区域;确定所述第一区域和所述四边形区域的交集,得到第二区域;从所述第二区域中选取包含所述交点的区域作为所述第二人脸区域。In some possible implementation manners, the determining the second face area based on the quadrilateral area determined by the four pixel points includes: acquiring an intersection point of diagonal lines of the quadrilateral area; The distance from the intersection point is taken as the first distance; the first point is the pixel point closest to the intersection point among the four pixel points; taking the intersection point as the center of the circle and the first distance as the radius, constructing a first area; determining the intersection of the first area and the quadrilateral area to obtain a second area; selecting an area including the intersection point from the second area as the second face area.
在一些可能实现的方式中,所述基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域,包括:获取所述四边形区域的对角线的交点;确定所述四边形区域的最大内接区域;所述最大内接区域为包含所述交点的矩形区域或圆形区域;将所述最大内接区域作为所述第二人脸区域。In some possible implementation manners, the determining the second face area based on the quadrilateral area determined by the four pixel points includes: acquiring an intersection of diagonal lines of the quadrilateral area; determining the quadrilateral area The largest inscribed area of the area; the largest inscribed area is a rectangular area or a circular area including the intersection point; the largest inscribed area is used as the second face area.
在一些可能实现的方式中,所述确定所述四边形区域的最大内接区域,包括:从所述四个像素点的横坐标中选取第二大的横坐标得到第一横坐标,从所述四个像素点的横坐标中选取第三大的横坐标得到第二横坐标,从所述四个像素点的纵坐标中选取第二大的纵坐标得到第一纵坐标,从所述四个像素点的纵坐标中选取第三大的纵坐标得到第二纵坐标;基于所述第一横坐标和所述第一纵坐标确定第二点,基于所述第一横坐标和所述第二纵坐标确定第三点,基于所述第二横坐标和所述第一纵坐标确定第四点,基于所述第二横坐标和所述第二纵坐标确定第五点;将由所述第二点、所述第三点、所述第四点和所述第五点确定的区域,作为所述最大内接区域。In some possible implementation manners, the determining the largest inscribed area of the quadrilateral area includes: selecting the second largest abscissa from the abscissas of the four pixel points to obtain the first abscissa, and obtaining the first abscissa from the From the abscissas of the four pixels, the third largest abscissa is selected to obtain the second abscissa, the second largest ordinate is selected from the ordinates of the four pixels to obtain the first ordinate, and the first ordinate is obtained from the four ordinates. Among the ordinates of the pixel point, the third largest ordinate is selected to obtain the second ordinate; the second point is determined based on the first abscissa and the first ordinate, and the second point is determined based on the first abscissa and the second The ordinate determines the third point, the fourth point is determined based on the second abscissa and the first ordinate, and the fifth point is determined based on the second abscissa and the second ordinate; The area determined by the point, the third point, the fourth point and the fifth point is used as the maximum inscribed area.
在一些可能实现的方式中,本公开实施例还提供了一种测温装置,所述装置包括:获取部分,被配置为获取待处理图像、温度热力图以及所述温度热力图和所述待处理图像之间的单应性矩阵;检测部分,被配置为对所述待处理图像进行人脸检测,得到第一人脸区域;第一处理部分,被配置为基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;第二处理部分,被配置为基于所述第二人脸框包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。In some possible implementation manners, the embodiments of the present disclosure further provide a temperature measurement device, the device includes: an acquisition part configured to acquire an image to be processed, a temperature heat map, and the temperature heat map and the to-be-processed heat map processing the homography matrix between the images; the detection part is configured to perform face detection on the to-be-processed image to obtain a first face region; the first processing part is configured to obtain a first face region based on the homography matrix; A pixel area corresponding to the first face area is determined in the temperature heat map to obtain a second face area; a second processing part is configured to be based on the temperature of the pixels included in the second face frame , and determine the temperature of the temperature measurement object corresponding to the first face region.
在一些可能实现的方式中,所述第一处理部分,还被配置为:基于所述单应性矩阵和包含所述第一人脸区域的人脸框的四个角点,从所述温度热力图中确定与所述四个角点对应的四个像素点;基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域。In some possible implementation manners, the first processing part is further configured to: based on the homography matrix and four corner points of a face frame including the first face region, extract the temperature from the temperature Four pixel points corresponding to the four corner points are determined in the heat map; based on the quadrilateral area determined by the four pixel points, the second face area is determined.
在一些可能实现的方式中,所述检测部分,还被配置为:对所述待处理图像进行人脸检测,得到至少一个第一人脸框;将所述至少一个第一人脸框中的第二 人脸框包含的像素点区域作为所述第一人脸区域;所述第二人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框。In some possible implementation manners, the detection part is further configured to: perform face detection on the to-be-processed image to obtain at least one first face frame; The pixel area included in the second face frame is used as the first face area; the resolution of the pixel area included in the second face frame is a face frame whose resolution is greater than the resolution threshold.
在一些可能实现的方式中,所述第一人脸框的数量大于1,所述至少一个第一人脸框包括第三人脸框和第四人脸框;所述检测部分,还被配置为:在所述第三人脸框和所述第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域。In some possible implementations, the number of the first face frames is greater than 1, and the at least one first face frame includes a third face frame and a fourth face frame; the detection part is further configured is: when the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, the third face frame and the fourth face frame are divided into Any pixel area included in the face frame is used as the first face area.
在一些可能实现的方式中,所述检测部分,还被配置为:将所述第三人脸框和所述第四人脸框中大小测度最大的人脸框包含的像素点区域,作为所述第一人脸区域;所述第三人脸框的大小测度为所述第三人脸框的边长的最大值;所述第四人脸框的大小测度为所述第四人脸框的边长的最大值。In some possible implementation manners, the detection part is further configured to: use the pixel area included in the face frame with the largest size measurement in the third face frame and the fourth face frame as the the first face area; the size measurement of the third face frame is the maximum value of the side length of the third face frame; the size measurement of the fourth face frame is the fourth face frame the maximum side length of .
在一些可能实现的方式中,所述第二处理部分,还被配置为:对所述第一人脸区域进行额头检测,得到所述第一人脸区域的额头检测结果;在所述第一人脸区域的额头检测结果为所述第一人脸区域中的额头区域处于未被遮挡的情况下,基于第三人脸区域包含的像素点的温度,得到所述测温对象的温度;所述第三人脸区域为所述第二人脸区域中与所述额头区域对应的区域。In some possible implementation manners, the second processing part is further configured to: perform forehead detection on the first face region to obtain a forehead detection result of the first face region; The forehead detection result of the face area is that the forehead area in the first face area is not blocked, and the temperature of the temperature measurement object is obtained based on the temperature of the pixels included in the third face area; The third face area is an area corresponding to the forehead area in the second face area.
在一些可能实现的方式中,所述第一处理部分,还被配置为:获取所述四边形区域的对角线的交点;将第一点与所述交点之间的距离作为第一距离;所述第一点为所述四个像素点中距离所述交点最近的像素点;以所述交点为圆心、所述第一距离为半径,构建第一区域;确定所述第一区域和所述四边形区域的交集,得到第二区域;从所述第二区域中选取包含所述交点的区域作为所述第二人脸区域。In some possible implementation manners, the first processing part is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; take the distance between the first point and the intersection as the first distance; The first point is the pixel point closest to the intersection point among the four pixel points; taking the intersection point as the center of the circle and the first distance as the radius, construct a first area; determine the first area and the The intersection of the quadrilateral regions is obtained to obtain a second region; the region including the intersection point is selected from the second region as the second face region.
在一些可能实现的方式中,所述第一处理部分,还被配置为:获取所述四边形区域的对角线的交点;确定所述四边形区域的最大内接区域;所述最大内接区域为包含所述交点的矩形区域或圆形区域;将所述最大内接区域作为所述第二人脸区域。In some possible implementation manners, the first processing part is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; determine the maximum inscribed area of the quadrilateral area; the maximum inscribed area is A rectangular area or a circular area including the intersection point; the largest inscribed area is taken as the second face area.
在一些可能实现的方式中,所述第一处理部分,还被配置为:从所述四个像素点的横坐标中选取第二大的横坐标得到第一横坐标,从所述四个像素点的横坐标中选取第三大的横坐标得到第二横坐标,从所述四个像素点的纵坐标中选取第二大的纵坐标得到第一纵坐标,从所述四个像素点的纵坐标中选取第三大的纵坐标得到第二纵坐标;基于所述第一横坐标和所述第一纵坐标确定第二点,基于所述第一横坐标和所述第二纵坐标确定第三点,基于所述第二横坐标和所述第一纵坐标确定第四点,基于所述第二横坐标和所述第二纵坐标确定第五点;将由所述第二点、所述第三点、所述第四点和所述第五点确定的区域,作为所述最大内接区域。In some possible implementation manners, the first processing part is further configured to: select the second largest abscissa from the abscissas of the four pixel points to obtain the first abscissa, and obtain the first abscissa from the abscissas of the four pixels. From the abscissa of the point, select the third largest abscissa to obtain the second abscissa, select the second largest ordinate from the ordinate of the four pixel points to obtain the first ordinate, and obtain the first ordinate from the ordinate of the four pixel points. Selecting the third largest ordinate among the ordinates to obtain the second ordinate; determining the second point based on the first abscissa and the first ordinate, and determining the second point based on the first abscissa and the second ordinate For the third point, a fourth point is determined based on the second abscissa and the first ordinate, and a fifth point is determined based on the second abscissa and the second ordinate; The area determined by the third point, the fourth point and the fifth point is used as the maximum inscribed area.
在一些可能实现的方式中,本公开实施例还提供了一种处理器,所述处理器被配置为执行如上述第一方面及其任意一种可能实现的方式的方法。In some possible implementation manners, the embodiments of the present disclosure further provide a processor configured to execute the method according to the above-mentioned first aspect and any one of its possible implementation manners.
在一些可能实现的方式中,本公开实施例还提供了一种电子设备,包括:处理器、发送装置、输入装置、输出装置和存储器,所述存储器被配置为存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算 机指令的情况下,所述电子设备执行如上述第一方面及其任意一种可能实现的方式的方法。In some possible implementations, embodiments of the present disclosure also provide an electronic device, including: a processor, a sending device, an input device, an output device, and a memory, the memory is configured to store computer program codes, the computer The program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to the first aspect and any one of possible implementations thereof.
在一些可能实现的方式中,本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行如上述第一方面及其任意一种可能实现的方式的方法。In some possible implementation manners, embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, where the program instructions are In the case of execution by a processor, the processor is caused to execute the method according to the first aspect and any one of possible implementation manners thereof.
在一些可能实现的方式中,本公开实施例还提供了一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机执行上述第一方面及其任一种可能的实现方式的方法。In some possible implementation manners, the embodiments of the present disclosure also provide a computer program product, the computer program product includes a computer program or instructions, and when the computer program or instructions are run on a computer, the The computer performs the method of the first aspect and any of its possible implementations.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开实施例。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the disclosed embodiments.
附图说明Description of drawings
为了更清楚地说明本公开实施例或背景技术中的技术方案,下面将对本公开实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the background technology, the accompanying drawings required in the embodiments or the background technology of the present disclosure will be described below.
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开实施例的技术方案。The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the embodiments of the present disclosure.
图1为本公开实施例提供的一种测温方法的流程示意图;1 is a schematic flowchart of a temperature measurement method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的一种测温装置的结构示意图;FIG. 2 is a schematic structural diagram of a temperature measuring device according to an embodiment of the present disclosure;
图3为本公开实施例提供的一种测温装置的硬件结构示意图。FIG. 3 is a schematic diagram of a hardware structure of a temperature measuring device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本公开实施例的方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开实施例保护的范围。In order to make those skilled in the art better understand the solutions of the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described The embodiments are only some of the embodiments of the present disclosure, but not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the embodiments of the present disclosure.
本公开实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或部分的过程、方法、系统、产品或设备没有限定于已列出的步骤或部分,而是可选地还包括没有列出的步骤或部分,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或部分。The terms "first", "second" and the like in the description and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, 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 comprising a series of steps or parts is not limited to the listed steps or parts, but optionally also includes unlisted steps or parts, or optionally also includes For other steps or parts inherent to these processes, methods, products or devices.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本公开的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present disclosure. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
目前,在测温领域对非接触式测温的需求暴增。非接触式测温算法可以有效避免人群的交叉感染,对防疫起了积极作用。At present, the demand for non-contact temperature measurement in the field of temperature measurement has exploded. The non-contact temperature measurement algorithm can effectively avoid the cross-infection of the crowd and play a positive role in epidemic prevention.
常用的测温方法是直接使用非接触式测温设备的测温模组产生的温度热力 图进行人脸检测,得到温度热力图中的人脸区域。然后根据温度热力图中的人脸区域包含的像素点的温度,得到测温对象的温度。每个厂商生产的测温模组的温度热力图差异性比较明显,做一个通用的热力图人脸检测模型代价很大。而且,非接触式测温设备的人脸检测模型不是基于温度热力图进行训练的。温度热力图携带的信息少,进行人脸检测的效果会比较差,导致得到的人脸区域不准确。因此,根据温度热力图中不准确的人脸区域包含的像素点区域的温度,得到的测温对象的温度也不准确。这种测温方法不仅需要耗费较大的人力成本,而且检测效率低、易导致测温结果不准确。The commonly used temperature measurement method is to directly use the temperature heat map generated by the temperature measurement module of the non-contact temperature measurement device to perform face detection, and obtain the face area in the temperature heat map. Then, according to the temperature of the pixels contained in the face area in the temperature heat map, the temperature of the temperature measurement object is obtained. The temperature heat map of the temperature measurement modules produced by each manufacturer is quite different, and it is very expensive to make a general heat map face detection model. Moreover, the face detection models of non-contact temperature measurement devices are not trained based on temperature heatmaps. The temperature heat map carries less information, and the effect of face detection will be poor, resulting in inaccurate face areas. Therefore, according to the temperature of the pixel area included in the inaccurate face area in the temperature heat map, the temperature of the temperature measurement object obtained is also inaccurate. This temperature measurement method not only requires a large labor cost, but also has low detection efficiency, which can easily lead to inaccurate temperature measurement results.
基于此,本公开实施例提供了一种通过测温装置实现的测温方法。本公开实施例的执行主体为测温装置。可选的,测温装置可以是以下中的一种:手机、计算机、平板电脑、门禁设备。下面结合本公开实施例中的附图对本公开实施例进行描述。Based on this, an embodiment of the present disclosure provides a temperature measurement method implemented by a temperature measurement device. The execution body of the embodiment of the present disclosure is a temperature measuring device. Optionally, the temperature measuring device may be one of the following: a mobile phone, a computer, a tablet computer, and an access control device. The embodiments of the present disclosure will be described below with reference to the accompanying drawings in the embodiments of the present disclosure.
请参阅图1,图1是本公开实施例提供的一种测温方法的流程示意图。Please refer to FIG. 1 , which is a schematic flowchart of a temperature measurement method provided by an embodiment of the present disclosure.
步骤101、获取待处理图像、温度热力图以及上述温度热力图和上述待处理图像之间的单应性矩阵。Step 101: Acquire an image to be processed, a temperature heat map, and a homography matrix between the above temperature heat map and the above image to be processed.
在一些可能实现的方式中,待处理图像可以是任意图像。例如,待处理图像可以包含人脸,也可以包含人脸和物体。本公开实施例对待处理图像所包含的内容不做限定。In some possible implementations, the image to be processed may be any image. For example, the image to be processed can contain a human face or a human face and an object. The embodiments of the present disclosure do not limit the content included in the image to be processed.
温度热力图是与待处理图像对应的携带温度信息的伪彩图。温度热力图的每一个像素点都携带对应的温度信息。温度热力图中的像素点的颜色越深代表温度越高。也就是说,根据温度热力图中的像素点的温度,可以得到与待处理图像中的测温对象的温度。The temperature heat map is a pseudo-color map corresponding to the image to be processed that carries temperature information. Each pixel of the temperature heat map carries corresponding temperature information. The darker the color of the pixels in the temperature heat map, the higher the temperature. That is to say, according to the temperature of the pixel points in the temperature heat map, the temperature of the temperature measurement object in the image to be processed can be obtained.
一种可能获取待处理图像的实现方式中,测温装置装载有RGB相机。测温装置通过RGB相机采集获得待处理图像。可选的,测温装置与门禁设备组装在一起。测温装置为人工智能(artificial intelligence,AI)红外成像仪、安检门这类非接触式测温产品(这类产品主要放置在车站、机场、地铁、商店、超市、学校、公司大厅以及小区门口这些人流量密集的场景)。In a possible implementation manner of acquiring the image to be processed, the temperature measuring device is equipped with an RGB camera. The temperature measuring device acquires the image to be processed through the RGB camera acquisition. Optionally, the temperature measuring device is assembled with the access control device. The temperature measurement devices are artificial intelligence (AI) infrared imagers, non-contact temperature measurement products such as security gates (such products are mainly placed in stations, airports, subways, shops, supermarkets, schools, company halls and community gates). these crowded scenes).
又一种可能获取待处理图像的实现方式中,测温装置装载有监控摄像头。将监控摄像头发送的视频流进行解码处理,将解码处理获得的RGB图像作为待处理图像。In another possible implementation manner of acquiring the image to be processed, the temperature measuring device is equipped with a monitoring camera. The video stream sent by the surveillance camera is decoded, and the RGB image obtained by the decoding process is used as the image to be processed.
一种可能获取温度热力图的实现方式中,测温装置装载有红外成像设备。测温装置通过该成像设备的红外成像相机采集获得温度热力图。In one possible implementation manner of acquiring the temperature thermal map, the temperature measuring device is equipped with an infrared imaging device. The temperature measuring device acquires a temperature thermal map through the infrared imaging camera of the imaging device.
在一些可能实现的方式中,单应性变换(Homograph)相当于是投影变换,改变物体的位置和形状。单应性矩阵(Homograph,H)是预先标定的单应性映射变换参数。本公开实施例获取温度热力图和待处理图像之间的单应性矩阵采用的是传统方法。传统方法获取单应性矩阵,需要经过以下步骤:提取每张图的特征点;提取每个特征点对应的描述子;通过匹配特征点描述子,找到两张图中匹配的特征点对(这里可能存在错误匹配);使用RANSAC(Random Sample Consensus,随机抽样一致)算法剔除错误匹配;求解方程组,计算单应性矩阵。温度热力图是通过红外成像设备拍摄的图像,待处理图像是通过RGB成像设备 拍摄的图像。In some possible implementations, a homography transformation is equivalent to a projective transformation, changing the position and shape of an object. The homography matrix (Homograph, H) is a pre-calibrated homography mapping transformation parameter. The embodiment of the present disclosure adopts a traditional method to obtain the homography matrix between the temperature heat map and the image to be processed. The traditional method to obtain the homography matrix needs to go through the following steps: extract the feature points of each image; extract the descriptor corresponding to each feature point; find the matching feature point pair in the two images by matching the feature point descriptor (there may be Error matching); use the RANSAC (Random Sample Consensus, random sampling consistent) algorithm to eliminate false matching; solve the equation system, and calculate the homography matrix. The temperature heat map is an image captured by an infrared imaging device, and the image to be processed is an image captured by an RGB imaging device.
一种可能获取温度热力图和待处理图像之间的单应性矩阵的实现方式中,测温装置上安装有RGB相机和红外成像相机。将一个正方形卡片放到测温装置前1米左右的位置,通过RGB相机和红外成像相机先拍摄两张图像。那么,通过RGB相机得到正方形卡片的RGB图像。通过红外成像相机得到正方形卡片的红外成像图像。通过提取正方形卡片的RGB图像和正方形卡片的红外成像图像的局部特征点,可以采用的算法有:尺度不变特征转换(scale-invariant feature transform,SIFT)、快速鲁棒特征(speed up roust feature,SURF)、角点检测(Features fromaccelerated segment test,FAST)等,本公开实施例在这里不做限定。然后,提取每个局部特征点对应的描述子,通过匹配特征点描述子,找到正方形卡片的RGB图像和正方形卡片的红外成像图像中匹配的特征点对。因为可能会存在错误匹配,使用RANSAC算法剔除错误匹配,求解对应的方程组,计算单应性矩阵(Homograph)。需要理解的是,每一台测温装置的RGB相机和红外成像相机摆放的位置以及角度可能存在差异,用不同的测温装置的RGB相机和红外成像相机得到的单应性矩阵存在差异。因此,每台测温装置都需要进行通过正方形的卡片进行标定,通过得到RGB相机拍摄的图像和红外成像相机拍摄的图像后,再通过上述方法计算得到单应性矩阵。In an implementation manner that may acquire the homography matrix between the temperature heat map and the image to be processed, an RGB camera and an infrared imaging camera are installed on the temperature measuring device. Place a square card about 1 meter in front of the temperature measuring device, and take two images first through the RGB camera and the infrared imaging camera. Then, get the RGB image of the square card through the RGB camera. An infrared imaging image of the square card is obtained by an infrared imaging camera. By extracting the local feature points of the RGB image of the square card and the infrared imaging image of the square card, the algorithms that can be used are: scale-invariant feature transform (SIFT), speed up roust feature, SURF), corner detection (Features fromaccelerated segment test, FAST), etc., which are not limited in the embodiments of the present disclosure. Then, extract the descriptor corresponding to each local feature point, and find the matching feature point pair in the RGB image of the square card and the infrared imaging image of the square card by matching the feature point descriptor. Because there may be wrong matches, the RANSAC algorithm is used to eliminate the wrong matches, solve the corresponding equation system, and calculate the homography matrix (Homograph). It should be understood that the positions and angles of the RGB cameras and infrared imaging cameras of each temperature measurement device may be different, and the homography matrices obtained by the RGB cameras and infrared imaging cameras of different temperature measurement devices are different. Therefore, each temperature measuring device needs to be calibrated by a square card. After obtaining the image captured by the RGB camera and the image captured by the infrared imaging camera, the homography matrix is calculated by the above method.
步骤102、对上述待处理图像进行人脸检测,得到第一人脸区域; Step 102, performing face detection on the above-mentioned to-be-processed image to obtain a first face region;
在一些可能实现的方式中,人脸检测用于确定上述待处理图像中是否包含人脸区域。测温装置通过对上述待处理图像进行人脸检测,可确定上述待处理图像中是否包含人脸区域。In some possible implementation manners, face detection is used to determine whether the above-mentioned image to be processed contains a face region. By performing face detection on the above-mentioned image to be processed, the temperature measuring device can determine whether the above-mentioned image to be processed includes a face region.
测温装置确定上述待处理图像包含人脸区域表征,上述待处理图像中包含测温对象。在上述待处理图像中包含人脸区域的情况下,得到第一人脸区域。需要理解的是,第一人脸区域是上述待处理图像中测温对象对应的人脸区域。The temperature measurement device determines that the image to be processed includes a face region representation, and the image to be processed includes a temperature measurement object. In the case that the above image to be processed includes a face region, the first face region is obtained. It should be understood that the first face area is the face area corresponding to the temperature measurement object in the above image to be processed.
一种人脸检测可能的实现方式中,测温装置通过对待处理图像进行人脸特征提取处理,得到待处理图像的人脸特征数据。进而可基于该人脸特征数据确定待处理图像中是否包含人脸区域。In a possible implementation manner of face detection, the temperature measurement device obtains face feature data of the to-be-processed image by performing facial feature extraction processing on the to-be-processed image. Further, it can be determined based on the face feature data whether the image to be processed includes a face region.
又一种人脸检测可能的实现方式中,测温装置使用人脸检测神经网络对待处理图像进行处理,以确定待处理图像中是否包含人脸区域。该人脸检测神经网络以带有标注信息的第一训练图像为训练数据训练得到,其中,标注信息包括第一训练图像中是否包含人脸。In another possible implementation manner of face detection, the temperature measurement device uses a face detection neural network to process the image to be processed, so as to determine whether the image to be processed contains a face region. The face detection neural network is obtained by training a first training image with label information as training data, wherein the label information includes whether the first training image contains a human face.
又一种人脸检测可能的实现方式中,通过预先训练好的神经网络对待处理图像进行特征提取处理,获得特征数据,该预先训练好的神经网络根据特征数据中的特征识别待处理图像中是否包含人脸。通过对待处理图像进行特征提取处理,在特征提取的数据中确定待处理图像中包含人脸的情况下,确定上述待处理图像人脸框的位置,也就是实现对人脸的检测,对待处理图像进行人脸检测可通过卷积神经网络实现。通过将多张带有标注信息的图像作为训练数据,对卷积神经网络进行训练,使训练后的卷积神经网络可完成对图像的人脸检测。训练数据中的图像的标注信息为人脸以及人脸的位置。在使用训练数据对卷积神经网络进行训练的过程中,卷积神经网络从图像中提取出图像的特征数据,并基于特征数据确 定图像中是否有人脸,在图像中有人脸的情况下,基于图像的特征数据得到人脸的位置。以标注信息为监督信息监督卷积神经网络在训练过程中得到的结果,并更新卷积神经网络的参数,完成对卷积神经网络的训练。这样,可使用训练后的卷积神经网络对待处理图像进行处理,以得到待处理图像中的人脸的位置。In another possible implementation manner of face detection, feature extraction is performed on the image to be processed through a pre-trained neural network to obtain feature data, and the pre-trained neural network identifies whether the image to be processed Contains human faces. By performing feature extraction processing on the image to be processed, in the case where it is determined that the image to be processed contains a human face in the feature extraction data, the position of the face frame of the image to be processed is determined, that is, the detection of the face is realized, and the image to be processed is detected. Face detection can be achieved through convolutional neural networks. By using multiple images with labeled information as training data, the convolutional neural network is trained, so that the trained convolutional neural network can complete the face detection on the image. The annotation information of the images in the training data is the face and the position of the face. In the process of using the training data to train the convolutional neural network, the convolutional neural network extracts the feature data of the image from the image, and determines whether there is a face in the image based on the feature data. The feature data of the image gets the position of the face. The annotation information is used as the supervision information to supervise the results obtained by the convolutional neural network in the training process, and the parameters of the convolutional neural network are updated to complete the training of the convolutional neural network. In this way, the image to be processed can be processed using the trained convolutional neural network to obtain the position of the face in the image to be processed.
又一种人脸检测可能的实现方式中,人脸检测可通过人脸检测算法实现,其中,人脸检测算法可以是以下中的一种:基于直方图粗分割和奇异值特征的人脸检测算法、基于二进小波变换的人脸检测、基于概率决策的神经网络方法(probabilistic decision based neural network,PDBNN)、隐马尔可夫模型方法(Hidden Markov Model,HMM)等等,本公开实施例对实现人脸检测的人脸检测算法不做限定。In yet another possible implementation manner of face detection, face detection may be implemented through a face detection algorithm, wherein the face detection algorithm may be one of the following: face detection based on coarse histogram segmentation and singular value features algorithm, face detection based on binary wavelet transform, neural network method based on probability decision (probabilistic decision based neural network, PDBNN), hidden Markov model method (Hidden Markov Model, HMM), etc. The face detection algorithm for implementing face detection is not limited.
步骤103、基于上述单应性矩阵从上述温度热力图中确定与上述第一人脸区域对应的像素点区域,得到第二人脸区域;Step 103: Determine the pixel area corresponding to the above-mentioned first face area from the above-mentioned temperature heat map based on the above-mentioned homography matrix, and obtain the second face area;
通过单应性矩阵可以从温度热力图中确定与待处理图像中的像素点对应的像素点。The pixel points corresponding to the pixel points in the image to be processed can be determined from the temperature heat map through the homography matrix.
举例来说,假设待处理图像中的像素点A的坐标为(2,4),温度热力图中与像素点A对应的像素点为像素点D,单应性矩阵
Figure PCTCN2021098352-appb-000001
将A像素点的坐标转换成齐次坐标(2,4,1),对应的矩阵形式B为[2,4,1]。那么,将A像素点的齐次坐标和单应性矩阵H相乘,可以得到矩阵
Figure PCTCN2021098352-appb-000002
将矩阵C的第一个数值13除以第三个数值55,得到像素点D的横坐标为13/55;矩阵C的第二个数值34除以第三个数值55,得到像素点D的纵坐标为34/55。因此,温度热力图中像素点A对应的像素点D的坐标为(13/55,34/55)。
For example, assuming that the coordinates of pixel A in the image to be processed are (2, 4), the pixel corresponding to pixel A in the temperature heat map is pixel D, and the homography matrix
Figure PCTCN2021098352-appb-000001
Convert the coordinates of pixel A into homogeneous coordinates (2, 4, 1), and the corresponding matrix form B is [2, 4, 1]. Then, multiply the homogeneous coordinates of the A pixel by the homography matrix H to get the matrix
Figure PCTCN2021098352-appb-000002
Divide the first value 13 of matrix C by the third value 55, the abscissa of pixel D is 13/55; the second value 34 of matrix C is divided by the third value 55, and the abscissa of pixel D is obtained. The ordinate is 34/55. Therefore, the coordinates of the pixel point D corresponding to the pixel point A in the temperature heat map are (13/55, 34/55).
图像处理装置基于单应性矩阵,可从温度热力图中确定与第一人脸区域轮廓上的像素点对应的像素点,进而从温度热力图中确定与第一人脸区域对应的像素点区域,即第二人脸区域。Based on the homography matrix, the image processing device can determine the pixel points corresponding to the pixel points on the contour of the first face area from the temperature heat map, and then determine the pixel point area corresponding to the first face area from the temperature heat map , which is the second face area.
步骤104、基于上述第二人脸区域包含的像素点的温度,得到与上述第一人脸区域对应的测温对象的温度。Step 104: Obtain the temperature of the temperature measurement object corresponding to the first face region based on the temperature of the pixels included in the second face region.
在一些可能实现的方式中,测温装置可确定在温度热力图中任意一个像素点所对应的温度。在上述温度热力图包含第二人脸区域,测温装置基于第二人脸区域包含的像素点的温度,可以得到与第一人脸区域对应的测温对象的温度。In some possible implementations, the temperature measuring device can determine the temperature corresponding to any pixel point in the temperature thermogram. When the above-mentioned temperature heat map includes a second face area, the temperature measuring device can obtain the temperature of the temperature measurement object corresponding to the first face area based on the temperature of the pixel points included in the second face area.
在一些可能实现的方式中,测温装置将第二人脸区域中至少一个像素点所对应的温度平均值,作为测温对象的温度。例如,第二人脸区域的像素点包括:像素点a和像素点b,其中,像素点a所对应的温度为36.9度,像素点b所对应的温度为36.3度。测温装置可将像素点a所对应的温度和像素点b所对应的温度的平均值(36.6度)作为测温对象的温度;测温装置也可将像素点a所对应的温度(36.9度)作为测温对象的温度;测温装置还可将像素点b所对应的温度(36.3度)作为测温对象的温度。In some possible implementation manners, the temperature measurement device uses the average temperature of at least one pixel point in the second face region as the temperature of the temperature measurement object. For example, the pixel points of the second face region include: pixel point a and pixel point b, wherein the temperature corresponding to pixel point a is 36.9 degrees, and the temperature corresponding to pixel point b is 36.3 degrees. The temperature measuring device can take the average value (36.6 degrees) of the temperature corresponding to pixel point a and the temperature corresponding to pixel point b as the temperature of the temperature measurement object; the temperature measuring device can also use the temperature corresponding to pixel point a (36.9 degrees) ) as the temperature of the temperature measurement object; the temperature measurement device can also use the temperature (36.3 degrees) corresponding to the pixel point b as the temperature of the temperature measurement object.
在又一种可能的实现方式中,测温装置将第二人脸区域中像素点所对应的温度最高值,作为测温对象的温度。例如,第二人脸区域的像素点包括:像素点a、像素点b和像素点c,其中,像素点a所对应的温度为36.9度,像素点b所对应的温度为36.3度,像素点c对应的温度为37度。测温装置可将像素点a所对应的温度、像素点b所对应的温度和像素点c所对应的温度的最高值(37度)作为测温对象的温度。In another possible implementation manner, the temperature measurement device uses the highest temperature value corresponding to the pixel point in the second face region as the temperature of the temperature measurement object. For example, the pixels in the second face area include: pixel a, pixel b, and pixel c, where the temperature corresponding to pixel a is 36.9 degrees, the temperature corresponding to pixel b is 36.3 degrees, and the temperature corresponding to pixel a is 36.3 degrees. c corresponds to a temperature of 37 degrees. The temperature measurement device can take the temperature corresponding to the pixel point a, the temperature corresponding to the pixel point b, and the maximum value (37 degrees) of the temperature corresponding to the pixel point c as the temperature of the temperature measurement object.
在又一种可能实现的方式中,测温装置首先计算第二人脸区域中像素点所对应的温度平均值,从与温度平均值之间的差异小于或等于阈值的像素点中选取至少一个像素点,并将至少一个像素点所对应的温度的平均值作为测温对象的温度。例如,第二人脸区域的像素点包括:像素点a、像素点b、像素点c和像素点d。其中,像素点a所对应的温度为36.9度,像素点b所对应的温度为36.3度,像素点c所对应的温度为37.9度,像素点d所对应的温度为35.2度。测温装置计算第二人脸区域中像素点所对应的温度平均值为36.625度。在阈值为1度的情况下,由于像素点c所对应的温度与温度平均值之间的差异(1.275度)和像素点d所对应的温度与温度平均值之间的差异(1.375度)均大于1度,测温装置从像素点a和像素点b中选取至少一个像素点。进一步的,测温装置可将像素点a所对应的温度和像素点b所对应的温度的平均值(36.6度)作为测温对象的温度;测温装置也可将像素点a所对应的温度(36.9度)作为测温对象的温度;测温装置还可将像素点b所对应的温度(36.3度)作为测温对象的温度。In another possible implementation manner, the temperature measuring device first calculates the average temperature corresponding to the pixel points in the second face region, and selects at least one pixel point whose difference from the average temperature value is less than or equal to a threshold value pixel points, and the average value of the temperature corresponding to at least one pixel point is used as the temperature of the temperature measurement object. For example, the pixel points of the second face region include: pixel point a, pixel point b, pixel point c, and pixel point d. Among them, the temperature corresponding to pixel a is 36.9 degrees, the temperature corresponding to pixel b is 36.3 degrees, the temperature corresponding to pixel c is 37.9 degrees, and the temperature corresponding to pixel d is 35.2 degrees. The temperature measuring device calculates that the average temperature corresponding to the pixels in the second face area is 36.625 degrees. When the threshold is 1 degree, the difference between the temperature corresponding to pixel c and the average temperature (1.275 degrees) and the difference between the temperature corresponding to pixel d and the average temperature (1.375 degrees) are both If it is greater than 1 degree, the temperature measuring device selects at least one pixel point from the pixel point a and the pixel point b. Further, the temperature measuring device can use the average value (36.6 degrees) of the temperature corresponding to the pixel point a and the temperature corresponding to the pixel point b as the temperature of the temperature measurement object; the temperature measuring device can also use the temperature corresponding to the pixel point a. (36.9 degrees) as the temperature of the temperature measurement object; the temperature measurement device can also use the temperature (36.3 degrees) corresponding to the pixel point b as the temperature of the temperature measurement object.
在一些可能实现的方式中,测温装置通过对待处理图像进行人脸检测,可准确的从待处理图像中确定测温对象的人脸区域得到第一人脸区域。基于待处理图像与温度热力图之间的单应性矩阵以及第一人脸区域在待处理图像中的位置,从温度热力图中确定测温对象的人脸区域,可提高从温度热力图中确定的测温对象的人脸区域的准确度,得到第二人脸区域。这样,测温装置再基于第二人脸区域的温度得到测温对象的温度,可提高测温对象的温度的准确度。In some possible implementations, the temperature measuring device can accurately determine the face region of the temperature measurement object from the to-be-processed image by performing face detection on the to-be-processed image to obtain the first face region. Based on the homography matrix between the image to be processed and the temperature heat map and the position of the first face region in the image to be processed, determining the face region of the temperature measurement object from the temperature heat map can improve the performance from the temperature heat map. Determine the accuracy of the face area of the temperature measurement object to obtain a second face area. In this way, the temperature measurement device obtains the temperature of the temperature measurement object based on the temperature of the second face region, which can improve the accuracy of the temperature measurement object.
作为一种可选的实施方式,为了确定第一人脸区域在温度热力图中对应的像素点区域,需要先确定第一人脸区域的位置。通过包含第一人脸区域的人脸框的四个角点的坐标,确定第一人脸区域的位置。人脸检测在得到第一人脸区域的同时,也能得到包含第一人脸区域的人脸框,因此,测温装置在执行步骤102的过程中执行以下步骤:As an optional implementation manner, in order to determine the pixel area corresponding to the first face region in the temperature heat map, the position of the first face region needs to be determined first. The position of the first face region is determined by the coordinates of the four corners of the face frame including the first face region. When the face detection obtains the first face area, it can also obtain the face frame including the first face area. Therefore, the temperature measurement device performs the following steps in the process of executing step 102:
步骤21、对上述待处理图像进行人脸检测,得到至少一个第一人脸框; Step 21, performing face detection on the above-mentioned to-be-processed image to obtain at least one first face frame;
在一些可能实现的方式中,在待处理图像中存在多个人脸的情况下,通过对待处理图像进行人脸检测,按照上述待处理图像中人脸区域的大小输出多个包含人脸区域的人脸框。也就是说,对上述对待处理图像进行人脸检测,得到至少一个第一人脸框。需要理解的是,人脸框的大小是根据包含的人脸区域的大小确定的。至少一个第一人脸框中每一个人脸框的形状均是矩形,且每一个人脸框的位置由人脸框的四个角点的坐标确定。In some possible implementation manners, when there are multiple faces in the image to be processed, by performing face detection on the image to be processed, according to the size of the face area in the above image to be processed, output a plurality of people including the face area face frame. That is, performing face detection on the above-mentioned image to be processed to obtain at least one first face frame. It should be understood that the size of the face frame is determined according to the size of the included face area. The shape of each face frame in the at least one first face frame is a rectangle, and the position of each face frame is determined by the coordinates of four corners of the face frame.
步骤22、将上述至少一个第一人脸框中的第二人脸框包含的像素点区域作为上述第一人脸区域;上述第二人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框; Step 22, taking the pixel area included in the second face frame in the above-mentioned at least one first face frame as the first face area; the resolution of the pixel area included in the second face frame is greater than the resolution threshold the face frame;
在一些可能实现的方式中,从至少一个第一人脸框中选取包含的像素点区域的分辨率大于分辨率阈值的人脸框,得到第二人脸框。本公开实施例中,人脸检测的脸部像素至少在60x60以上。也就是说,分辨率阈值至少为60x60。比如说,在第一人脸区域的脸部像素为56x56的情况下,进行人脸检测后不能确定得到第一人脸区域的准确性,在温度热力图中也不能确定与第一人脸区域对应的第二人脸区域的准确性。因此,分辨率阈值至少设置大于等于60x60,但对于分辨率阈值的取值,本公开实施例不做限定。In some possible implementation manners, a face frame whose resolution of the pixel area included in the at least one first face frame is greater than a resolution threshold is selected to obtain the second face frame. In the embodiment of the present disclosure, the face pixels for face detection are at least 60×60 or more. That is, the resolution threshold is at least 60x60. For example, when the face pixels of the first face area are 56x56, the accuracy of obtaining the first face area cannot be determined after face detection, nor can it be determined in the temperature heat map that it is related to the first face area. The accuracy of the corresponding second face region. Therefore, the resolution threshold is at least set to be greater than or equal to 60×60, but the value of the resolution threshold is not limited in this embodiment of the present disclosure.
一种可能的实现方式,在至少一个第一人脸框的数量为1且人脸框内包含的像素点区域的分辨率大于分辨率阈值的情况下,得到一个第二人脸框,将第二人脸框作为上述待处理图像中测温对象的人脸框。In a possible implementation, when the number of at least one first face frame is 1 and the resolution of the pixel area included in the face frame is greater than the resolution threshold, a second face frame is obtained, and the first face frame is The two face frames are used as face frames of the temperature measurement object in the above image to be processed.
作为一种可选的实施方式,对待处理图像进行人脸检测,得到的人脸框可能有多个。因为本公开实施例涉及单人测温,因此需要从多个人脸框中选取其中一个。在上述第一人脸框的数量大于1,上述至少一个第一人脸框包括第三人脸框和第四人脸框,测温装置在执行将上述至少一个第一人脸框中的第二人脸框包含的像素点区域作为上述第一人脸区域的过程中,包括以下步骤:As an optional implementation manner, by performing face detection on the image to be processed, there may be multiple face frames obtained. Because the embodiment of the present disclosure involves single-person temperature measurement, one needs to be selected from multiple face frames. When the number of the first face frames is greater than 1, the at least one first face frame includes a third face frame and a fourth face frame, and the temperature measurement device is performing The process of using the pixel area included in the two-face frame as the above-mentioned first face area includes the following steps:
步骤23、在上述第三人脸框和上述第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将上述第三人脸框和上述第四人脸框中任意一个人脸框包含的像素点区域作为上述第一人脸区域; Step 23, in the case that the overlap ratio between the above-mentioned third face frame and the above-mentioned fourth face frame is less than or equal to the overlap ratio threshold, place any one of the above-mentioned third face frame and the above-mentioned fourth face frame. The pixel area contained in the face frame is used as the above-mentioned first face area;
在一些可能实现的方式中,在上述第一人脸框的数量大于1的情况下,从至少一个第一人脸框中选取包含第一人脸区域的人脸框。在上述待处理图像中的至少一个第一人脸框中任意一个人脸框,至少存在一个与它不同的人脸框,使得这两个人脸框包含的像素点区域有重叠部分的情况下,不能将至少一个第一人脸框中该任意一个人脸框包含的像素点区域作为上述第一人脸区域。也就是说,在上述待处理图像中的至少一个第一人脸框中任意一个人脸框,至少存在一个与它不同的人脸框,使得这两个人脸框之间的重叠率大于重叠率阈值的情况下,不能将至少一个第一人脸框中该任意一个人脸框包含的像素点区域作为上述第一人脸区域。In some possible implementation manners, when the number of the above-mentioned first face frames is greater than 1, a face frame including the first face region is selected from at least one first face frame. In the above-mentioned at least one face frame of the first face frame in the above image to be processed, there is at least one face frame different from it, so that the pixel area contained in the two face frames has overlapping parts, The pixel point area included in any one of the at least one first face frame cannot be used as the above-mentioned first face area. That is to say, in any face frame of at least one first face frame in the above image to be processed, there is at least one face frame different from it, so that the overlap ratio between the two face frames is greater than the overlap ratio In the case of the threshold value, the pixel point area included in any one of the at least one first face frame cannot be used as the above-mentioned first face area.
在至少一个第一脸框中任意两个人脸框之间的重叠率均小于或等于重叠率阈值的情况下,也就是至少一个第一人脸框中每个人脸框之间均存在距离,也就是任意两个人脸框包含的像素点区域的重叠部分的面积均为0,也就是说任意两个人脸框之间的重叠率为0%。那么,至少一个第一人脸框中任意一个人脸框包含的像素点区域均能作为上述第一人脸区域。因此,将重叠率阈值设置为0。In the case where the overlap ratio between any two face frames in at least one first face frame is less than or equal to the overlap ratio threshold, that is, there is a distance between each face frame in the at least one first face frame, and That is, the area of the overlapping part of the pixel area contained in any two face frames is 0, that is to say, the overlap rate between any two face frames is 0%. Then, the pixel area included in any one face frame in the at least one first face frame can be used as the above-mentioned first face area. Therefore, set the overlap rate threshold to 0.
一种可能的实现方式中,至少一个第一人脸框的数量为2,设这两个人脸框为第三人脸框和第四人脸框。计算第三人脸框和第四人脸框之间的重叠率,在确定第三人脸框和第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将第三人脸框和第四人脸框中任意一个人脸框包含的像素点区域作为上述第一人脸区域。举例说明,至少一个第一人脸框有两个人脸框:人脸框b和人脸框c。计算人脸框b和人脸框c之间的重叠率。在人脸框b和人脸框c之间的重叠率小于或等于重叠率阈值的情况下,也就是人脸框b包含的像素点区域和人脸框c包含的像素点区域没有重叠的部分。因此,人脸框b包含的像素点区域可以作为第一 人脸区域,人脸框c包含的像素点区域也可以作为第一人脸区域。在人脸框b和人脸框c之间的重叠率大于重叠率阈值的情况下,也就是人脸框b包含的像素点区域和人脸框c包含的像素点区域有重叠的部分。因此,人脸框b包含的像素点区域不能作为第一人脸区域,人脸框c包含的像素点区域也不能作为第一人脸区域。In a possible implementation manner, the number of at least one first face frame is 2, and the two face frames are set as the third face frame and the fourth face frame. Calculate the overlap ratio between the third face frame and the fourth face frame, and in the case that the overlap ratio between the third face frame and the fourth face frame is determined to be less than or equal to the overlap ratio threshold The pixel point area contained in any one of the face frame and the fourth face frame is used as the above-mentioned first face area. For example, at least one first face frame has two face frames: face frame b and face frame c. Calculate the overlap rate between face frame b and face frame c. In the case where the overlap ratio between face frame b and face frame c is less than or equal to the overlap ratio threshold, that is, the pixel area contained in face frame b does not overlap with the pixel area contained in face frame c. . Therefore, the pixel area included in the face frame b can be used as the first face area, and the pixel area included in the face frame c can also be used as the first face area. In the case where the overlap ratio between the face frame b and the face frame c is greater than the overlap ratio threshold, that is, the pixel area included in the face frame b and the pixel area included in the face frame c overlap. Therefore, the pixel area included in the face frame b cannot be used as the first face area, and the pixel area included in the face frame c cannot be used as the first face area either.
又一种可能的实现方式中,至少一个第一人脸框的数量为3,设这三个人脸框为第三人脸框、第四人脸框和第五人脸框。分别计算第三人脸框和第四人脸框之间的重叠率、第三人脸框和第五人脸框之间的重叠率以及第四人脸框和第五人脸框之间的重叠率。In another possible implementation manner, the number of at least one first face frame is 3, and the three face frames are set as the third face frame, the fourth face frame and the fifth face frame. Calculate the overlap rate between the third face frame and the fourth face frame, the overlap ratio between the third face frame and the fifth face frame, and the overlap between the fourth face frame and the fifth face frame. overlap rate.
一种可能的情况,第三人脸框和第四人脸框之间的重叠率大于重叠率阈值,第三人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域不能作为第一人脸区域,第四人脸框包含的像素点区域也不能作为第一人脸区域,只有第五人脸框包含的像素点区域可以作为第一人脸区域。A possible situation is that the overlap ratio between the third face frame and the fourth face frame is greater than the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap ratio threshold, The overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap. There is no overlapping part of the area, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, and the pixel area included in the fourth face frame cannot be used as the first face area, only the pixel area included in the fifth face frame. Can be used as the first face area.
又一种可能的情况,第三人脸框和第四人脸框之间的重叠率大于重叠率阈值,第三人脸框和第五人脸框之间的重叠率大于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域不能作为第一人脸区域,第四人脸框包含的像素点区域不能作为第一人脸区域,第五人脸框包含的像素点区域也不能作为第一人脸区域。In another possible situation, the overlap rate between the third face frame and the fourth face frame is greater than the overlap rate threshold, the overlap rate between the third face frame and the fifth face frame is greater than the overlap rate threshold, and the third face frame is greater than the overlap rate threshold. The overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap. The area has an overlapping part, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, the pixel area included in the fourth face frame cannot be used as the first face area, and the pixel area included in the fifth face frame cannot be used as the first face area. as the first face area.
又一种可能的情况,第三人脸框和第四人脸框之间的重叠率小于或等于重叠率阈值,第三人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域可以作为第一人脸区域,第四人脸框包含的像素点区域可以作为第一人脸区域,第五人脸框包含的像素点区域也可以作为第一人脸区域。In another possible situation, the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap rate threshold, the overlap rate between the fourth face frame and the fifth face frame is less than or equal to the overlap rate threshold. That is to say, the pixel area contained in the third face frame does not overlap with the pixel area contained in the fourth face frame, and the pixel area contained in the fifth face frame and the pixels contained in the third face frame do not overlap. There is no overlapping part of the area, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame can be used as the first face area, the pixel area included in the fourth face frame can be used as the first face area, and the pixel area included in the fifth face frame can also be used as the first face area. as the first face area.
又一种可能的实现方式中,在上述至少一个第一人脸框中包含的像素点区域的分辨率大于分辨率阈值的人脸框的数量大于1的情况下,从分辨率大于分辨率阈值的至少一个第一人脸框中选取包含第一人脸区域的人脸框。上述待处理图像中的至少一个第一人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框的数量大于1,在至少一个第一人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框中任意一个人脸框,至少存在一个与它不同的人脸框,使得这两个人脸框包含的像素点区域有重叠部分的情况下,不能将至少一个第一人脸框包含的 像素点区域的分辨率大于分辨率阈值的人脸框中任意一个人脸框包含的像素点区域作为上述第一人脸区域。也就是说,在上述至少一个第一人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框中任意一个人脸框,至少存在一个与它不同的人脸框,使得这两个人脸框之间的重叠率大于重叠率阈值的情况下,不能将至少一个第一人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框中任意一个人脸框包含的像素点区域作为上述第一人脸区域。In another possible implementation manner, in the case where the resolution of the pixel region contained in the above at least one first face frame is greater than the number of face frames with a resolution threshold greater than 1, the resolution is greater than the resolution threshold. Select the face frame containing the first face area in at least one of the first face frames. The resolution of the pixel area included in at least one first face frame in the above-mentioned to-be-processed image is greater than the number of face frames with a resolution threshold greater than 1, and the resolution of the pixel area included in the at least one first face frame is greater than 1. For any face frame in the face frame larger than the resolution threshold, there is at least one face frame different from it, so that when the pixel areas contained in the two face frames overlap, at least one of the first face frames cannot be combined. The resolution of the pixel point region included in the face frame is greater than the resolution threshold, and the pixel point region included in any face frame in the face frame is used as the first face region. That is to say, in any face frame in which the resolution of the pixel area contained in the at least one first face frame is greater than the resolution threshold, there is at least one face frame different from it, so that these two When the overlap ratio between the face frames is greater than the overlap ratio threshold, the pixels included in any face frame in the face frame whose resolution of the pixel area included in at least one first face frame is greater than the resolution threshold cannot be used. The point area is used as the above-mentioned first face area.
又一种可能的实现方式中,至少一个第一人脸框中有两个包含的像素点区域的分辨率大于分辨率阈值的人脸框,设这两个人脸框为第三人脸框和第四人脸框。计算第三人脸框和第四人脸框之间的重叠率,在确定第三人脸框和第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将第三人脸框和第四人脸框中任意一个人脸框包含的像素点区域作为上述第一人脸区域。举例说明,至少一个第一人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框有两个:人脸框b和人脸框c。计算人脸框b和人脸框c之间的重叠率。在人脸框b和人脸框c之间的重叠率小于或等于重叠率阈值的情况下,也就是人脸框b包含的像素点区域和人脸框c包含的像素点区域没有重叠的部分。因此,人脸框b包含的像素点区域可以作为第一人脸区域,人脸框c包含的像素点区域也可以作为第一人脸区域。在人脸框b和人脸框c之间的重叠率大于重叠率阈值的情况下,也就是人脸框b包含的像素点区域和人脸框c包含的像素点区域有重叠的部分。因此,人脸框b包含的像素点区域不能作为第一人脸区域,人脸框c包含的像素点区域也不能作为第一人脸区域。In another possible implementation, at least one of the first face frames has two face frames with pixel area resolutions greater than the resolution threshold, and let these two face frames be the third face frame and Fourth face frame. Calculate the overlap ratio between the third face frame and the fourth face frame, and in the case that the overlap ratio between the third face frame and the fourth face frame is determined to be less than or equal to the overlap ratio threshold The pixel point area contained in any one of the face frame and the fourth face frame is used as the above-mentioned first face area. For example, there are two face frames whose resolution of the pixel point region included in at least one first face frame is greater than the resolution threshold: face frame b and face frame c. Calculate the overlap rate between face frame b and face frame c. In the case where the overlap ratio between face frame b and face frame c is less than or equal to the overlap ratio threshold, that is, the pixel area contained in face frame b does not overlap with the pixel area contained in face frame c. . Therefore, the pixel area included in the face frame b may be used as the first face area, and the pixel area included in the face frame c may also be used as the first face area. In the case where the overlap ratio between the face frame b and the face frame c is greater than the overlap ratio threshold, that is, the pixel area included in the face frame b and the pixel area included in the face frame c overlap. Therefore, the pixel area included in the face frame b cannot be used as the first face area, and the pixel area included in the face frame c cannot be used as the first face area either.
又一种可能的实现方式中,至少一个第一人脸框中有三个包含的像素点区域的分辨率大于分辨率阈值的人脸框,设这三个人脸框为第三人脸框、第四人脸框和第五人脸框。分别计算第三人脸框和第四人脸框之间的重叠率、第三人脸框和第五人脸框之间的重叠率以及第四人脸框和第五人脸框之间的重叠率。一种可能的情况,第三人脸框和第四人脸框之间的重叠率大于重叠率阈值,第三人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域不能作为第一人脸区域,第四人脸框包含的像素点区域也不能作为第一人脸区域,只有第五人脸框包含的像素点区域可以作为第一人脸区域。又一种可能的情况,第三人脸框和第四人脸框之间的重叠率大于重叠率阈值,第三人脸框和第五人脸框之间的重叠率大于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域不能作为第一人脸区域,第四人脸框包含的像素点区域不能作为第一人脸区域,第五人脸框包含的像素点区域也不能作为第一人脸区域。又一种可能的情况,第三人脸框和第四人 脸框之间的重叠率小于或等于重叠率阈值,第三人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值,第四人脸框和第五人脸框之间的重叠率小于或等于重叠率阈值。也就是说,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第三人脸框包含的像素点区域没有重叠的部分,第五人脸框包含的像素点区域和第四人脸框包含的像素点区域没有重叠的部分。因此,第三人脸框包含的像素点区域可以作为第一人脸区域,第四人脸框包含的像素点区域可以作为第一人脸区域,第五人脸框包含的像素点区域也可以作为第一人脸区域。In another possible implementation, at least one of the first face frames has three face frames with pixel area resolutions greater than the resolution threshold, and the three face frames are set as the third face frame, the third face frame Four face frames and fifth face frames. Calculate the overlap rate between the third face frame and the fourth face frame, the overlap ratio between the third face frame and the fifth face frame, and the overlap between the fourth face frame and the fifth face frame. overlap rate. A possible situation is that the overlap ratio between the third face frame and the fourth face frame is greater than the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap ratio threshold, The overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap. There is no overlapping part of the area, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, and the pixel area included in the fourth face frame cannot be used as the first face area, only the pixel area included in the fifth face frame. Can be used as the first face area. In another possible situation, the overlap rate between the third face frame and the fourth face frame is greater than the overlap rate threshold, the overlap rate between the third face frame and the fifth face frame is greater than the overlap rate threshold, and the third face frame is greater than the overlap rate threshold. The overlap ratio between the fourth face frame and the fifth face frame is less than or equal to the overlap ratio threshold. That is to say, the pixel area included in the third face frame and the pixel area included in the fourth face frame overlap, and the pixel area included in the fifth face frame and the pixels included in the third face frame overlap. The area has an overlapping part, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame cannot be used as the first face area, the pixel area included in the fourth face frame cannot be used as the first face area, and the pixel area included in the fifth face frame cannot be used as the first face area. as the first face area. In another possible situation, the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, and the overlap ratio between the third face frame and the fifth face frame is less than or equal to the overlap rate threshold, the overlap rate between the fourth face frame and the fifth face frame is less than or equal to the overlap rate threshold. That is to say, the pixel area contained in the third face frame does not overlap with the pixel area contained in the fourth face frame, and the pixel area contained in the fifth face frame and the pixels contained in the third face frame do not overlap. There is no overlapping part of the area, and the pixel point area contained in the fifth face frame and the pixel point area contained in the fourth face frame have no overlapping part. Therefore, the pixel area included in the third face frame can be used as the first face area, the pixel area included in the fourth face frame can be used as the first face area, and the pixel area included in the fifth face frame can also be used as the first face area. as the first face area.
一种可能的判断两个人脸框之间的重叠率是否大于重叠率阈值的实现方式中,设两个人脸框的边均与x轴或y轴平行,即与上述待处理图像的像素坐标系的横轴或者纵轴对齐的人脸框。设上述待处理图像中有两个人脸框:A人脸框和B人脸框。判断A人脸框和B人脸框之间的重叠率小于或等于重叠率阈值的情况,需要理解的是,两个人脸框的边也不能重叠。那么,存在四种情况使得B人脸框和A人脸框之间的重叠率小于或等于重叠率阈值:第一种情况,B人脸框在A人脸框的上方;第二种情况,B人脸框在A人脸框的下方;第三种情况,B人脸框在A人脸框的左方;第四种情况,B人脸框在A人脸框的右方。设A人脸框的左上角坐标为p1,右下角坐标为p2,B人脸框的左上角坐标为p3,右下角坐标为p4。在B人脸框在A人脸框上方的情况下,p1的纵坐标小于p4的纵坐标;在B人脸框在A人脸框下方的情况下,p3的纵坐标小于p2的纵坐标;在B人脸框在A人脸框左方的情况下,p1的横坐坐标大于p4的横坐标;在B人脸框在A人脸框右方的情况下,p2的横坐标小于p3的横坐标。在以上这四种情况下,A人脸框和B人脸框之间的重叠率小于或等于重叠率阈值。那么,上述待处理图像中的A人脸框包含的像素点区域和B人脸框包含的像素点区域均都能作为第一人脸区域。In a possible implementation method for judging whether the overlap ratio between two face frames is greater than the overlap ratio threshold, it is assumed that the sides of the two face frames are both parallel to the x-axis or the y-axis, that is, to the pixel coordinate system of the above-mentioned image to be processed. The face frame aligned with the horizontal or vertical axis. It is assumed that there are two face frames in the above image to be processed: A face frame and B face frame. When judging that the overlap rate between the face frame A and the face frame B is less than or equal to the overlap rate threshold, it should be understood that the edges of the two face frames cannot overlap. Then, there are four cases where the overlap rate between the B face frame and the A face frame is less than or equal to the overlap ratio threshold: in the first case, the B face frame is above the A face frame; in the second case, The B face frame is below the A face frame; in the third case, the B face frame is to the left of the A face frame; in the fourth case, the B face frame is to the right of the A face frame. Let the coordinates of the upper left corner of the face frame A be p1, the coordinates of the lower right corner be p2, the coordinates of the upper left corner of the face frame B are p3, and the coordinates of the lower right corner are p4. When the B face frame is above the A face frame, the ordinate of p1 is smaller than the ordinate of p4; in the case of the B face frame below the A face frame, the ordinate of p3 is smaller than the ordinate of p2; When the B face frame is to the left of the A face frame, the abscissa of p1 is greater than the abscissa of p4; when the B face frame is to the right of the A face frame, the abscissa of p2 is smaller than that of p3. abscissa. In the above four cases, the overlap rate between the A face frame and the B face frame is less than or equal to the overlap rate threshold. Then, both the pixel point area included in the face frame A and the pixel point area included in the face frame B in the above image to be processed can be used as the first face area.
需要理解的是,多个人脸框中任意两个不同的人脸框之间的关系只有两种,一种是两个不同的人脸框之间的重叠率大于重叠率阈值,另一种是两个不同的人脸框之间的重叠率小于或等于重叠率阈值。对于多个人脸框的数量,本公开实施例不做限定。It should be understood that there are only two relationships between any two different face frames in multiple face frames. One is that the overlap ratio between the two different face frames is greater than the overlap ratio threshold, and the other is that The overlap ratio between two different face frames is less than or equal to the overlap ratio threshold. The embodiments of the present disclosure do not limit the number of multiple face frames.
作为一种可选的实施方式,在第三人脸框和第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,第三人脸框包含的像素点区域和第四人脸框包含的像素点区域均能作为第一人脸区域,但涉及到过安检这类排队检测体温的场景,一般来说,离测温装置越近,那么对应的人脸区域就会越大。因此,将第三人脸框和第四人脸框中较大的人脸框包含的像素点区域作为第一人脸区域,测温装置在执行步骤23的过程中执行以下步骤:As an optional implementation manner, when the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, the pixel area included in the third face frame and the fourth face frame The pixel area included in the face frame can be used as the first face area, but it involves the scene of queuing for body temperature detection such as security check. Generally speaking, the closer you are to the temperature measuring device, the larger the corresponding face area will be. . Therefore, the pixel point area contained in the larger face frame in the third face frame and the fourth face frame is taken as the first face area, and the temperature measuring device performs the following steps in the process of executing step 23:
步骤24、将上述第三人脸框和上述第四人脸框中大小测度最大的人脸框包含的像素点区域作为上述第一人脸区域;上述第三人脸框的大小测度为上述第三人脸框的边长的最大值;上述第四人脸框的大小测度为上述第四人脸框的边长的最大值; Step 24, taking the pixel area contained in the face frame with the largest size measure in the above-mentioned third face frame and the above-mentioned fourth face frame as the above-mentioned first face area; the size measurement of the above-mentioned third face frame is the above-mentioned No. The maximum value of the side length of the three-person face frame; the size measurement of the above-mentioned fourth face frame is the maximum value of the side length of the above-mentioned fourth face frame;
在一些可能实现的方式中,涉及排队测温的场景,排队时越靠前的人在测温装置的显示界面呈现出对应的人脸区域越大。因此,在待处理图像中存在多个人 脸框的情况下,选取多个人脸框中最大的人脸框包含的像素点区域作为第一人脸区域。每个人脸框的大小测度为人脸框的边长的最大值。因此,先得到上述待处理图像中的多个人脸框中每一个人脸框的边长的最大值,然后选出大小测度最大的人脸框。In some possible implementations, involving queuing for temperature measurement, the front person in the queue shows a larger corresponding face area on the display interface of the temperature measurement device. Therefore, when there are multiple face frames in the image to be processed, the pixel area contained in the largest face frame in the multiple face frames is selected as the first face area. The size of each face frame is measured as the maximum side length of the face frame. Therefore, the maximum value of the side length of each face frame in the multiple face frames in the above image to be processed is obtained first, and then the face frame with the largest size measurement is selected.
一种可能的实现方式中,至少一个第一人脸框中存在两个人脸框,使得这两个人脸框之间的重叠率小于或等于重叠率阈值,设这两个人脸框为第三人脸框和第四人脸框。在第三人脸框的边长最大值大于第四人脸框的边长最大值的情况下,将第三人脸框包含的像素点区域作为第一人脸区域。举例说明,第三人脸框的长度为40像素,宽度为45像素。那么第三人脸框的大小测度为45像素。第四人脸框的长度为36像素,宽度为32像素。那么第四人脸框的大小测度为36像素。因为第三人脸框的大小测度为45像素,第四人脸框的大小测度为36像素。第三人脸框的大小测度大于第四人脸框的大小测度,因此将第三人脸框包含的像素点区域作为上述第一人脸区域。In a possible implementation manner, there are two face frames in at least one first face frame, so that the overlap ratio between the two face frames is less than or equal to the overlap ratio threshold, and the two face frames are set as the third person. Face frame and fourth person face frame. When the maximum side length of the third face frame is greater than the maximum side length of the fourth face frame, the pixel area included in the third face frame is used as the first face area. For example, the length of the third face frame is 40 pixels and the width is 45 pixels. Then the size measurement of the third face frame is 45 pixels. The fourth face frame has a length of 36 pixels and a width of 32 pixels. Then the size measurement of the fourth face frame is 36 pixels. Because the size measure of the third face frame is 45 pixels, the size measure of the fourth face frame is 36 pixels. The size measure of the third face frame is greater than the size measure of the fourth face frame, so the pixel area included in the third face frame is used as the first face area.
又一种可能的实现方式中,至少一个第一人脸框中存在两个人脸框包含的像素点区域的分辨率大于分辨率阈值,且这两个人脸框之间的重叠率均小于或等于重叠率阈值,设这两个人脸框为第三人脸框和第四人脸框。在第三人脸框的边长最大值大于第四人脸框的边长最大值的情况下,将第三人脸框包含的像素点区域作为第一人脸区域。举例说明,第三人脸框的长度为40像素,宽度为45像素。那么第三人脸框的大小测度为45像素。第四人脸框的长度为36像素,宽度为32像素。那么第四人脸框的大小测度为36像素。因为第三人脸框的大小测度为45像素,第四人脸框的大小测度为36像素。第三人脸框的大小测度大于第四人脸框的大小测度,因此将第三人脸框包含的像素点区域作为上述第一人脸区域。In another possible implementation manner, the resolution of the pixel area contained in two face frames in at least one first face frame is greater than the resolution threshold, and the overlap ratio between the two face frames is less than or equal to Overlap rate threshold, set the two face frames as the third face frame and the fourth face frame. When the maximum side length of the third face frame is greater than the maximum side length of the fourth face frame, the pixel area included in the third face frame is used as the first face area. For example, the length of the third face frame is 40 pixels and the width is 45 pixels. Then the size measurement of the third face frame is 45 pixels. The fourth face frame has a length of 36 pixels and a width of 32 pixels. Then the size measurement of the fourth face frame is 36 pixels. Because the size measure of the third face frame is 45 pixels, the size measure of the fourth face frame is 36 pixels. The size measure of the third face frame is greater than the size measure of the fourth face frame, so the pixel area included in the third face frame is used as the first face area.
需要理解的是,本公开实施例只给出了两个人脸框中选取最大人脸框的实施方式,但该方式同样适用于从数量大于2的人脸框中选取最大人脸框,本公开实施例对人脸框的数量不做限定。作为一种可选的实施方式,测温装置在执行步骤103的过程中执行以下步骤:It should be understood that the embodiment of the present disclosure only provides an implementation manner of selecting the largest face frame from two face frames, but this method is also applicable to selecting the largest face frame from the number of face frames greater than 2. The present disclosure The embodiment does not limit the number of face frames. As an optional implementation manner, the temperature measuring device performs the following steps in the process of performing step 103:
步骤31、基于上述单应性矩阵和包含上述第一人脸区域的人脸框的四个角点,从上述温度热力图中确定与上述四个角点对应的四个像素点。Step 31: Based on the above-mentioned homography matrix and the four corner points of the face frame including the above-mentioned first face region, determine four pixel points corresponding to the above-mentioned four corner points from the above-mentioned temperature heat map.
在一些可能实现的方式中,上述待处理图像中测温对象的人脸框的四个角点的坐标包含第一角点坐标,根据上述单应性矩阵和上述四个角点的坐标,得到温度热力图中对应的四个像素点的坐标。通过上述方法,对每台测温装置进行正方形卡片标定得到的单应性矩阵是3x3的矩阵。假设人脸框的四个角点的坐标分别为第一角点坐标(a1,b1)、第二角点坐标(a2,b2)、第三角点坐标(a3,b3)、第四角点坐标(a4,b4),通过四个角点的坐标和单应性矩阵,得到的四个像素点的坐标分别是第一坐标(x1,y1)、第二坐标(x2,y2)、第三坐标(x3,y3)、第四坐标(x4,y4)。In some possible implementations, the coordinates of the four corners of the face frame of the temperature measurement object in the image to be processed include the coordinates of the first corner, and according to the homography matrix and the coordinates of the four corners, we obtain The coordinates of the corresponding four pixel points in the temperature heat map. Through the above method, the homography matrix obtained by performing square card calibration on each temperature measuring device is a 3x3 matrix. Assume that the coordinates of the four corners of the face frame are the coordinates of the first corner (a1, b1), the coordinates of the second corner (a2, b2), the coordinates of the third corner (a3, b3), and the coordinates of the fourth corner. (a4, b4), through the coordinates of the four corner points and the homography matrix, the coordinates of the four pixel points obtained are the first coordinates (x1, y1), the second coordinates (x2, y2), and the third coordinates. (x3, y3), the fourth coordinate (x4, y4).
需要理解的是,与通过第一角点坐标(a1,b1)和单应性矩阵H,得到第一坐标(x1,y1)的过程类似。那么,通过第二角点坐标(a2,b2)和单应性矩阵H,可以得到第二坐标(x2,y2);通过第三角点坐标(a3,b3)和单应性矩阵H,可以得到第三坐标(x3,y3);通过第四角点坐标(a4,b4)和单应性矩阵H, 可以得到第四坐标(x4,y4)。It should be understood that the process of obtaining the first coordinates (x1, y1) is similar to the process of obtaining the first coordinates (x1, y1) through the first corner coordinates (a1, b1) and the homography matrix H. Then, through the second corner coordinates (a2, b2) and the homography matrix H, the second coordinates (x2, y2) can be obtained; through the third corner coordinates (a3, b3) and the homography matrix H, we can obtain The third coordinates (x3, y3); the fourth coordinates (x4, y4) can be obtained through the fourth corner coordinates (a4, b4) and the homography matrix H.
步骤32、基于由上述四个像素点确定的四边形区域,确定上述第二人脸区域。Step 32: Determine the second face area based on the quadrilateral area determined by the four pixel points.
在一些可能实现的方式中,上述四个像素点是是温度热力图上的点,将这四个像素点作为四边形的四个顶点,可以得到一个四边形区域。温度热力图中的每个像素点都携带对应像素点的温度信息。可选的,温度热力图由测温装置上的红外热成像设备采集得到。测温装置得到在温度热力图上的四边形区域,将四边形区域作为第二人脸区域,即与第一人脸区域对应的像素点区域。In some possible implementations, the above four pixel points are points on the temperature heat map, and a quadrilateral area can be obtained by using these four pixel points as the four vertices of a quadrilateral. Each pixel in the temperature heat map carries the temperature information of the corresponding pixel. Optionally, the temperature heat map is collected by an infrared thermal imaging device on the temperature measuring device. The temperature measuring device obtains a quadrilateral area on the temperature heat map, and uses the quadrilateral area as the second face area, that is, the pixel point area corresponding to the first face area.
作为一种可选的实施方式,测温装置在执行步骤32的过程中执行以下步骤:As an optional implementation manner, the temperature measuring device performs the following steps in the process of performing step 32:
获取上述四边形区域的对角线的交点;将第一点与上述交点之间的距离作为第一距离;上述第一点为上述四个像素点中距离上述交点最近的像素点;以上述交点为圆心、上述第一距离为半径,构建第一区域;确定上述第一区域和上述四边形区域的交集,得到第二区域;Obtain the intersection point of the diagonal lines of the quadrilateral area; take the distance between the first point and the intersection point as the first distance; the first point is the pixel point closest to the intersection point among the four pixel points; the intersection point is The center of the circle and the above-mentioned first distance are the radius, and the first area is constructed; the intersection of the above-mentioned first area and the above-mentioned quadrilateral area is determined to obtain the second area;
从上述第二区域中选取包含上述交点的区域作为上述第二人脸区域;From the above-mentioned second area, select the area including the above-mentioned intersection as the above-mentioned second face area;
在一些可能实现的方式中,通过单应性矩阵和RGB图像的人脸框的四个角点的坐标,得到温度热力图中的四个像素点的坐标。温度热力图中的由四个像素点确定的四边形区域,如果直接将四边形区域作为第二人脸区域,第二人脸区域的像素点可能会存在除第一人脸区域对应的像素点以外的其他区域对应的像素点,会造成对测量对象的测温结果的准确度有所下降。需要理解的是,本公开实施例涉及单人近距离测温,因此四边形区域的中间部分可能是第一人脸区域的一部分。因此,要从四边形区域包含的像素点区域确定与第一人脸区域准确对应的区域,其中,四边形区域的对角线的交点对应的像素点可能是与第一人脸区域对应的一个像素点。In some possible implementations, the coordinates of the four pixels in the temperature heat map are obtained through the homography matrix and the coordinates of the four corners of the face frame of the RGB image. In the quadrilateral area determined by four pixels in the temperature heat map, if the quadrilateral area is directly used as the second face area, the pixels in the second face area may exist other than those corresponding to the first face area. Pixels corresponding to other areas will cause a decrease in the accuracy of the temperature measurement results of the measurement object. It should be understood that the embodiment of the present disclosure involves a single-person short-range temperature measurement, so the middle part of the quadrilateral area may be a part of the first face area. Therefore, it is necessary to determine an area exactly corresponding to the first face area from the pixel area included in the quadrilateral area, wherein the pixel corresponding to the intersection of the diagonal lines of the quadrilateral area may be a pixel corresponding to the first face area .
确定四个像素点与交点的距离,将距离交点最近的点记为第一点,将第一点和交点之间的距离作为第一距离。第一区域是以交点为圆心,第一距离为半径的区域。但是第一区域包含的像素点区域可能大于四边形包含的像素点区域。因此,从第一区域中选取第二区域,第二区域为第一区域与四边形区域包含的像素点区域的重叠区域。构建的第二区域为四边形区域的中间部分的区域。Determine the distance between the four pixel points and the intersection point, record the point closest to the intersection point as the first point, and take the distance between the first point and the intersection point as the first distance. The first area is an area with the intersection as the center and the first distance as the radius. However, the pixel area contained in the first area may be larger than the pixel area contained in the quadrilateral. Therefore, a second area is selected from the first area, and the second area is an overlapping area of the pixel point area included in the first area and the quadrilateral area. The second area constructed is the area of the middle part of the quadrangular area.
在测温模组采用的是根据温度热力图中与第一人脸区域对应的像素点区域的任意一部分的温度,得到上述待处理图像的测温对象的温度的情况下,需要确定的是这部分像素点区域大概率是与第一人脸区域对应的区域。可以确定的是,四边形区域的中间部分的区域是与第一人脸区域对应的像素点区域,也就是构建的第二区域大概率是与第一人脸区域对应的像素点区域。从上述第二区域中选取包含上述交点的区域作为上述第二人脸区域,能够提高测温结果的准确度。When the temperature measurement module adopts the temperature of any part of the pixel area corresponding to the first face area in the temperature heat map to obtain the temperature of the temperature measurement object of the above image to be processed, it is necessary to determine this Part of the pixel area has a high probability of being the area corresponding to the first face area. It can be determined that the area in the middle part of the quadrilateral area is the pixel area corresponding to the first face area, that is, the constructed second area is likely to be the pixel area corresponding to the first face area. Selecting an area including the intersection point from the second area as the second face area can improve the accuracy of the temperature measurement result.
一种可能的实现方式中,将交点对应的像素点作为第二人脸区域。In a possible implementation manner, the pixels corresponding to the intersection points are used as the second face region.
又一种可能的实现方式中,将第二区域的最大内接圆形包含的像素点区域或者最大内接矩形包含的像素点区域作为第二人脸区域。In another possible implementation manner, the pixel point area included in the largest inscribed circle of the second area or the pixel point area included in the largest inscribed rectangle is used as the second face area.
又一种可能的实现方式中,将第二区域中以交点为圆心的最大内接圆形包含的像素点区域作为第二人脸区域。In another possible implementation manner, the pixel point area included in the largest inscribed circle with the intersection as the center in the second area is used as the second face area.
作为一种可选的实施方式,测温装置在执行步骤32的过程中执行以下步骤:As an optional implementation manner, the temperature measuring device performs the following steps in the process of performing step 32:
获取上述四边形区域的对角线的交点;确定上述四边形区域的最大内接区域;上述最大内接区域为包含上述交点的矩形区域或圆形区域;将上述最大内接区域作为上述第二人脸区域;Obtain the intersection of the diagonal lines of the quadrilateral area; determine the maximum inscribed area of the quadrilateral area; the above-mentioned maximum inscribed area is a rectangular area or a circular area including the above-mentioned intersection point; The above-mentioned largest inscribed area is used as the above-mentioned second face area;
在一些可能实现的方式中,通过单应性矩阵和RGB图像的人脸框的四个角点的坐标,可以得到温度热力图中的四个像素点的坐标。温度热力图中的由四个像素点确定的四边形区域。可以确定的是,四边形区域的对角线的交点对应的像素点可能是与第一人脸区域对应的其中一个像素点。因为本公开实施例涉及单人近距离测温,根据测温装置中RGB成像设备和红外成像设备之间的位置关系以及单应性矩阵的映射关系,对四边形区域截取包含交点的最大内接矩形区域或者最大内接圆形区域,能包含第一人脸区域在温度热力图对应的像素点区域。通过上述的单应性矩阵和四个角点坐标,得到的四个像素点的坐标,进而求解出最大内接矩形区域或最大内接圆形区域。那么,这个最大内接矩形区域或者最大内接圆形区域就是温度热力图中的第二人脸区域。In some possible implementations, the coordinates of the four pixels in the temperature heat map can be obtained through the homography matrix and the coordinates of the four corners of the face frame of the RGB image. The quadrilateral area defined by four pixels in the temperature heatmap. It can be determined that the pixel point corresponding to the intersection of the diagonal lines of the quadrilateral area may be one of the pixel points corresponding to the first face area. Because the embodiment of the present disclosure involves single-person short-range temperature measurement, according to the positional relationship between the RGB imaging device and the infrared imaging device in the temperature measurement device and the mapping relationship of the homography matrix, the largest inscribed rectangle containing the intersection point is intercepted from the quadrilateral area. The area or the largest inscribed circular area can contain the pixel area corresponding to the first face area in the temperature heat map. Through the above homography matrix and the coordinates of the four corner points, the coordinates of the four pixel points are obtained, and then the largest inscribed rectangular area or the largest inscribed circular area is obtained. Then, the largest inscribed rectangular area or the largest inscribed circular area is the second face area in the temperature heat map.
一种可能的确定最大内接区域的形状是圆形的实现方式中,设四边形区域的四个像素点为A、B、C、D,设交点为E。那么四边形区域的四条边为AB、BD、CD、AC。分别计算交点E到AB、BD、CD、AC的距离。设距离交点最近的边为AB,将AB与交点E的距离记为第二距离。以上述交点为圆心,第二距离为半径确定的圆形包含的像素点区域为最大内接区域。In a possible implementation manner in which the shape of the maximum inscribed area is determined to be a circle, the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Calculate the distances from the intersection point E to AB, BD, CD, and AC, respectively. Let the edge closest to the intersection point be AB, and record the distance between AB and the intersection point E as the second distance. Taking the above-mentioned intersection as the center of the circle and the second distance as the radius, the pixel area contained in the circle is the largest inscribed area.
又一种可能的确定最大内接区域的形状是圆形的实现方式中,设四边形区域的四个像素点为A、B、C、D,设交点为E。那么四边形区域的四条边为AB、BD、CD、AC。在AB上找一点A*,使得A*E垂直AB;在BD上找一点B*,使得B*E垂直BD;在CD上找一点C*,使C*E垂直CD;在AC上找一点D*,使得D*E垂直AC。将点D*和点B*之间的距离作为第三距离,将点A*和点C*之间的距离作为第四距离。比较第三距离和第四距离的大小,假设第三距离小于第四距离,取第三距离对应的连线D*B*的中点为F,取第三距离的一半为第五距离。以中点F为圆心,第五距离为半径确定的圆形包含的像素点区域为最大内接区域。In another possible implementation manner in which the shape of the maximum inscribed area is determined to be a circle, the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Find a point A* on AB so that A*E is perpendicular to AB; find a point B* on BD so that B*E is perpendicular to BD; find a point C* on CD so that C*E is perpendicular to CD; find a point on AC D*, such that D*E is perpendicular to AC. The distance between point D* and point B* is taken as the third distance, and the distance between point A* and point C* is taken as the fourth distance. Compare the size of the third distance and the fourth distance, assuming that the third distance is smaller than the fourth distance, take the midpoint of the connection line D*B* corresponding to the third distance as F, and take half of the third distance as the fifth distance. Taking the midpoint F as the center of the circle and the fifth distance as the radius, the pixel area contained in the circle is the largest inscribed area.
又一种可能的确定最大内接区域的形状是圆形的实现方式中,设四边形区域的四个像素点为A、B、C、D,设交点为E。那么四边形区域的四条边为AB、BD、CD、AC。在AB上找一点A*,使得A*E垂直AB;在BD上找一点B*,使得B*E垂直BD;在CD上找一点C*,使C*E垂直CD;在AC上找一点D*,使得D*E垂直AC。将点D*和点B*之间的距离作为第三距离,将点A*和点C*之间的距离作为第四距离。设A*C*和B*D*的交点为G,比较第三距离和第四距离的大小,假设第三距离小于第四距离,取第三距离的一半为第五距离。以中点G为圆心,第五距离为半径确定的圆形包含的像素点区域为最大内接区域。In another possible implementation manner in which the shape of the maximum inscribed area is determined to be a circle, the four pixel points of the quadrilateral area are set as A, B, C, and D, and the intersection point is set as E. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Find a point A* on AB so that A*E is perpendicular to AB; find a point B* on BD so that B*E is perpendicular to BD; find a point C* on CD so that C*E is perpendicular to CD; find a point on AC D*, such that D*E is perpendicular to AC. The distance between point D* and point B* is taken as the third distance, and the distance between point A* and point C* is taken as the fourth distance. Let the intersection of A*C* and B*D* be G, compare the size of the third distance and the fourth distance, assuming that the third distance is less than the fourth distance, take half of the third distance as the fifth distance. Taking the midpoint G as the center of the circle, and the fifth distance as the radius, the pixel area contained in the circle is the largest inscribed area.
一种可能的确定最大内接区域的形状是矩形的实现方式中,设四边形区域的四个像素点为A、B、C、D。那么四边形区域的四条边为AB、BD、CD、AC。假设AB是四边形区域的四条边里面最短的边。那么,在CD上找一点H,使得HA垂直AB;在CD上找一点I,使得IB垂直AB。然后在BI上找一点J,使得HJ垂直BI。因为A、B、I、H四个像素点围成的四边形区域有三个直角,四边 形ABIH就是矩形。矩形ABIH包含的像素点区域为最大内接区域。In a possible implementation manner in which the shape of the maximum inscribed area is determined to be a rectangle, the four pixels of the quadrilateral area are set as A, B, C, and D. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Suppose AB is the shortest of the four sides of the quadrilateral area. Then, find a point H on CD so that HA is perpendicular to AB; find a point I on CD so that IB is perpendicular to AB. Then find a little J on BI so that HJ is perpendicular to BI. Because the quadrilateral area enclosed by the four pixels A, B, I, and H has three right angles, the quadrilateral ABIH is a rectangle. The pixel area contained in the rectangle ABIH is the largest inscribed area.
又一种可能的确定最大内接区域的形状是矩形的实现方式中,设四边形区域的四个像素点为A、B、C、D,设交点为E。计算EA、EB、EC和ED的长度,设EA的长度是最短的。在BE上找一点K,使得EK的长度等于EA的长度;在DE上找一点L,使得EL的长度等于EA的长度;在CE上找一点M,使得EM的长度等于EA的长度。也就是说,EK=EA=EL=EM,E是线段KM的中点,E点同时也是线段AL的中点。因为A、K、L、M四个像素点围成的四边形区域的对角线相等,且被点E平分,四边形AKLM就是矩形。矩形AKLM包含的像素点区域为最大内接区域。In another possible implementation manner in which the shape of the largest inscribed region is determined to be a rectangle, the four pixel points of the quadrilateral region are set as A, B, C, and D, and the intersection point is set as E. Calculate the lengths of EA, EB, EC and ED, and let the length of EA be the shortest. Find a point K on BE so that the length of EK equals the length of EA; find a point L on DE so that the length of EL equals the length of EA; find a point M on CE so that the length of EM equals the length of EA. That is to say, EK=EA=EL=EM, E is the midpoint of the line segment KM, and point E is also the midpoint of the line segment AL. Because the diagonals of the quadrilateral area enclosed by the four pixels A, K, L, and M are equal and bisected by the point E, the quadrilateral AKLM is a rectangle. The pixel area contained in the rectangle AKLM is the largest inscribed area.
又一种可能的确定最大内接区域的形状是矩形的实现方式中,设四边形区域的四个像素点为A、B、C、D。那么四边形区域的四条边为AB、BD、CD、AC。取AB的中点为N;取BD的中点为O;取CD的中点为P;取AC的中点为R。因为任意四边形的中点围成的四边形是平行四边形。也就是四边形NOPR是平行四边形。其中,PN和OR为平行四边形NOPR对应的两条对角线,两条对角线的交点为S。取PN线段和OR线段中较短的对角线。举例说明,当PN的长度小于OR的长度的情况下,将PN作为矩形区域的对角线,其中,NS的长度等于SP的长度。在SO上找一点T,使得TS的长度等于NS的长度;在SR上找一点U,使得SU的长度等于NS的长度。也就是说NS=SP=TS=SU,S是线段PN的中点,S点同时也是线段UT的中点。因为N、P、T、U四个像素点围成的四边形区域的对角线相等,且被点S平分,四边形NPTU就是矩形。矩形NPTU包含的像素点区域为最大内接区域。In another possible implementation manner in which the shape of the maximum inscribed area is determined to be a rectangle, the four pixels of the quadrilateral area are set as A, B, C, and D. Then the four sides of the quadrilateral area are AB, BD, CD, and AC. Take the midpoint of AB as N; take the midpoint of BD as O; take the midpoint of CD as P; take the midpoint of AC as R. Because the quadrilateral enclosed by the midpoints of any quadrilateral is a parallelogram. That is, the quadrilateral NOPR is a parallelogram. Among them, PN and OR are the two diagonals corresponding to the parallelogram NOPR, and the intersection of the two diagonals is S. Take the shorter diagonal of the PN line segment and the OR line segment. For example, when the length of PN is less than the length of OR, PN is taken as the diagonal of the rectangular area, where the length of NS is equal to the length of SP. Find a point T on SO, so that the length of TS is equal to the length of NS; find a point U on SR, so that the length of SU is equal to the length of NS. That is to say, NS=SP=TS=SU, S is the midpoint of the line segment PN, and point S is also the midpoint of the line segment UT. Because the diagonals of the quadrilateral area enclosed by the four pixels N, P, T, and U are equal and bisected by the point S, the quadrilateral NPTU is a rectangle. The pixel area contained in the rectangular NPTU is the largest inscribed area.
作为一种可选的实施方式,为了获得准确的测温对象的温度,需要在温度热力图中准确找到第二人脸区域。因此,测温装置在确定上述四边形区域的最大内接区域的过程中执行以下步骤:As an optional implementation manner, in order to obtain an accurate temperature of the temperature measurement object, it is necessary to accurately find the second face region in the temperature heat map. Therefore, the temperature measuring device performs the following steps in the process of determining the maximum inscribed area of the above quadrilateral area:
从上述四个像素点的横坐标中选取第二大的横坐标,得到第一横坐标;从上述四个像素点的横坐标中选取第三大的横坐标,得到第二横坐标;从上述四个像素点的纵坐标中选取第二大的纵坐标,得到第一纵坐标;从上述四个像素点的纵坐标中选取第三大的纵坐标,得到第二纵坐标;基于上述第一横坐标和上述第一纵坐标确定第二点;基于上述第一横坐标和上述第二纵坐标确定第三点;基于上述第二横坐标和上述第一纵坐标确定第四点;基于上述第二横坐标和上述第二纵坐标确定第五点;将由上述第二点、上述第三点、上述第四点和上述第五点确定的区域,作为上述最大内接区域;Select the second largest abscissa from the abscissas of the above four pixels to obtain the first abscissa; select the third largest abscissa from the abscissas of the above four pixels to obtain the second abscissa; from the above Select the second largest ordinate from the ordinates of the four pixel points to obtain the first ordinate; select the third largest ordinate from the ordinates of the above four pixels to obtain the second ordinate; The abscissa and the first ordinate determine the second point; the third point is determined based on the first abscissa and the second ordinate; the fourth point is determined based on the second abscissa and the first ordinate; The second abscissa and the second ordinate determine the fifth point; the area determined by the second point, the third point, the fourth point and the fifth point is used as the maximum inscribed area;
在一些可能实现的方式中,设四个像素点分别为A、B、C、D。其中,A的坐标为(X1,Y1);B的坐标为(X2,Y2);C的坐标为(X3,Y3);D的坐标为(X4,Y4)。对X1、X2、X3、X4进行排序,对Y1、Y2、Y3、Y4进行排序。假设X1>X2>X3>X4,那么第一横坐标为X2,第二横坐标为X3。假设Y1>Y2>Y3>Y4,那么第一纵坐标为Y2,第二纵坐标为Y3。第二点的坐标为(X2,Y2),第三点的坐标为(X2,Y3),第四点的坐标为(X3,Y2),第五点的坐标为(X3,Y3)。根据第二点、第三点、第四点以及第五点的坐标关系,可以确定将第二点、第三点、第四点以及第五点依次连接所得到四边形区域是矩形区域。 将上述得到的矩形区域作为上述最大内接区域。作为一种可选的实施方式,为了进一步提高测温的准确性,测温装置将第一人脸区域的额头区域的温度作为测温对象的温度,测温装置在执行步骤104的过程中执行以下步骤:In some possible implementations, the four pixel points are set as A, B, C, and D, respectively. Among them, the coordinates of A are (X1, Y1); the coordinates of B are (X2, Y2); the coordinates of C are (X3, Y3); the coordinates of D are (X4, Y4). Sort X1, X2, X3, X4, sort Y1, Y2, Y3, Y4. Assuming X1>X2>X3>X4, then the first abscissa is X2, and the second abscissa is X3. Assuming that Y1>Y2>Y3>Y4, then the first ordinate is Y2, and the second ordinate is Y3. The coordinates of the second point are (X2, Y2), the coordinates of the third point are (X2, Y3), the coordinates of the fourth point are (X3, Y2), and the coordinates of the fifth point are (X3, Y3). According to the coordinate relationship of the second point, the third point, the fourth point and the fifth point, it can be determined that the quadrilateral area obtained by sequentially connecting the second point, the third point, the fourth point and the fifth point is a rectangular area. Let the rectangular area obtained above be the above-mentioned maximum inscribed area. As an optional implementation manner, in order to further improve the accuracy of temperature measurement, the temperature measurement device uses the temperature of the forehead region of the first face region as the temperature of the temperature measurement object, and the temperature measurement device executes in the process of performing step 104 The following steps:
步骤41、对上述第一人脸区域进行额头检测,得到上述第一人脸区域的额头检测结果;Step 41: Perform forehead detection on the above-mentioned first face area, and obtain the forehead detection result of the above-mentioned first face area;
在一些可能实现的方式中,对上述第一人脸区域进行额头检测,得到检测结果包括:第一人脸区域中的人物的额头处于遮挡状态或第一人脸区域中的人物的额头处于未遮挡状态。In some possible implementation manners, performing forehead detection on the first face area, and obtaining a detection result includes: the forehead of the person in the first face area is in a blocked state or the forehead of the person in the first face area is in the unblocked state. occlusion state.
在一些可能实现的方式中,测温装置对第一人脸区域进行第一特征提取处理,得到第一特征数据,其中,第一特征数据携带第一人脸区域中的人物的额头是否处于遮挡状态的信息。测温装置基于额头检测得到的第一特征数据,得到检测结果。In some possible implementations, the temperature measurement device performs a first feature extraction process on the first face region to obtain first feature data, wherein the first feature data carries whether the forehead of the person in the first face region is blocked status information. The temperature measuring device obtains the detection result based on the first characteristic data obtained by the forehead detection.
可选的,第一特征提取处理可通过额头检测网络实现。通过将至少一张带有标注信息的第一训练图像作为训练数据,对深度卷积神经网络进行训练可得到额头检测网络,其中,标注信息包括第一训练图像中的人物的额头是否处于遮挡的状态。Optionally, the first feature extraction process may be implemented by a forehead detection network. A forehead detection network can be obtained by training a deep convolutional neural network by using at least one first training image with label information as training data, wherein the label information includes whether the forehead of the person in the first training image is occluded. state.
本公开实施例对额头检测采用的方式不做限定。The embodiments of the present disclosure do not limit the manner used for forehead detection.
步骤42、在上述第一人脸区域的额头检测结果为上述第一人脸区域中的额头区域处于未被遮挡的情况下,基于第三人脸区域包含的像素点的温度,得到上述测温对象的温度;上述第三人脸区域为上述第二人脸区域中与上述额头区域对应的区域;Step 42: In the case where the forehead detection result of the first face region is that the forehead region in the first face region is not blocked, obtain the temperature measurement based on the temperature of the pixels included in the third face region. The temperature of the object; the above-mentioned third face area is the area corresponding to the above-mentioned forehead area in the above-mentioned second face area;
在一些可能实现的方式中,在上述第一人脸区域的额头检测结果为上述第一人脸区域中的额头区域处于未被遮挡的情况下,从温度热力图中先找到第三人脸区域。第三人脸区域是第二人脸区域中与上述第一人脸区域中的额头区域对应的像素点区域。一般来说,额头区域位于整个人脸区域的上30%~40%的部分。也就是说,第三人脸区域是第二人脸区域的上30%~40%的部分。基于温度热力图中第三人脸区域包含的像素点的温度,得到与第一人脸区域对应的测温对象的温度。在上述第一人脸区域的额头检测结果为上述第一人脸区域中的额头区域处于被遮挡的情况下,输出需要露出额头的提示信息。In some possible implementations, when the forehead detection result of the first face region is that the forehead region in the first face region is not blocked, first find the third face region from the temperature heat map . The third face area is a pixel area in the second face area that corresponds to the forehead area in the first face area. Generally speaking, the forehead area is located in the upper 30% to 40% of the entire face area. That is to say, the third face area is the upper 30% to 40% of the second face area. Based on the temperature of the pixels included in the third face region in the temperature heat map, the temperature of the temperature measurement object corresponding to the first face region is obtained. In the case that the forehead detection result of the first face region is that the forehead region in the first face region is blocked, prompt information that the forehead needs to be exposed is output.
一种可能实现的方式中,测温装置放置在室内,将上述第三人脸区域的像素点区域的温度平均值,作为测温对象的温度。例如,第三人脸区域的像素点包括:像素点a和像素点b。其中,像素点a所对应的温度为36.9度,像素点b所对应的温度为36.3度。测温装置可将像素点a所对应的温度和像素点b所对应的温度的平均值(36.6度)作为测温对象的温度。In a possible implementation manner, the temperature measurement device is placed indoors, and the average temperature of the pixel area of the third face area is used as the temperature of the temperature measurement object. For example, the pixel points of the third face region include: pixel point a and pixel point b. Among them, the temperature corresponding to the pixel point a is 36.9 degrees, and the temperature corresponding to the pixel point b is 36.3 degrees. The temperature measurement device can take the average value (36.6 degrees) of the temperature corresponding to the pixel point a and the temperature corresponding to the pixel point b as the temperature of the temperature measurement object.
在又一种可能的实现方式中,测温装置将第三人脸区域中像素点所对应的温度最高值,作为测温对象的温度。例如,第三人脸区域的像素点包括:像素点a、像素点b和像素点c,其中,像素点a所对应的温度为36.9度,像素点b所对应的温度为36.3度,像素点c对应的温度为37度。测温装置可将像素点a所对应的温度、像素点b所对应的温度和像素点c所对应的温度的最高值(37度)作为测温对象的温度。In another possible implementation manner, the temperature measuring device uses the highest temperature value corresponding to the pixel point in the third face region as the temperature of the temperature measuring object. For example, the pixels in the third face area include: pixel a, pixel b, and pixel c, where the temperature corresponding to pixel a is 36.9 degrees, the temperature corresponding to pixel b is 36.3 degrees, and the temperature corresponding to pixel a is 36.3 degrees. c corresponds to a temperature of 37 degrees. The temperature measurement device can take the temperature corresponding to the pixel point a, the temperature corresponding to the pixel point b, and the maximum value (37 degrees) of the temperature corresponding to the pixel point c as the temperature of the temperature measurement object.
又一种可能的实现方式中,测温装置放置在室外,可能会存在太阳直射的情况。又因为第三人脸区域可能含有与太阳直射区域对应的像素点区域。如果将太阳直射区域对应的像素点的温度与实际人脸区域的温度求平均值,作为上述待处理图像中测温对象的温度,那么就会有比较大的误差。太阳直射的温度在50度左右,人体能忍受的温度一般在45度以下。因此,读取第三人脸区域的像素点区域的每个像素点的温度,将温度高于45度的像素点排除,对温度低于45度的像素点的温度求平均值作为上述待处理图像中测温对象的温度。In another possible implementation manner, the temperature measuring device is placed outdoors and may be exposed to direct sunlight. And because the third face area may contain pixel area corresponding to the direct sun area. If the temperature of the pixel point corresponding to the direct sunlight area and the temperature of the actual face area are averaged as the temperature of the temperature measurement object in the above image to be processed, there will be a relatively large error. The temperature of direct sunlight is about 50 degrees, and the temperature that the human body can tolerate is generally below 45 degrees. Therefore, read the temperature of each pixel in the pixel area of the third face area, exclude the pixels whose temperature is higher than 45 degrees, and average the temperature of the pixels whose temperature is lower than 45 degrees as the above-mentioned pending processing The temperature of the thermometric object in the image.
需要理解的是,本公开实施例中还可以将第三人脸区域包含的一部分像素点的温度的平均值作为测温对象的温度,又或者是将第三人脸区域包含的一部分像素点的温度的最高值作为测温对象的温度,本公开实施例不做限定。It should be understood that, in the embodiment of the present disclosure, the average value of the temperature of a part of the pixel points included in the third face area may be used as the temperature of the temperature measurement object, or the temperature of a part of the pixel points included in the third face area may be used. The highest value of the temperature is used as the temperature of the temperature measurement object, which is not limited in the embodiment of the present disclosure.
本领域技术人员可以理解,在上述各个实施例提供的方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that, in the methods provided by the above embodiments, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the execution order of each step should be based on its functions and possible Internal logic is determined.
上述详细阐述了本公开实施例的方法,下面提供了本公开实施例的装置。The methods of the embodiments of the present disclosure are described in detail above, and the apparatuses of the embodiments of the present disclosure are provided below.
请参阅图2,图2为本公开实施例提供的一种测温装置的结构示意图,该测温装置1包括:获取部分11、检测部分12、第一处理部分13、第二处理部分14,其中:Please refer to FIG. 2. FIG. 2 is a schematic structural diagram of a temperature measurement device according to an embodiment of the present disclosure. The temperature measurement device 1 includes: an acquisition part 11, a detection part 12, a first processing part 13, and a second processing part 14, in:
获取部分11,被配置为获取待处理图像、温度热力图以及所述温度热力图和所述待处理图像之间的单应性矩阵;an acquisition part 11, configured to acquire an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image;
检测部分12,被配置为对所述待处理图像进行人脸检测,得到第一人脸区域;The detection part 12 is configured to perform face detection on the to-be-processed image to obtain a first face area;
第一处理部分13,被配置为基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;The first processing part 13 is configured to determine the pixel area corresponding to the first face area from the temperature heat map based on the homography matrix to obtain a second face area;
第二处理部分14,被配置为基于所述第二人脸框包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。The second processing part 14 is configured to determine the temperature of the temperature measurement object corresponding to the first face area based on the temperature of the pixels included in the second face frame.
在一些可能实现的方式中,所述第一处理部分13,还被配置为:In some possible implementation manners, the first processing part 13 is further configured to:
基于所述单应性矩阵和包含所述第一人脸区域的人脸框的四个角点,从所述温度热力图中确定与所述四个角点对应的四个像素点;Based on the homography matrix and the four corner points of the face frame including the first face region, determine four pixel points corresponding to the four corner points from the temperature heat map;
基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域。The second face area is determined based on the quadrilateral area determined by the four pixel points.
在一些可能实现的方式中,所述检测部分12,还被配置为:In some possible implementations, the detection part 12 is further configured to:
对所述待处理图像进行人脸检测,得到至少一个第一人脸框;performing face detection on the to-be-processed image to obtain at least one first face frame;
将所述至少一个第一人脸框中的第二人脸框包含的像素点区域作为所述第一人脸区域;所述第二人脸框包含的像素点区域的分辨率大于分辨率阈值的人脸框。The pixel area included in the second face frame in the at least one first face frame is used as the first face area; the resolution of the pixel area included in the second face frame is greater than the resolution threshold face frame.
在一些可能实现的方式中,所述第一人脸框的数量大于1,所述至少一个第一人脸框包括第三人脸框和第四人脸框;In some possible implementations, the number of the first face frames is greater than 1, and the at least one first face frame includes a third face frame and a fourth face frame;
所述检测部分12,还被配置为:The detection part 12 is also configured to:
在所述第三人脸框和所述第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域。In the case that the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, any one of the third face frame and the fourth face frame is The pixel area included in the face frame is used as the first face area.
在一些可能实现的方式中,所述检测部分12,还被配置为:In some possible implementations, the detection part 12 is further configured to:
将所述第三人脸框和所述第四人脸框中大小测度最大的人脸框包含的像素点区域,作为所述第一人脸区域;所述第三人脸框的大小测度为所述第三人脸框的边长的最大值;所述第四人脸框的大小测度为所述第四人脸框的边长的最大值。The pixel area contained in the face frame with the largest size measure in the third face frame and the fourth face frame is taken as the first face area; the size measure of the third face frame is The maximum value of the side length of the third face frame; the size measurement of the fourth face frame is the maximum value of the side length of the fourth face frame.
在一些可能实现的方式中,所述第二处理部分14,还被配置为:In some possible implementation manners, the second processing part 14 is further configured to:
对所述第一人脸区域进行额头检测,得到所述第一人脸区域的额头检测结果;performing forehead detection on the first face region to obtain a forehead detection result of the first face region;
在所述第一人脸区域的额头检测结果为所述第一人脸区域中的额头区域处于未被遮挡的情况下,基于第三人脸区域包含的像素点的温度,得到所述测温对象的温度;所述第三人脸区域为所述第二人脸区域中与所述额头区域对应的区域。When the forehead detection result of the first face area is that the forehead area in the first face area is not blocked, the temperature measurement is obtained based on the temperature of the pixels included in the third face area The temperature of the object; the third face region is the region corresponding to the forehead region in the second face region.
在一些可能实现的方式中,所述第一处理部分13,还被配置为:获取所述四边形区域的对角线的交点;将第一点与所述交点之间的距离作为第一距离;所述第一点为所述四个像素点中距离所述交点最近的像素点;以所述交点为圆心、所述第一距离为半径,构建第一区域;确定所述第一区域和所述四边形区域的交集,得到第二区域;从所述第二区域中选取包含所述交点的区域作为所述第二人脸区域。In some possible implementation manners, the first processing part 13 is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; take the distance between the first point and the intersection as the first distance; The first point is the pixel point closest to the intersection point among the four pixel points; taking the intersection point as the center of the circle and the first distance as the radius, a first area is constructed; The intersection of the quadrilateral areas is obtained to obtain a second area; the area including the intersection is selected from the second area as the second face area.
在一些可能实现的方式中,所述第一处理部分13,还被配置为:获取所述四边形区域的对角线的交点;确定所述四边形区域的最大内接区域;所述最大内接区域为包含所述交点的矩形区域或圆形区域;将所述最大内接区域作为所述第二人脸区域。In some possible implementation manners, the first processing part 13 is further configured to: obtain the intersection of the diagonal lines of the quadrilateral area; determine the maximum inscribed area of the quadrilateral area; the maximum inscribed area is a rectangular area or a circular area including the intersection point; the largest inscribed area is taken as the second face area.
在一些可能实现的方式中,所述第一处理部分13,还被配置为:从所述四个像素点的横坐标中选取第二大的横坐标得到第一横坐标,从所述四个像素点的横坐标中选取第三大的横坐标得到第二横坐标,从所述四个像素点的纵坐标中选取第二大的纵坐标得到第一纵坐标,从所述四个像素点的纵坐标中选取第三大的纵坐标得到第二纵坐标;基于所述第一横坐标和所述第一纵坐标确定第二点,基于所述第一横坐标和所述第二纵坐标确定第三点,基于所述第二横坐标和所述第一纵坐标确定第四点,基于所述第二横坐标和所述第二纵坐标确定第五点;将由所述第二点、所述第三点、所述第四点和所述第五点确定的区域,作为所述最大内接区域。In some possible implementation manners, the first processing part 13 is further configured to: select the second largest abscissa from the abscissas of the four pixel points to obtain the first abscissa, and obtain the first abscissa from the abscissas of the four pixels. From the abscissa of the pixel point, select the third largest abscissa to obtain the second abscissa, select the second largest ordinate from the ordinate of the four pixel points to obtain the first ordinate, and obtain the first ordinate from the four pixel points. Select the third largest ordinate to obtain the second ordinate; determine the second point based on the first abscissa and the first ordinate, and determine the second point based on the first abscissa and the second ordinate A third point is determined, a fourth point is determined based on the second abscissa and the first ordinate, and a fifth point is determined based on the second abscissa and the second ordinate; the second point, The area determined by the third point, the fourth point and the fifth point is used as the maximum inscribed area.
在一些可能实现的方式中,测温装置通过对待处理图像进行人脸检测,可准确的从待处理图像中确定测温对象的人脸区域得到第一人脸区域。基于待处理图像与温度热力图之间的单应性矩阵以及第一人脸区域在待处理图像中的位置,从温度热力图中确定测温对象的人脸区域,可提高从温度热力图中确定的测温对象的人脸区域的准确度,得到第二人脸区域。这样,测温装置再基于第二人脸区域的温度得到测温对象的温度,可提高测温对象的温度的准确度。In some possible implementations, the temperature measuring device can accurately determine the face region of the temperature measurement object from the to-be-processed image by performing face detection on the to-be-processed image to obtain the first face region. Based on the homography matrix between the image to be processed and the temperature heat map and the position of the first face region in the image to be processed, determining the face region of the temperature measurement object from the temperature heat map can improve the performance from the temperature heat map. Determine the accuracy of the face area of the temperature measurement object to obtain a second face area. In this way, the temperature measurement device obtains the temperature of the temperature measurement object based on the temperature of the second face region, which can improve the accuracy of the temperature measurement object.
在一些可能实现的方式中,本公开实施例提供的装置具有的功能或包含的部分可以被配置为执行上文方法实施例描述的方法,其实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some possible implementation manners, the functions or included parts of the apparatus provided in the embodiments of the present disclosure may be configured to execute the methods described in the above method embodiments, and for implementation, reference may be made to the descriptions in the above method embodiments, for the sake of brevity , which will not be repeated here.
图3为本公开实施例提供的一种测温装置的硬件结构示意图。该测温装置2包括处理器21,存储器22,输入装置23,输出装置24。该处理器21、存储器22、输入装置23和输出装置24通过连接器相耦合,该连接器包括各类接口、传 输线或总线等等,本公开实施例对此不作限定。应当理解,本公开的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。FIG. 3 is a schematic diagram of a hardware structure of a temperature measuring device according to an embodiment of the present disclosure. The temperature measuring device 2 includes a processor 21 , a memory 22 , an input device 23 , and an output device 24 . The processor 21, the memory 22, the input device 23, and the output device 24 are coupled through a connector, and the connector includes various types of interfaces, transmission lines, or buses, etc., which are not limited in this embodiment of the present disclosure. It should be understood that, in various embodiments of the present disclosure, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, and buses.
处理器21可以是一个或多个图形处理器(graphics processing unit,GPU),在处理器21是一个GPU的情况下,该GPU可以是单核GPU,也可以是多核GPU。可选的,处理器21可以是多个GPU构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。可选的,该处理器还可以为其他类型的处理器等等,本公开实施例不作限定。The processor 21 may be one or more graphics processing units (graphics processing units, GPUs). In the case where the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses. Optionally, the processor may also be another type of processor, etc., which is not limited in this embodiment of the present disclosure.
存储器22可被配置为存储计算机程序指令,以及被配置为执行本公开实施例方案的程序代码在内的各类计算机程序代码。可选地,存储器包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器被配置为相关指令及数据。The memory 22 may be configured to store computer program instructions, as well as various types of computer program code, including program code configured to execute aspects of the embodiments of the present disclosure. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM) ), or a portable disc read-only memory (CD-ROM), which is configured for associated instructions and data.
输入装置23被配置为输入数据和/或信号,以及输出装置24被配置为输出数据和/或信号。输入装置23和输出装置24可以是独立的器件,也可以是一个整体的器件。The input device 23 is configured to input data and/or signals, and the output device 24 is configured to output data and/or signals. The input device 23 and the output device 24 may be independent devices or may be an integral device.
可理解,在一些可能实现的方式中,存储器22不仅可以存储相关指令,还可以存储相关数据,如该存储器22可以存储通过输入装置23获取的待处理图像和温度热力图,又或者该存储器22还可以存储通过处理器21得到的测温对象的温度等等,本公开实施例对于该存储器中所存储的数据不作限定。It can be understood that, in some possible implementation manners, the memory 22 can not only store relevant instructions, but also store relevant data. For example, the memory 22 can store the image to be processed and the temperature heat map obtained through the input device 23 , or the memory 22 The temperature of the temperature measurement object obtained through the processor 21 and the like may also be stored, and the data stored in the memory is not limited in this embodiment of the present disclosure.
可以理解的是,图3仅仅示出了测温装置的简化设计。在实际应用中,测温装置还可以分别包含必要的其他元件,包含但不限于任意数量的输入/输出装置、处理器、存储器等,而所有可以实现本公开实施例的测温装置都在本公开实施例的保护范围之内。It can be understood that FIG. 3 only shows a simplified design of the temperature measuring device. In practical applications, the temperature measurement device may also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all temperature measurement devices that can implement the embodiments of the present disclosure are included in this disclosure. within the scope of the disclosed embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的部分及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开实施例的范围。Those of ordinary skill in the art can realize that the parts and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the disclosed embodiments.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和部分的工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。所属领域的技术人员还可以清楚地了解到,本公开各个实施例描述各有侧重,为描述的方便和简洁,相同或类似的部分在不同实施例中可能没有赘述,因此,在某一实施例未描述或未详细描述的部分可以参见其他实施例的记载。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the working process of the above-described system, device and part, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here. Those skilled in the art can also clearly understand that the description of each embodiment of the present disclosure has its own emphasis. For the convenience and brevity of the description, the same or similar parts may not be repeated in different embodiments. Therefore, in a certain embodiment For the parts that are not described or not described in detail, reference may be made to the descriptions of other embodiments.
在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述部分的划分,仅仅为一种逻辑功能划分,实际实现的过程中可以有另外的划分方式,例如多个部分或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合 或通信连接可以是通过一些接口,装置或部分的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present disclosure, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the parts is only a logical function division, and there may be other division methods in the actual implementation process, for example, multiple parts or components may be divided into Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or parts, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的部分可以是或者也可以不是物理上分开的,作为部分显示的部件可以是或者也可以不是物理部分,即可以位于一个地方,或者也可以分布到多个网络部分上。可以根据实际的需要选择其中的部分或者全部部分来实现本实施例方案的目的。The parts described as separate parts may or may not be physically separated, and the parts shown as parts may or may not be physical parts, that is, they may be located in one place, or may be distributed over multiple network parts. Some or all of them may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本公开各个实施例中的各功能部分可以集成在一个处理部分中,也可以是各个部分单独物理存在,也可以两个或两个以上部分集成在一个部分中。In addition, each functional part in each embodiment of the present disclosure may be integrated into one processing part, or each part may exist physically alone, or two or more parts may be integrated into one part.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。在使用软件实现的情况下,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令的情况下,全部或部分地产生按照本公开实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. In the case of implementation in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the embodiments of the present disclosure are produced in whole or in part. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions can be sent from a website site, computer, server, or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) another website site, computer, server or data center for transmission. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital versatile disc (DVD)), or semiconductor media (eg, solid state disk (SSD) ))Wait.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行的过程中,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器(read-only memory,ROM)或随机存储存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented, and the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium. The process may include the flow of each method embodiment described above. The aforementioned storage medium includes: read-only memory (read-only memory, ROM) or random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
工业实用性Industrial Applicability
本公开实施例提供了一种测温方法及装置、电子设备及存储介质。该方法包括:获取待处理图像、温度热力图以及所述温度热力图和所述待处理图像之间的单应性矩阵;对所述待处理图像进行人脸检测,得到第一人脸区域;基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;基于所述第二人脸区域包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。可准确的从待处理图像中确定测温对象的人脸区域得到第一人脸区域,提高从温度热力图中确定的测温对象的人脸区域的准确度,进而可提高测温对象的温度的准确度。Embodiments of the present disclosure provide a temperature measurement method and device, an electronic device, and a storage medium. The method includes: acquiring an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image; performing face detection on the to-be-processed image to obtain a first face region; The pixel area corresponding to the first face area is determined from the temperature heat map based on the homography matrix to obtain a second face area; based on the temperature of the pixels included in the second face area , and determine the temperature of the temperature measurement object corresponding to the first face region. It can accurately determine the face area of the temperature measurement object from the image to be processed to obtain the first face area, improve the accuracy of the temperature measurement object's face area determined from the temperature thermogram, and then improve the temperature of the temperature measurement object. accuracy.

Claims (14)

  1. 一种测温方法,所述方法包括:A temperature measurement method, the method comprising:
    获取待处理图像、温度热力图以及所述温度热力图和所述待处理图像之间的单应性矩阵;acquiring an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image;
    对所述待处理图像进行人脸检测,得到第一人脸区域;performing face detection on the to-be-processed image to obtain a first face region;
    基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;Determine the pixel area corresponding to the first face area from the temperature heat map based on the homography matrix to obtain a second face area;
    基于所述第二人脸区域包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。Based on the temperature of the pixel points included in the second face area, the temperature of the temperature measurement object corresponding to the first face area is determined.
  2. 根据权利要求1所述方法,其中,所述基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域,包括:The method according to claim 1, wherein the determining a pixel region corresponding to the first face region from the temperature heat map based on the homography matrix to obtain a second face region, comprising:
    基于所述单应性矩阵和包含所述第一人脸区域的人脸框的四个角点,从所述温度热力图中确定与所述四个角点对应的四个像素点;Based on the homography matrix and the four corner points of the face frame including the first face region, determine four pixel points corresponding to the four corner points from the temperature heat map;
    基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域。The second face area is determined based on the quadrilateral area determined by the four pixel points.
  3. 根据权利要求1或2所述方法,其中,所述对所述待处理图像进行人脸检测,得到第一人脸区域,包括:The method according to claim 1 or 2, wherein the performing face detection on the to-be-processed image to obtain the first face region comprises:
    对所述待处理图像进行人脸检测,得到至少一个第一人脸框;performing face detection on the to-be-processed image to obtain at least one first face frame;
    将所述至少一个第一人脸框中的第二人脸框包含的像素点区域作为所述第一人脸区域;所述第二人脸框为所述至少一个第一人脸框中包含的像素点区域的分辨率大于分辨率阈值的人脸框。The pixel point area included in the second face frame in the at least one first face frame is used as the first face area; the second face frame is the at least one first face frame contained in the first face frame The resolution of the pixel area is greater than the resolution threshold of the face frame.
  4. 根据权利要求3所述的方法,其中,所述第一人脸框的数量大于1,所述至少一个第一人脸框包括第三人脸框和第四人脸框;The method of claim 3, wherein the number of the first face frames is greater than 1, and the at least one first face frame includes a third face frame and a fourth face frame;
    所述将所述至少一个第一人脸框中的第二人脸框包含的像素点区域作为所述第一人脸区域,包括:The pixel point area included in the second face frame in the at least one first face frame is used as the first face area, including:
    在所述第三人脸框和所述第四人脸框之间的重叠率小于或等于重叠率阈值的情况下,将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域。In the case that the overlap ratio between the third face frame and the fourth face frame is less than or equal to the overlap ratio threshold, any one of the third face frame and the fourth face frame is The pixel area included in the face frame is used as the first face area.
  5. 根据权利要求4所述方法,其中,所述将所述第三人脸框和所述第四人脸框中任意一个人脸框包含的像素点区域,作为所述第一人脸区域,包括:The method according to claim 4, wherein the pixel point area included in any one of the third face frame and the fourth face frame as the first face area, comprising: :
    将所述第三人脸框和所述第四人脸框中大小测度最大的人脸框包含的像素点区域,作为所述第一人脸区域;所述第三人脸框的大小测度为所述第三人脸框的边长的最大值;所述第四人脸框的大小测度为所述第四人脸框的边长的最大值。The pixel area contained in the face frame with the largest size measure in the third face frame and the fourth face frame is taken as the first face area; the size measure of the third face frame is The maximum value of the side length of the third face frame; the size measurement of the fourth face frame is the maximum value of the side length of the fourth face frame.
  6. 根据权利要求1至5任一项所述方法,其中,所述基于所述第二人脸区域包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度,包括:The method according to any one of claims 1 to 5, wherein the determining the temperature of the temperature measurement object corresponding to the first face region based on the temperature of the pixel points included in the second face region comprises: :
    对所述第一人脸区域进行额头检测,得到所述第一人脸区域的额头检测结果;performing forehead detection on the first face region to obtain a forehead detection result of the first face region;
    在所述第一人脸区域的额头检测结果为所述第一人脸区域中的额头区域处于未被遮挡的情况下,基于第三人脸区域包含的像素点的温度,得到所述测温对象的温度;所述第三人脸区域为所述第二人脸区域中与所述额头区域对应的区域。When the forehead detection result of the first face area is that the forehead area in the first face area is not blocked, the temperature measurement is obtained based on the temperature of the pixels included in the third face area The temperature of the object; the third face region is the region corresponding to the forehead region in the second face region.
  7. 根据权利要求2至6任一项所述方法,其中,所述基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域,包括:The method according to any one of claims 2 to 6, wherein the determining the second face region based on the quadrilateral region determined by the four pixel points comprises:
    获取所述四边形区域的对角线的交点;obtain the intersection of the diagonals of the quadrilateral area;
    将第一点与所述交点之间的距离作为第一距离;所述第一点为所述四个像素点中距离所述交点最近的像素点;Taking the distance between the first point and the intersection point as the first distance; the first point is the pixel point closest to the intersection point among the four pixel points;
    以所述交点为圆心、所述第一距离为半径,构建第一区域;Constructing the first region with the intersection as the center and the first distance as the radius;
    确定所述第一区域和所述四边形区域的交集,得到第二区域;determining the intersection of the first area and the quadrilateral area to obtain a second area;
    从所述第二区域中选取包含所述交点的区域作为所述第二人脸区域。A region including the intersection point is selected from the second region as the second face region.
  8. 根据权利要求2至6任一项所述方法,其中,所述基于由所述四个像素点确定的四边形区域,确定所述第二人脸区域,包括:The method according to any one of claims 2 to 6, wherein the determining the second face region based on the quadrilateral region determined by the four pixel points comprises:
    获取所述四边形区域的对角线的交点;obtain the intersection of the diagonals of the quadrilateral area;
    确定所述四边形区域的最大内接区域;所述最大内接区域为包含所述交点的矩形区域或圆形区域;determining the largest inscribed area of the quadrilateral area; the largest inscribed area is a rectangular area or a circular area including the intersection;
    将所述最大内接区域作为所述第二人脸区域。The largest inscribed area is used as the second face area.
  9. 根据权利要求8所述方法,其中,所述确定所述四边形区域的最大内接区域,包括:9. The method of claim 8, wherein the determining a maximum inscribed area of the quadrilateral area comprises:
    从所述四个像素点的横坐标中选取第二大的横坐标得到第一横坐标,从所述四个像素点的横坐标中选取第三大的横坐标得到第二横坐标,从所述四个像素点的纵坐标中选取第二大的纵坐标得到第一纵坐标,从所述四个像素点的纵坐标中选取第三大的纵坐标得到第二纵坐标;Select the second largest abscissa from the abscissas of the four pixels to obtain the first abscissa, select the third largest abscissa from the abscissas of the four pixels to obtain the second abscissa, and obtain the second abscissa from all the abscissas. From the vertical coordinates of the four pixel points, the second largest vertical coordinate is selected to obtain the first vertical coordinate, and the third largest vertical coordinate is selected from the vertical coordinates of the four pixel points to obtain the second vertical coordinate;
    基于所述第一横坐标和所述第一纵坐标确定第二点,基于所述第一横坐标和所述第二纵坐标确定第三点,基于所述第二横坐标和所述第一纵坐标确定第四点,基于所述第二横坐标和所述第二纵坐标确定第五点;A second point is determined based on the first abscissa and the first ordinate, a third point is determined based on the first abscissa and the second ordinate, and a third point is determined based on the second abscissa and the first The ordinate determines the fourth point, and the fifth point is determined based on the second abscissa and the second ordinate;
    将由所述第二点、所述第三点、所述第四点和所述第五点确定的区域,作为所述最大内接区域。The area determined by the second point, the third point, the fourth point and the fifth point is taken as the maximum inscribed area.
  10. 一种测温装置,所述装置包括:A temperature measuring device comprising:
    获取部分,被配置为获取待处理图像、温度热力图以及所述温度热力图和所述待处理图像之间的单应性矩阵;an acquisition part, configured to acquire an image to be processed, a temperature heat map, and a homography matrix between the temperature heat map and the to-be-processed image;
    检测部分,被配置为对所述待处理图像进行人脸检测,得到第一人脸区域;a detection part, configured to perform face detection on the to-be-processed image to obtain a first face region;
    第一处理部分,被配置为基于所述单应性矩阵从所述温度热力图中确定与所述第一人脸区域对应的像素点区域,得到第二人脸区域;a first processing part, configured to determine a pixel area corresponding to the first face area from the temperature heat map based on the homography matrix to obtain a second face area;
    第二处理部分,被配置为基于所述第二人脸框包含的像素点的温度,确定与所述第一人脸区域对应的测温对象的温度。The second processing part is configured to determine the temperature of the temperature measurement object corresponding to the first face area based on the temperature of the pixels included in the second face frame.
  11. 一种处理器,所述处理器被配置为执行如权利要求1至9中任一项所述的方法。A processor configured to perform the method of any of claims 1 to 9.
  12. 一种电子设备,包括:处理器和存储器,所述存储器被配置为存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备执行如权利要求1至9中任一项所述的方法。An electronic device comprising: a processor and a memory, the memory configured to store computer program code, the computer program code comprising computer instructions, the electronic device when the processor executes the computer instructions A method as claimed in any one of claims 1 to 9 is performed.
  13. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行权利要求1至9中任一项所述的方法。A computer-readable storage medium storing a computer program in the computer-readable storage medium, the computer program comprising program instructions, which, when the program instructions are executed by a processor, cause the processor to execute the claims The method of any one of 1 to 9.
  14. 一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子 设备中运行的情况下,所述电子设备中的处理器执行用于实现权利要求1至9中任一项所述的方法。A computer program, comprising computer-readable codes, when the computer-readable codes are run in an electronic device, a processor in the electronic device executes the code for realizing any one of claims 1 to 9 Methods.
PCT/CN2021/098352 2020-10-23 2021-06-04 Temperature measurement method and apparatus, electronic device, and storage medium WO2022083130A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011148359.5A CN112287798A (en) 2020-10-23 2020-10-23 Temperature measuring method and device, electronic equipment and storage medium
CN202011148359.5 2020-10-23

Publications (1)

Publication Number Publication Date
WO2022083130A1 true WO2022083130A1 (en) 2022-04-28

Family

ID=74423805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098352 WO2022083130A1 (en) 2020-10-23 2021-06-04 Temperature measurement method and apparatus, electronic device, and storage medium

Country Status (3)

Country Link
CN (1) CN112287798A (en)
TW (1) TWI779801B (en)
WO (1) WO2022083130A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287798A (en) * 2020-10-23 2021-01-29 深圳市商汤科技有限公司 Temperature measuring method and device, electronic equipment and storage medium
CN113063500B (en) * 2021-03-30 2022-04-22 新疆爱华盈通信息技术有限公司 Face temperature measurement method, face temperature measurement instrument and storage medium
CN114136462A (en) * 2021-11-25 2022-03-04 深圳市商汤科技有限公司 Calibration method and device, electronic equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501681B1 (en) * 2015-07-14 2016-11-22 A9.Com, Inc. Decoding visual codes
CN109960974A (en) * 2017-12-22 2019-07-02 北京市商汤科技开发有限公司 Face critical point detection method, apparatus, electronic equipment and storage medium
CN111339951A (en) * 2020-02-26 2020-06-26 北京迈格威科技有限公司 Body temperature measuring method, device and system
CN111507200A (en) * 2020-03-26 2020-08-07 北京迈格威科技有限公司 Body temperature detection method, body temperature detection device and dual-optical camera
CN111626125A (en) * 2020-04-26 2020-09-04 浙江大华技术股份有限公司 Face temperature detection method, system and device and computer equipment
CN112287798A (en) * 2020-10-23 2021-01-29 深圳市商汤科技有限公司 Temperature measuring method and device, electronic equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101789078B (en) * 2010-03-01 2012-07-18 江西财经大学 Robust infrared face recognition technology
CN105868733A (en) * 2016-04-21 2016-08-17 腾讯科技(深圳)有限公司 Face in-vivo validation method and device
CN107967677B (en) * 2017-12-15 2020-02-04 Oppo广东移动通信有限公司 Image processing method, image processing device, computer-readable storage medium and computer equipment
CN109446981B (en) * 2018-10-25 2023-03-24 腾讯科技(深圳)有限公司 Face living body detection and identity authentication method and device
CN109856979B (en) * 2018-12-21 2022-03-25 深圳云天励飞技术有限公司 Environment adjusting method, system, terminal and medium
CN109745014B (en) * 2018-12-29 2022-05-17 江苏云天励飞技术有限公司 Temperature measurement method and related product
CN110248107A (en) * 2019-06-13 2019-09-17 Oppo广东移动通信有限公司 Image processing method and device
CN110276308B (en) * 2019-06-25 2021-11-16 上海商汤智能科技有限公司 Image processing method and device
CN110879972B (en) * 2019-10-24 2022-07-26 深圳云天励飞技术有限公司 Face detection method and device
CN111414831B (en) * 2020-03-13 2022-08-12 深圳市商汤科技有限公司 Monitoring method and system, electronic device and storage medium
CN111426388A (en) * 2020-03-31 2020-07-17 高新兴科技集团股份有限公司 Personnel body temperature measuring method, system, computer storage medium and electronic equipment
CN111623885B (en) * 2020-06-01 2021-09-14 上海闻泰电子科技有限公司 Infrared temperature measuring device and infrared temperature measuring method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501681B1 (en) * 2015-07-14 2016-11-22 A9.Com, Inc. Decoding visual codes
CN109960974A (en) * 2017-12-22 2019-07-02 北京市商汤科技开发有限公司 Face critical point detection method, apparatus, electronic equipment and storage medium
CN111339951A (en) * 2020-02-26 2020-06-26 北京迈格威科技有限公司 Body temperature measuring method, device and system
CN111507200A (en) * 2020-03-26 2020-08-07 北京迈格威科技有限公司 Body temperature detection method, body temperature detection device and dual-optical camera
CN111626125A (en) * 2020-04-26 2020-09-04 浙江大华技术股份有限公司 Face temperature detection method, system and device and computer equipment
CN112287798A (en) * 2020-10-23 2021-01-29 深圳市商汤科技有限公司 Temperature measuring method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112287798A (en) 2021-01-29
TWI779801B (en) 2022-10-01
TW202217647A (en) 2022-05-01

Similar Documents

Publication Publication Date Title
WO2022083130A1 (en) Temperature measurement method and apparatus, electronic device, and storage medium
US7733404B2 (en) Fast imaging system calibration
CN107256377B (en) Method, device and system for detecting object in video
TWI752466B (en) Image processing method, processor, electronic device, and storage medium
WO2019238114A1 (en) Three-dimensional dynamic model reconstruction method, apparatus and device, and storage medium
WO2022095596A1 (en) Image alignment method, image alignment apparatus and terminal device
CN112669344A (en) Method and device for positioning moving object, electronic equipment and storage medium
WO2022237811A1 (en) Image processing method and apparatus, and device
WO2022252737A1 (en) Image processing method and apparatus, processor, electronic device, and storage medium
JP7255173B2 (en) Human detection device and human detection method
WO2019128504A1 (en) Method and apparatus for image processing in billiards game, and terminal device
CN112001886A (en) Temperature detection method, device, terminal and readable storage medium
WO2023029969A1 (en) Image processing method and apparatus, and electronic device and computer-readable storage medium
CN108492284B (en) Method and apparatus for determining perspective shape of image
US20220058824A1 (en) Method and apparatus for image labeling, electronic device, storage medium, and computer program
WO2022247126A1 (en) Visual localization method and apparatus, and device, medium and program
JP7188067B2 (en) Human detection device and human detection method
WO2022246605A1 (en) Key point calibration method and apparatus
WO2024022301A1 (en) Visual angle path acquisition method and apparatus, and electronic device and medium
CN111739086A (en) Method and device for measuring area, electronic equipment and storage medium
TWI735367B (en) Speed measurement method, electronic equipment and storage medium
WO2022198822A1 (en) Camera orientation calibration method and apparatus, device, storage medium, and program
WO2022156319A1 (en) Camera movement detection method and device, electronic device, storage medium, and program
JP7338174B2 (en) Object detection device and object detection method
CN115362481A (en) Motion blur robust image feature descriptors

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21881553

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21881553

Country of ref document: EP

Kind code of ref document: A1