Detailed description of the invention
In the following description, in order to make reader understand the application better, many ins and outs have been proposed.But, persons of ordinary skill in the art may appreciate that even without these ins and outs and the many variations based on following embodiment and amendment, also can realize the each claim of the application technical scheme required for protection.
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiments of the present invention are described in further detail.
First embodiment of the invention relates to a kind of Human Height measuring method based on binocular vision technology.Fig. 1 is the schematic flow sheet of this Human Height measuring method based on binocular vision technology.
As shown in Figure 1, should the Human Height measuring method based on binocular vision technology comprise the following steps:
In step 101, utilize binocular camera photographed scene image, obtain the image coordinate of the number of people cusp of human body target in scene image.
Before implementation step 101, setting height(from bottom) and the setting angle of reply binocular camera are demarcated, and setting angle comprises the angle of pitch and the inclination angle of binocular camera.
Specifically, in the step that the setting height(from bottom) to binocular camera and setting angle are demarcated, comprise following sub-step:
Utilize rule to measure scene ground and arrive the vertical dimension of camera as the setting height(from bottom) of binocular camera.
Utilize binocular camera to capture the image of target multiple location points in scene of known altitude.
Obtain binocular camera and capture the depth information of many groups diverse location point target of image.
Structure minimization problem, solve the angle of pitch and the inclination angle of one group of binocular camera, make to utilize the variance minimum of the actual height of object height that this Human Height measuring method based on binocular vision technology tries to achieve and target, finally obtain the binocular camera angle of pitch of one group of optimum and the inclination angle angle of pitch and the inclination angle as binocular camera.
Setting height(from bottom) to binocular camera and the demarcation of angle parameter, can improve the precision that height is measured, effective compensation measurement error.The angle of pitch of camera and inclination angle are difficult to measure by instrument, utilize the method that multiple known altitude fixed points are set just can estimate the angle of pitch and the inclination angle of camera, and precision are higher.
It should be noted that, in each method embodiment of the present invention, the step of demarcating of the setting height(from bottom) to binocular camera and setting angle only need be carried out once, to obtain setting height(from bottom) and the setting angle of optimum binocular camera, does not need to repeat to demarcate in measurement afterwards again.
In addition, be appreciated that in some other embodiment of the present invention, also can take other demarcation mode, and not as limit.
Further, in the step of image coordinate of number of people cusp of obtaining human body target in scene image, comprise following sub-step:
Utilize the number of people detector that training in advance is good to detect the scene image of taking;
Obtain the number of people area data in number of people detection block region;
Calculate the gradient map of number of people area data;
On the basis of the gradient map of number of people area data, extract outline point, utilize the best circle of circle matching searching and outline point degree of fitting as the sharp circular arc of the number of people;
Position using the peak of number of people point circular arc as number of people cusp, determines the image coordinate of this number of people cusp.
In addition, be appreciated that in some other embodiment of the present invention, also can obtain by another way the image coordinate of the number of people cusp of human body target in scene image, and not be limited with the method for mentioning in present embodiment.
After this enter step 102, obtain according to the image coordinate of this number of people cusp depth information corresponding to number of people cusp that binocular camera generates.
After this enter step 103, calculate the world coordinates of number of people cusp under camera coordinate system.
Calculating in the step of the world coordinates of number of people cusp under camera coordinate system, be the depth information that utilizes this number of people cusp corresponding, in conjunction with the internal and external parameter of binocular camera, calculate the world coordinates of number of people cusp under camera coordinate system, computing formula is as follows:
In formula, Xleftfor number of people cusp is in left image and the deviation of image center, Xrightfor number of people cusp is in right image and the deviation of image center; Y is the along slope coordinate of number of people cusp in left image, and the along slope coordinate of impact point in two images of left and right is identical; F is the lens focus of binocular camera; B is the base length of binocular camera; P (xc, yc, zc) be that number of people cusp is at the world coordinates under camera coordinate system.
After this enter step 104, according to the world coordinates of number of people cusp, with the angle of pitch of binocular camera, inclination angle, measure the height of human body target.
Preferably, measure equation is:the angle of pitch that in formula, θ is binocular camera,for inclination angle; Hcamfor the setting height(from bottom) of binocular camera, Hstafor the height of human body target, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
In addition, measure equation can be also:the angle of pitch that in formula, θ is binocular camera,for inclination angle; Hcamfor the setting height(from bottom) of binocular camera, Hstafor the height of human body target, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
In addition, be appreciated that in the present invention, measure equation includes but not limited to these two.
After this process ends.
Human Height based on binocular vision technology is measured, and the method coordinates without personnel, just can complete height and measure in the measurable range that only needs station to take to camera, can measure the height of multiple human body targets, and certainty of measurement is higher simultaneously.
Each method embodiment of the present invention all can be realized in modes such as software, hardware, firmwares.No matter the present invention realizes with software, hardware or firmware mode, instruction code can be stored in the memorizer of computer-accessible of any type (for example permanent or revisable, volatibility or non-volatile, solid-state or non-solid-state, fixing or removable medium etc.).Equally, memorizer can be for example programmable logic array (Programmable Array Logic, be called for short " PAL "), random access memory (Random Access Memory, be called for short " RAM "), programmable read only memory (Programmable Read Only Memory, be called for short " PROM "), read only memory (Read-Only Memory, be called for short " ROM "), Electrically Erasable Read Only Memory (Electrically Erasable Programmable ROM, be called for short " EEPROM "), disk, CD, digital versatile disc (Digital Versatile Disc, be called for short " DVD ") etc.
Second embodiment of the invention relates to a kind of Human Height measuring device based on binocular vision technology.Fig. 2 is the structural representation of this Human Height measuring device based on binocular vision technology.
As shown in Figure 2, should comprise by the Human Height measuring device based on binocular vision technology:
Image coordinate acquiring unit, for obtaining the image coordinate of the number of people cusp of human body target from the real-time scene image of taking of binocular camera.
Particularly, this image coordinate acquiring unit further comprises following subelement:
Image detection subelement, utilizes the number of people detector that training in advance is good to detect the scene image of taking.
Data acquisition subelement, for obtaining the number of people area data in number of people detection block region of image detection subelement output.
Gradient map computation subunit, obtains the gradient map of the number of people area data of subelement output for calculating data.
Number of people point circular fitting unit, extracts outline point on the gradient map basis for the number of people area data in the output of gradient map computation subunit, and utilizes circle matching searching and the best circle of outline point degree of fitting as the sharp circular arc of the number of people.
Image coordinate is determined subelement, the final position for the peak of the number of people point circular arc using the output of number of people point circular fitting unit as number of people cusp, and the image coordinate of definite number of people cusp.
In addition, be appreciated that in some other embodiment of the present invention, also can obtain by other frame modes of number of people cusp image coordinate acquiring unit the image coordinate of the number of people cusp of human body target in scene image.
Depth Information Acquistion unit, the image coordinate of the number of people cusp obtaining for the above-mentioned image coordinate acquiring unit of foundation is obtained depth information corresponding to number of people cusp that binocular camera generates.
World coordinates computing unit, the depth information that the number of people cusp that obtains for image coordinate and this Depth Information Acquistion unit of the number of people cusp that obtains according to this image coordinate acquiring unit is corresponding and the internal and external parameter of other binocular cameras, calculate the world coordinates of number of people cusp under camera coordinate system.Computing formula is as follows:
In formula, Xleftfor number of people cusp is in left image and the deviation of image center, Xrightfor number of people cusp is in right image and the deviation of image center; Y is the along slope coordinate of number of people cusp in left image, and the along slope coordinate of impact point in two images of left and right is identical; F is the lens focus of binocular camera; B is the base length of binocular camera; P (xc, yc, zc) be that number of people cusp is at the world coordinates under camera coordinate system.
Height measuring unit, the world coordinates for the number of people cusp that calculates according to described world coordinates computing unit under camera coordinate system, and the angle of pitch of binocular camera, inclination angle, measure the height of human body target.
Preferably, described height measuring unit is in the time measuring the height of human body target, and the measure equation utilizing comprises following two:
Measure equation one is:the angle of pitch that in formula, θ is binocular camera,for inclination angle; Hcamfor the setting height(from bottom) of binocular camera, Hstafor the height of human body target, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
Measure equation two is:the angle of pitch that in formula, θ is binocular camera,for inclination angle; Hcamfor the setting height(from bottom) of binocular camera, Hstafor the height of human body target, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
In addition, also comprise, binocular calibration unit, for demarcating setting height(from bottom) and the setting angle of binocular camera, setting angle comprises the angle of pitch and the inclination angle of binocular camera.
Further, this binocular calibration unit, comprises following subelement:
Highly demarcate subelement, for the setting height(from bottom) of calibration for cameras;
Angle calibration subelement, for the setting angle of calibration for cameras;
Highly demarcate subelement, utilize rule to measure scene ground and arrive the vertical dimension of camera as the setting height(from bottom) of binocular camera;
Angle calibration subelement, utilizes binocular camera to capture the image of target multiple location points in scene of known altitude.Obtain binocular camera and capture the depth information of many groups diverse location point target of image.Structure minimization problem, solve the angle of pitch and the inclination angle of one group of binocular camera, make to utilize the variance minimum of the actual height of object height that this Human Height measuring method based on binocular vision technology tries to achieve and target, finally obtain the binocular camera angle of pitch and the inclination angle value of one group of optimum.
It should be noted that, in each method embodiment of the present invention, the binocular calibration unit of binocular camera is only demarcated in the time of height measurement for the first time, and to obtain setting height(from bottom) and the setting angle of optimum binocular camera, in measurement afterwards, this unit no longer repeats to demarcate.
In addition, be appreciated that in some other embodiment of the present invention, also can take other demarcation unit, and not as limit.
Be somebody's turn to do the Human Height measuring device based on binocular vision technology, coordinate without personnel, in the measurable range of the camera shooting of only need standing, just can complete height and measure, can measure the height of multiple human body targets, and certainty of measurement is higher simultaneously.
The first embodiment is the method embodiment corresponding with present embodiment, present embodiment can with the enforcement of working in coordination of the first embodiment.The correlation technique details of mentioning in the first embodiment is still effective in the present embodiment, in order to reduce repetition, repeats no more here.Correspondingly, the correlation technique details of mentioning in present embodiment also can be applicable in the first embodiment.
Third embodiment of the invention relates to a kind of Human Height measuring method based on binocular vision technology.Fig. 3 is the schematic flow sheet of this Human Height measuring method based on binocular vision technology.
Present embodiment, using binocular camera as hardware, by real-time photographed scene image, is obtained the world coordinates of scene objects point; By processing unit, the world coordinates getting is carried out to analytical calculation in conjunction with setting height(from bottom) and the attitude angle information of binocular camera, complete the Measurement accuracy of Human Height.
As shown in Figure 3, should the Human Height measuring method based on binocular vision technology comprise the following steps:
In step 301, demarcate inner parameter and the external parameter of binocular camera.In the demarcation inner parameter of binocular camera and the step of external parameter, comprise following sub-step:
According to installation site and the angle of monitoring distance and the highly definite binocular camera of monitoring;
Because binocular camera generally adopts tight shot, therefore need according to type selecting, installation site and the setting angle of monitoring distance and the highly definite binocular camera of monitoring, to ensure that the target head part of guarded region middle position divides the center that appears at image.
By stated accuracy higher Zhang Zhengyou scaling method calibration for cameras spin matrix and translation vector, wherein scaling board is chosen chessboard calibration plate or is had the scaling board that other shape spacing are certain.
Camera spin matrix in inner parameter and the external parameter of binocular camera and translation vector can complete demarcation by Zhang Zhengyou scaling method, and stated accuracy is higher, and wherein scaling board is chosen chessboard calibration plate or had the scaling board that other shape spacing are certain.
Setting height(from bottom) and the setting angle of demarcating binocular camera carry out, and wherein setting angle comprises the angle of pitch and the inclination angle of binocular camera;
Remaining parameter is mainly the parameter after binocular camera is installed, and is made up of, because this group parameter is larger on the impact of binocular height certainty of measurement, therefore need strict demarcation the setting height(from bottom) of binocular camera, the angle of pitch and the inclination angle of camera.
The setting height(from bottom) of camera can be passed through rule accurate measuring, and the angle of pitch of camera and inclination angle are difficult to measure by instrument, therefore in present embodiment, have realized a kind of method that can estimate the camera angle of pitch and inclination angle parameter.Fig. 4 is the schematic flow sheet that this binocular camera partial parameters is demarcated, and comprises following sub-step:
In step 401, the vertical dimension of camera is arrived as the setting height(from bottom) of binocular camera in the ground that utilizes rule to measure camera environment of living in the time that binocular camera is installed;
After this enter step 402, utilize target or the people of known altitude, capture the image of its multiple location points in scene with binocular camera;
After this enter step 403, obtain binocular camera and capture the depth information of many groups diverse location point target of image;
After this enter step 404, construct minimization problem, solve pitching angle theta and the inclination angle of one group of binocular cameramake to utilize the height of target that binocular tries to achieve and the variance minimum of the actual height of target, finally obtain the binocular camera angle of pitch and the inclination angle value of one group of optimum.
The setting height(from bottom) of binocular camera need to utilize rule to measure in installing, and it is highly that the ground of this environment is to the vertical dimension of camera; Utilize target or the people of known altitude, capture the image of its multiple location points in scene with binocular camera.Obtain binocular camera and capture the depth information of many groups diverse location point target of image; Construct minimization problem, solve pitching angle theta and the inclination angle of one group of binocular cameramake to utilize the height of target that binocular tries to achieve and the variance minimum of the actual height of target, finally obtain the binocular camera angle of pitch and the inclination angle value of one group of optimum.
After this enter step 302, obtain scene objects depth data.
The depth data of binocular camera is expressed as parallax data, generates by binocular camera is inner.
After this enter step 303, search the image coordinate I (x of number of people cusp in scene imagei, yi), in the step of image coordinate of searching this number of people cusp, comprise following sub-step:
Utilization has trained the number of people detector scene image of taking has been detected;
Obtain the number of people data in number of people detection block region; Calculate the gradient map of number of people area data;
On the basis of number of people region gradient figure, extract outline point, utilize the best circle of circle matching searching and outline point degree of fitting as number of people point circular arc;
Final position using the peak of circular arc as number of people cusp, finally determines the image coordinate I (x of number of people cuspi, yi).
In addition, be appreciated that in some other embodiment of the present invention, also can obtain by another way the image coordinate of the number of people cusp of human body target in scene image.
After this enter step 304, calculate the world coordinates of number of people cusp.
According to the number of people position of cusp coordinate I (x getting in step 303i, yi) and the scene depth figure that generates of binocular camera determine the parallax information that number of people cusp is corresponding, and in conjunction with the internal and external parameter of binocular camera, complete number of people cusp world coordinates P (xc, yc, zc) calculating.
According to depth information corresponding to the number of people cusp of this number of people cusp image coordinate and the generation of above-mentioned binocular camera and other internal and external parameters of binocular camera, complete number of people cusp world coordinates P (xc, yc, zc) calculating, computing formula is as follows:
In formula, Xleftfor number of people cusp is in left image and the deviation of image center, Xrightfor number of people cusp is in right image and the deviation of image center; Y is the along slope coordinate of number of people cusp in left image, and the along slope coordinate of impact point in two images of left and right is identical; F is the lens focus of binocular camera; B is the base length of binocular camera; P (xc, yc, zc) be that number of people cusp is at the world coordinates under camera coordinate system.
After this enter step 305, Human Height is measured.
Fig. 5 is the schematic diagram that in present embodiment, a kind of binocular camera is measured Human Height.
In the time that target is passed through the guarded region of binocular camera, binocular camera is captured target automatically, gets a cusp information of target, utilizes height computing formula to complete the height of human body target is measured.
In this application, enumerate the measure equation of two kinds of binocular cameras measurement Human Heights, but not as limit.
The first Human Height measure equation is as follows:
the angle of pitch that in formula, θ is binocular camera,for inclination angle; Hcamfor the setting height(from bottom) of binocular camera, Hstafor the height of human body target, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
The first formula is the computational methods of being undertaken by geometrical relationship.
The second Human Height measure equation is:
Number of people cusp is transformed into ground level coordinate system at the world coordinates under camera coordinate system.
Set the initial point that the point on ground level is world coordinate system, the point in camera coordinate system is transformed into by Eulerian angles formula under the coordinate system of ground level, the Y value of the target three-dimensional point after conversion is the actual height of target.
The present invention is made as the initial point of world coordinate system at the subpoint of ground level with the initial point of camera coordinate system, the transformational relation of setting up after coordinate system is:
In formula, (X, Y, Z) is the point under world coordinate system, (xc, yc, zc) be the point under camera coordinate system, the actual height of target is Y, expression formula is:
In formula, Y equals Hstafor the height of human body target, the angle of pitch that θ is binocular camera,for inclination angle, Hcamfor the setting height(from bottom) of binocular camera, P (xc, yc, zc) be the world coordinates of number of people cusp under camera coordinate system.
Due tovalue is less in actual applications, therefore by above formulaapproximate processing is 1, can obtain following formula:
After this process ends.
All of the embodiments of the present invention has completed effective measurement of Human Height, should the Human Height measuring method based on binocular vision technology be different from traditional height measurement methods such as the measurement of slide calliper rule formula and ultrasonic measurement, the present invention is that the Human Height carrying out based on technique of binocular stereoscopic vision is measured, require measured personnel's fitness low, can measure many people's height, and certainty of measurement is higher simultaneously.
All of the embodiments of the present invention all can be for the face bayonet socket of public and particular place, and an adeditive attribute using height as personnel targets, for criminal investigation or demographic data statistical analysis; In market for the stronger advertisement putting of specific aim, as carried out intelligent dressing etc. according to personnel's height.
It should be noted that, each unit of mentioning in the each equipment embodiment of the present invention is all logical block, physically, a logical block can be a physical location, also can be a part for a physical location, can also realize with the combination of multiple physical locations, the physics realization mode of these logical blocks itself is not most important, and the combination of the function that these logical blocks realize is only the key that solves technical problem proposed by the invention.In addition, for outstanding innovation part of the present invention, the above-mentioned each equipment embodiment of the present invention is not introduced the unit not too close with solving technical problem relation proposed by the invention, and this does not show that the said equipment embodiment does not exist other unit.
It should be noted that, in the claim and description of this patent, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element that " comprises " and limit by statement, and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Although pass through with reference to some of the preferred embodiment of the invention, the present invention is illustrated and described, but those of ordinary skill in the art should be understood that and can do various changes to it in the form and details, and without departing from the spirit and scope of the present invention.