The content of the invention
The technical problems to be solved by the invention are:A kind of image measuring method based on laser, system and device are provided.
In order to solve the above-mentioned technical problem, the first technical solution for using of the present invention for:
A kind of image measuring method based on laser, including step:
The initial position of S1, default video camera, rotary camera so that shooting area is located at the display area of video camera
It is interior, obtain camera angle of rotation value;
The beam direction that the laser that S2, adjusting are arranged on video camera projects so that the laser in shooting area
Point obtains two dimensional image positioned at the center of the display area of video camera, shooting;
S3, the ranging distance according to laser acquisition video camera to shooting area, are calculated the shift value of video camera;
S4, obtain default intrinsic parameters of the camera, according to camera angle of rotation value, the shift value of video camera and shooting
Machine inner parameter, is calculated the two dimensional image of the shooting area and the mapping relations of D world space;
S5, the coordinate value for obtaining determinand on two dimensional image, substitute into the mapping relations of two dimensional image and D world space
In, measured value of the determinand in D world space is calculated.
The second technical solution that the present invention uses for:
A kind of measuring system of picture based on laser, including rotary module, adjustment module, the first computing module, the second meter
Calculate module and the 3rd computing module;
The rotary module, for presetting the initial position of video camera, rotary camera so that shooting area is positioned at shooting
In the display area of machine, camera angle of rotation value is obtained;
The adjustment module, the beam direction projected for adjusting the laser being arranged on video camera so that positioned at bat
The laser spots taken the photograph in region are located at the center of the display area of video camera, and shooting obtains two dimensional image;
First computing module, for obtaining video camera to the ranging distance of shooting area according to laser, is calculated
The shift value of video camera;
Second computing module, for obtaining default intrinsic parameters of the camera, according to camera angle of rotation value, takes the photograph
The shift value and intrinsic parameters of the camera of camera, are calculated the two dimensional image of the shooting area and reflecting for D world space
Penetrate relation;
3rd computing module, for obtaining the coordinate value of determinand on two dimensional image, substitutes into two dimensional image and three-dimensional
In the mapping relations of world space, measured value of the determinand in D world space is calculated.
The 3rd technical solution that the present invention uses for:
A kind of image measuring apparatus based on laser, including measurement end;The measurement end includes laser, video camera, angle modulation
Device and processor;The laser is arranged on video camera, and the laser, video camera and recliner are connected with processor respectively, institute
State laser and video camera is connected with recliner respectively.
The beneficial effects of the present invention are:A kind of image measuring method based on laser, system and dress provided by the invention
Put, complete the calibration of video camera mapping model by video camera and laser, then reflecting by two dimensional image and D world space
Relation and function is penetrated in view picture two dimensional image, conversion distortion effect is eliminated with this, takes at 2 points so as to appoint in two dimensional image, you can survey
The distance that point-to-point transmission is corresponded in corresponding three-dimensional scene is measured, calibration process is quick, easy, can be flexibly applied to various scenes.It is logical
The method is crossed, no matter when needs to measure the full-size(d) of other determinands on two dimensional image, all only needs by the two dimension
Image, that is, measurable, measures without returning in reality scene, since reality scene is real-time change, can not return reality
Measured in scene, that is, allow to rebuild scene also can not being consistent property, and then lead to not accurately measure.
Embodiment
For the technology contents that the present invention will be described in detail, the objects and the effects, below in conjunction with embodiment and coordinate attached
Figure is explained.
It refer to Fig. 1, a kind of image measuring method based on laser provided by the invention, including step:
The initial position of S1, default video camera, rotary camera so that shooting area is located at the display area of video camera
It is interior, obtain camera angle of rotation value;
The beam direction that the laser that S2, adjusting are arranged on video camera projects so that the laser in shooting area
Point obtains two dimensional image positioned at the center of the display area of video camera, shooting;
S3, the ranging distance according to laser acquisition video camera to shooting area, are calculated the shift value of video camera;
S4, obtain default intrinsic parameters of the camera, according to camera angle of rotation value, the shift value of video camera and shooting
Machine inner parameter, is calculated the two dimensional image of the shooting area and the mapping relations of D world space;
S5, the coordinate value for obtaining determinand on two dimensional image, substitute into the mapping relations of two dimensional image and D world space
In, measured value of the determinand in D world space is calculated.
The beneficial effects of the present invention are:A kind of image measuring method based on laser provided by the invention, passes through shooting
Machine completes the calibration of video camera mapping model with laser, then is acted on by the mapping relations of two dimensional image and D world space
View picture two dimensional image, conversion distortion effect is eliminated with this, takes at 2 points so as to appoint in two dimensional image, you can measure corresponding three-dimensional
The distance of point-to-point transmission is corresponded in scene, calibration process is quick, easy, can be flexibly applied to various scenes.By the method, no matter
When need measure two dimensional image on other determinands full-size(d), all only need it is i.e. measurable by the two dimensional image,
It need not return in reality scene and measure, since reality scene is real-time change, can not return in reality scene and measure, i.e.,
Allow to rebuild scene also can not being consistent property, and then lead to not accurately measure.
It should be noted that the image measurement of the present invention refers to the parameter that true scenery is tried to achieve by the image of scenery.Take the photograph
Camera is a kind of mapping between 3D world of bodies space and 2D images, and video camera mapping model is represented by:
The model represents that 3D worlds reference coordinate fastens the homogeneous coordinates (X of certain pointw, Yw, Zw, 1) with the point be mapped to 2D figure
Relation between the homogeneous coordinates (u, v, 1) fastened as reference coordinate, can be by outside intrinsic parameters of the camera K and video camera
Parameter (rotation R and translation t) obtains.
Wherein, intrinsic parameters of the cameraIt is the intrinsic matrix of video camera, (u0,
v0) it is projected position of the camera optics center on CCD imaging planes, f is the focal length of video camera, dxAnd dyIt is that CCD is every respectively
The physical size of a pixel in the horizontal direction and the vertical direction.
Further, step S1 is specially:
Video camera is put, makes the optical axis of video camera parallel with the ground ρ of shooting area, as the initial position of video camera,
Using the optical axis starting point of video camera as origin Oc, using the optical axis of video camera as ZcAxis, establishes the first reference frame of video camera
XcYcZc;Rotary camera is to shooting area so that shooting area is located in the display area of video camera, obtains video camera rotation
Angle value, the camera angle of rotation value include vertical angle α and level angle β;
Step S2 is specially:
Adjust the beam direction that the laser being arranged on video camera projects so that the laser spots position in shooting area
In the center of the display area of video camera, shooting obtains two dimensional image;Establish the Plane reference coordinate of the two dimensional image
System;The Plane reference coordinate system of the two dimensional image is using the upper left corner of two dimensional image as origin, is to the right u axis, is downwards v axis
The coordinate system Ouv created.
Using the optical axis starting point of video camera as origin O 'c, using the optical axis of video camera as Z 'cAxis, establishes the second ginseng of video camera
Examine coordinate system X 'cY′cZ′c;Using the laser spots on the ground ρ of shooting area as origin Ow, with the first reference frame XcYcZc's
Change in coordinate axis direction is reference direction, establishes three-dimensional world reference frame XwYwZw;
Step S3 is specially:
Video camera is obtained to the ranging distance of shooting area according to laserVertical angle α that step S1 is obtained and
Level angle β, substitutes into the external parameter rotation R and video camera external parameter translation t of video camera;
The external parameter of video camera is rotated into R and video camera external parameter translation t substitutes into the second reference frame X 'cY′cZ′cWith three-dimensional world reference frame XwYwZwBetween transformation model;The transformation model is:
Step S4 is specially:
Default intrinsic parameters of the camera K is obtained, R is rotated according to the external parameter of video camera, video camera external parameter is put down
T and intrinsic parameters of the camera K is moved, the two dimensional image of the shooting area and the mapping relations of D world space is calculated;
The mapping relations represent that three-dimensional world reference coordinate fastens the homogeneous coordinates (X of a bitw, Yw, Zw, 1) with the point be mapped to two dimension
The association between homogeneous coordinates (u, v, 1) on the Plane reference coordinate system of image;The mapping relations are:
Wherein intrinsic parameters of the camera K is obtained by laboratory, is known parameters, passes through the video camera anglec of rotation with scene
The video camera external parameter (Rt) that degree and laser ranging distance obtain in real time, it is possible to obtain 3D worlds reference coordinate and fasten certain point
Homogeneous coordinates (Xw, Yw, Zw, 1) associate between the homogeneous coordinates (u, v, 1) that are mapped on 2D image reference coordinate systems with the point
Video camera mapping model;The video camera mapping model is:
Due to Y on the ground ρ of shooting areaw=0, so meeting between ρ and image:
Such as Fig. 2, in practical applications, it is also necessary to which measurement is inserted in the size of the reinforcing bar on the ground of building site, it is assumed that with vertical Zw
The plane of direction of principal axis on the ground of building site, is deposited as vertical reference plane (plane where the reinforcing bar being inserted on the ground of building site)
In infinite such vertical reference plane (plane π such as vertical with plane ρ1, plane π2Etc.).Plane π1It was origin Ow
A vertical reference plane, due to plane π1Upper Zw=0, so plane π1Meet between imageOther vertical reference planes, such as plane π2, due toCan be by
Plane ρ is obtained, so plane π2Meet between image
Further, further included before step S1:Measurement instruction is received, the measurement instruction includes to be measured on two dimensional image
The coordinate value of thing.
Further included after step S5:
Send measured value of the determinand in D world space.
Seen from the above description, measurement instruction can be sent by the mobile terminal of peripheral hardware to above-mentioned image measuring apparatus,
When receiving measurement instruction, above-mentioned measurement operation, and feedback measurement are performed, as sends the determinand in three-dimensional generation
The measured value in boundary space.
Further, further include:
Associate two dimensional image and its mapping relations with D world space and storage.
Seen from the above description, by associating two dimensional image and its mapping relations and storing, when in different times to the bat
When the determinand or other determinands taken the photograph in scene measure again, since reality scene is real-time change, it can not return again
Measured into reality scene, that is, allow to rebuild scene also can not being consistent property, and then lead to not accurately measure, because
, by storing two dimensional image and its mapping relations, no matter when can make can be by the two dimensional image to being treated in scene for this
Survey thing to measure, obtain the true measurement in spatial scene.
Refering to Fig. 3, the present invention also provides a kind of measuring system of picture based on laser, including rotary module 1, adjust mould
Block 2, the first computing module 3, the second computing module 4 and the 3rd computing module 5;
The rotary module 1, for presetting the initial position of video camera, rotary camera so that shooting area, which is located at, to be taken the photograph
In the display area of camera, camera angle of rotation value is obtained;
The adjustment module 2, the beam direction projected for adjusting the laser being arranged on video camera so that positioned at bat
The laser spots taken the photograph in region are located at the center of the display area of video camera, and shooting obtains two dimensional image;
First computing module 3, for obtaining video camera to the ranging distance of shooting area according to laser, is calculated
The shift value of video camera;
Second computing module 4, for obtaining default intrinsic parameters of the camera, according to camera angle of rotation value,
The shift value and intrinsic parameters of the camera of video camera, is calculated the two dimensional image and D world space of the shooting area
Mapping relations;
3rd computing module 5, for obtaining the coordinate value of determinand on two dimensional image, substitutes into two dimensional image and three-dimensional
In the mapping relations of world space, measured value of the determinand in D world space is calculated.
A kind of measuring system of picture based on laser provided by the invention, completes video camera by video camera and laser and maps
The calibration of model, then view picture two dimensional image is acted on by the mapping relations of two dimensional image and D world space, eliminated with this
Convert distortion effect so that in two dimensional image appoint take at 2 points, you can measure corresponded in corresponding three-dimensional scene point-to-point transmission away from
From calibration process is quick, easy, can be flexibly applied to various scenes.By the method, no matter when need to measure two dimensional image
On other determinands full-size(d), all only need it is i.e. measurable by the two dimensional image, without returning in reality scene
Measurement, since reality scene is real-time change, can not return in reality scene and measure, that is, allow to rebuild scene
Can not being consistent property, and then lead to not accurately measure.
Further, the rotary module, specifically for putting video camera, makes the optical axis of video camera and the ground of shooting area
Face ρ is parallel, as the initial position of video camera, using the optical axis starting point of video camera as origin Oc, using the optical axis of video camera as Zc
Axis, establishes the first reference frame X of video cameracYcZc;Rotary camera is to shooting area so that shooting area is positioned at shooting
In the display area of machine, camera angle of rotation value is obtained, the camera angle of rotation value includes vertical angle α and horizontal angle
Spend β;
The adjustment module, the beam direction projected specifically for adjusting the laser being arranged on video camera so that position
It is located at the center of the display area of video camera in the laser spots in shooting area, shooting obtains two dimensional image;Described in foundation
The Plane reference coordinate system of two dimensional image;The Plane reference coordinate system of the two dimensional image is using the upper left corner of two dimensional image as original
Point, is to the right u axis, the coordinate system Ouv created by v axis downwards.
Using the optical axis starting point of video camera as origin O 'c, using the optical axis of video camera as Z 'cAxis, establishes the second ginseng of video camera
Examine coordinate system X 'cY′cZ′c;Using the laser spots on the ground ρ of shooting area as origin Ow, with the first reference frame XcYcZc's
Change in coordinate axis direction is reference direction, establishes three-dimensional world reference frame XwYwZw;
First computing module, specifically for obtaining video camera to the ranging distance of shooting area according to laserThe vertical angle α and level angle β that step S1 is obtained, substitute into outside the external parameter rotation R and video camera of video camera
Parameter translational t;
The external parameter of video camera is rotated into R and video camera external parameter translation t substitutes into the second reference frame X 'cY′cZ′cWith three-dimensional world reference frame XwYwZwBetween transformation model;The transformation model is:
Second computing module, specifically for obtaining default intrinsic parameters of the camera K, exterior according to video camera is joined
Number rotation R, video camera external parameter translation t and intrinsic parameters of the camera K, be calculated the two dimensional image of the shooting area with
The mapping relations of D world space;The mapping relations represent that three-dimensional world reference coordinate fastens the homogeneous coordinates (X of a bitw,
Yw, Zw, 1) and the association between the homogeneous coordinates on the Plane reference coordinate system of two dimensional image (u, v, 1) is mapped to the point;It is described
Mapping relations are:
Further, receiving module and sending module are further included;
The receiving module, for receiving measurement instruction, the measurement instruction includes the coordinate of determinand on two dimensional image
Value;
The sending module, for sending measured value of the determinand in D world space.
Further, relating module is further included, for associating two dimensional image and its mapping relations with D world space
And store.
The present invention also provides a kind of image measuring apparatus based on laser, including measurement end;The measurement end includes swashing
Light, video camera, recliner and processor;The laser is arranged on video camera, the laser, video camera and recliner respectively with
Processor connects, and the laser and video camera are connected with recliner respectively.
Further, server-side and the terminal of at least more than one are further included;The measurement end by server-side respectively with
Terminal connects.
In a specific embodiment, the present apparatus further includes server-side and terminal.Server-side is led to measurement end and terminal respectively
Cross network connection.Server-side provides the communication interface between measurement end and terminal, and server-side, which receives to come from/send, goes to measurement end
Or the electric signal of terminal.Terminal shows visual output to user, including the text message of 2D images to be measured, measurement process/result,
Graphical information and its any combination.Terminal receives the control input of user, and control signal is sent to server-side, performs 2D images and surveys
Amount, obtains the measured value of determinand in image.
In conclusion a kind of image measuring method based on laser, system and device provided by the invention, pass through video camera
The calibration of video camera mapping model is completed with laser, then is acted on by the mapping relations of two dimensional image and D world space whole
Width two dimensional image, conversion distortion effect is eliminated with this, takes at 2 points so as to appoint in two dimensional image, you can measure corresponding three-dimensional field
The distance of point-to-point transmission is corresponded in scape, calibration process is quick, easy, can be flexibly applied to various scenes.By the method, no matter what
When need measure two dimensional image on other determinands full-size(d), all only need, nothing i.e. measurable by the two dimensional image
It need to return in reality scene and measure, since reality scene is real-time change, can not return in reality scene and measure, even if
Can rebuild scene also can not being consistent property, and then lead to not accurately measure.
The foregoing is merely the embodiment of the present invention, is not intended to limit the scope of the invention, every to utilize this hair
The equivalents that bright specification and accompanying drawing content are made, are directly or indirectly used in relevant technical field, similarly include
In the scope of patent protection of the present invention.