Disclosure of Invention
The invention aims to provide a method for determining the position of acquisition equipment based on image data processing. According to the scheme of the invention, no physical measurement is required for constructors, the constructors can find a proper position on site to install the image acquisition equipment, and can leave the construction site after confirming that the sight line of the label is not blocked. The input quantity of the method is completely from the digital image, the whole process does not need manual intervention, the requirement of site operators on equipment positioning is reduced, and the technical requirement on site operators is greatly reduced.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for determining the position of an acquisition device based on image data processing, characterized by:
the inner wall of the cylinder is provided with a plurality of markers, so that more than three markers can be acquired by the image acquisition equipment in the same digital image;
identifying pixel position and pixel width information of a marker in a digital image;
calculating the angle of the marker through a relation function between the pixel position of the image acquisition equipment and the incident angle of the light;
establishing a mathematical model, wherein the center of the cylinder, the position of the image acquisition equipment and any marker form a triangle; establishing a vector relation of the triangle, and performing complex vector operation on the vector relation to obtain a first equation;
performing trigonometric function operation according to the imaging relation of the marker to obtain an equation two, and forming an equation set with the equation one;
and (3) at least bringing in the pixel position and pixel width information of the three markers to obtain an equation set consisting of three sets of equations I and II, and solving to obtain the position of the acquisition equipment.
Further, the marker is a rectangular marker, and the pixel position of the marker is represented by a pixel of the transverse span center point or a pixel of the geometric center point of the marker.
Further, according to the optical physical characteristics of the image acquisition device, the relation function between the pixel position and the incident angle of the light ray is known
Passing function
Obtaining pixels in a digital image
Angle value of
,
The central angle using the image acquisition device as the center of a circle is as follows:
Angle of view of marker A
Comprises the following steps:
Wherein,
is the pixel location of marker a.
Further, the pixel width occupied by the marker a is:
Wherein, the pixel of the start position of the marker A is recorded as
End position pixel is noted
。
Further, the pass function
The angle value of the initial position in the width direction of the marker A can be obtained
And end position angle value
The method comprises the following steps:
According to equation 3, the angle of view occupied by marker a is:
Further, the obtaining of the first equation includes: taking a marker A to establish a mathematical model, wherein the marker A is represented by a point A, the center of the cylinder is a point O, and the position of the equipment is a point P
;
In a coordinate system with the O point as a center, the vector expression of the marker A is as follows:
wherein
Is a central angle with O point as the center of a circle, and R is a cylinder structureA radius;
in a coordinate system with the P point as a center, the vector expression of the marker A is as follows:
wherein
Is a central angle taking the point P as the center of a circle,
the object distance of the point A compared with the point P is shown;
the position of the point P is expressed by complex plane coordinates (a, b), the origin is the point O, a represents an abscissa in the complex plane, and b represents an ordinate in the complex plane;
according to
The vector relationship of (a) can be found as:
The complex vector operation is performed on equation 6
Wherein,
the object distance of point a compared to point P,
is an imaginary unit;
the imaginary part and the real part in equation 7 are respectively given by the following equations:
Adding the two sides of equation 8 after squaring to eliminate variable
Obtaining:
Equation 9 is equation one.
Further, the obtaining of the first equation includes:
according to the angle relationship, a triangle can be obtained
In
Comprises the following steps:
From the imaging relationship of marker a, the equation is derived:
Wherein W is the actual width of the label A
After deriving from the cosine theorem:
The formula 10 and the formula 12 are replaced by the formula 11, and the formula is simplified:
Equation 13 is equation two.
Further, the solving for the location of the acquisition device comprises:
combining equation 9 and equation 13 yields a system of equations:
Pixel locations brought into three markers A, B, C
、
、
And pixel width information
Can be solved out
Six unknowns.
Further, two sides of formula 2 are subjected to derivation to obtain:
Bringing label a into formula 15, having:
Substituting equations 3 and 15 into equation 14 can be further simplified as:
Further, locating other markers in the image includes: the pixel position of a certain marker N in an image is known as
The angle value is:
Bringing formula 18 into formula 9 can result:
Solving for the object distance of the available marker N
。
Compared with the prior art, the invention has the following beneficial effects: according to the invention, the image acquisition is carried out through the equipment, and the eccentric direction and the eccentric distance of the image acquisition equipment can be obtained by reading the position and the pixel size of the label in the image, and meanwhile, the physical size of the inner diameter of the cylinder can also be obtained. According to the scheme of the invention, no physical measurement is required for constructors, the constructors can find a proper position on site to install the image acquisition equipment, and can leave the construction site after confirming that the sight line of the label is not blocked. The input quantity of the method is completely from the digital image, the whole process does not need manual intervention, the requirement of site operators on equipment positioning is reduced, and the technical requirement on site operators is greatly reduced. In addition, the method can obtain the size of the cylinder structure, reduce the investment requirement and simultaneously improve the reliability of data.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the measurement of the tower structure by using the panoramic digital technology, the image acquisition device is often required to be placed on the central axis of the tower structure, so that the object distance of the markers on the inner wall of the tower is consistent compared with the center of the tower. However, this requirement is often not guaranteed due to the limitations of field operating conditions. Referring to fig. 1, a method for determining the position of the acquisition device based on image data processing is described below, which can obtain the eccentric position of the acquisition device and the internal dimension of the tower structure by means of digital image technology only, and the specific technical route is as follows.
Step one, placing a marker with known width
As shown in fig. 3, at least 3 markers (A, B, C, D) are mounted on the inner wall of the tower structure, so that the image capturing device (such as a camera) can capture more than three markers in the same frame, wherein the markers A, B, C, D are all in the same frame. Only this step requires on-site installation inside the tower;
the shape of the marker is a graphic of known specific geometric dimensions, in the case of the rectangular marker in fig. 2, the width of the marker is denoted as W, a known amount.
Step two, identifying the pixel position and the pixel width information of the marker
In digital images acquired by image acquisition equipment (taking a camera as an example, the equipment for short), performing plane expansion on the acquired digital images to obtain rectangular images inside a tower, and then constructing a geometric model, as shown in fig. 3, extracting pixel position and pixel width information of a marker;
for the pixel position of the marker A, one pixel point can be used
Generally, the lateral span center point, or geometric center point, of the marker is used;
as shown in fig. 4, even for markers of the same physical size, there may be differences in the pixel widths that they represent in the image due to the influence of eccentricity of the image capturing device. In the width direction, the pixel of the start position of the marker A is recorded
(obtained by automatic recognition or manual reading) and the pixels at the end positions are recorded as
The pixel width information is known;
the pixel width occupied by marker a (span) is:
Step three, calculating the angle of the marker through the lens parameters
From the optical characteristics of the camera lens, the relationship function between the pixel position and the incident angle of the light ray is known
Passing function
The pixels in the digital image can be known
Angle value of
The following formula:
Angle value of starting position in width direction of marker A
And end position angle value
The method comprises the following steps:
The angle of view occupied (spanned) by marker a is according to equation 3 (shown in fig. 4):
Angle of view of marker A
By pixel points
Taking the center pixel of the span of A pixels of the marker as a reference point
The calculation is as follows:
The central pixel of the marker A can be obtained by automatic identification or manual reading
。
Step four, complex vector operation
As shown in FIG. 5, a mathematical model is established by taking a marker A on the tower structure, the marker A is represented by point A, the center of the tower is point O, and the equipment position is point P
;
In a coordinate system with the O point as a center, the vector expression of the marker A is as follows:
wherein
Is a central angle taking the point O as the center of a circle, and R is the radius of the tower barrel structure;
in a coordinate system with the P point as a center, the vector expression of the marker A is as follows:
wherein
Is a circle with P point as the centerThe position of the heart angle, point P, can also be expressed in complex plane coordinates (a, b) (origin is point O);
the object distance of point A compared with point P is
According to
The vector relationship of (a) can be found as:
The complex vector operation is performed on equation 6
The imaginary part of (1) in equation 7
In units of imaginary numbers), and the real part are respectively given by the following equations:
Because of the fact that
For the known quantity obtained by pixel conversion, the two sides of the equation of the formula 8 are squared and added to eliminate the variable
Obtaining:
modifying the above equation yields:
Equation one (equation 9) is obtained for subsequent calculations.
Step five, imaging relation of marker A
According to the angle relationship, a triangle can be obtained
In
Is (as shown in figure 5):
Since the digital image of the marker a is acquired by using a reference system with a point P as a center, that is, the projection length of the marker in the AP vertical direction is acquired, but the physical size of the marker a is established by using a reference system with a point O as a center, the two reference systems are connected to obtain an equation:
Thus, to the left of equation 11 is the marker width multiplied by the cosine of the projection view angle and to the right is the marker distance multiplied by the radian spanned by the label. Although the two methods are different, the apparent width (the width which should be seen by taking P as the center) of the marker is calculated;
in the above actual measurement, the marker is attached to the inner wall of the tower, as shown in fig. 7, the arc M1M2 corresponds to the marker, the length is W, and since the radii OA and W are perpendicular and R is much greater than the width W of the marker, the arc length M1M2 is approximately equal to the line segment M1M2 and is equal to W;
as shown in FIG. 7, two endpoints M of the marker1. The projection points of M2 in the AP perpendicular direction are N1 and N2 respectively. The left side of equation 11 is projected to calculate the length of N1N2, i.e.
(ii) a On the left side of equation 11, since the distance of La is much greater than the length of N1N2 in the triangle N1PN2, N1N2= La × radius (angle N1PN2) can be obtained from the approximate relationship between the arc length and the radian, and since the distance of La is much greater than N1N2, angle M1PM2 is approximately equal to angle N1PN2, and the radian of angle N1PN2 is equal to angle N1PN2
Therefore, there are
;
In view of the above, it can be seen that,
。
step six, performing trigonometric function operation
As shown in fig. 6, according to the cosine theorem:
The formula 10 and the formula 12 are replaced by the formula 11, and the formula is simplified:
Equation two (equation 13) is obtained for subsequent calculations.
Seventhly, solving global information by equation I and equation II
Combining equation 9 and equation 13 yields a system of equations:
Read from time to timeGet
、
Two readings will be in error, and to further reduce the error, the following can be used for optimization:
the derivation is performed on both sides of equation 2 to obtain the corresponding relationship of the angle change caused by the pixel change at a certain point position (the index mark) in the digital image, and the following are:
Bringing label a into formula 15, having:
Wherein
Is equal to
Indicating the angle of the viewing angle occupied by the marker a;
the image processing method includes the steps that small changes of pixels of a marker A are shown, and the change of the angle of a visual angle of the marker A can be caused;
substituting equations 3 and 15 into equation 14 can be further simplified as:
By substituting the pixel position of 3 markers A, B, C
、
、
And a pixel width value
、
、
The above equation sets are combined to obtain six equations in three sets, i.e. a, b, R,
、
、
Six unknowns.
Step eight, solving the positions of other points in the image
After the eccentric positions a and b and the tower radius R are calculated in the above steps, the object distance of any other markers in the image can be derived through vector operation. For example, the pixel position of a certain point N in the image is known to be
Point N is within the view angle around P, the angle values are:
Bringing formula 18 into formula 9 can result:
Solving the above quadratic equation to obtain the object distance of point N
。
The central angle may refer to an angle corresponding to a rotation in a counterclockwise direction with a certain direction fixed as a starting 0 °.
Description of the principle and effects: the method is based on analyzing and calculating the pixel position and the pixel width of the marker in the image, and directly measuring the position of the acquisition equipment. The method has the following innovative effects:
(1) deducing a physical space size by using the relation between the pixel position and the pixel width of the marker in the digital image, determining the geometric relation between the acquisition equipment and the tower drum, and determining the geometric position of the image acquisition equipment in the tower drum;
(2) the position of the image acquisition equipment can be obtained only by the physical position information of 3 or more markers, and the radius information of the tower can be obtained at the same time;
(3) and based on the digital image information, uniquely determining the specific position of the image acquisition equipment in the tower drum structure, and describing the position of the equipment by adopting the deviation direction angle and the deviation amount.
Example one
As shown in fig. 8 and 9, the panoramic camera position is denoted as P, and the pixels of the center points of the 3 markers A, B, C on the inner wall of the tower in the digital image are obtained, and the pixel positions and pixel widths of the marker A, B, C are shown in the following table.
Pixel position and pixel width information table for marker A, B, C
1. The tower radius R, the eccentricity position (a, b) is solved.
From A, B, C pixel position and pixel width parameter pairs for three points:
the radius R =2110 mm of the tower can be obtained by respectively substituting the equation 17, the eccentric position a = 310mm and the eccentric position b = 100mm of the device, and the converted angle and amplitude are
Object distances of A, B, C are 1996mm, 1785mm and 2242 mm.
2. And solving the position of a new marker N on the tower structure.
Given a pixel position of 1879p and a pixel width of 16.83pixels for point N, the solution is given by substituting equation 19, and the object distance of N is 1845 mm.
As in fig. 9, all position parameters for each marker table:
parameter list of marker A, B, C
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.