[go: up one dir, main page]

CN106780602B - A kind of rifle ball positioning method and device - Google Patents

A kind of rifle ball positioning method and device Download PDF

Info

Publication number
CN106780602B
CN106780602B CN201611105536.5A CN201611105536A CN106780602B CN 106780602 B CN106780602 B CN 106780602B CN 201611105536 A CN201611105536 A CN 201611105536A CN 106780602 B CN106780602 B CN 106780602B
Authority
CN
China
Prior art keywords
point
calibration
target
ball machine
center
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201611105536.5A
Other languages
Chinese (zh)
Other versions
CN106780602A (en
Inventor
周璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huaray Technology Co Ltd
Original Assignee
Zhejiang Huaray Technology Co Ltd
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 Zhejiang Huaray Technology Co Ltd filed Critical Zhejiang Huaray Technology Co Ltd
Priority to CN201611105536.5A priority Critical patent/CN106780602B/en
Publication of CN106780602A publication Critical patent/CN106780602A/en
Application granted granted Critical
Publication of CN106780602B publication Critical patent/CN106780602B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Aiming, Guidance, Guns With A Light Source, Armor, Camouflage, And Targets (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of rifle ball positioning method and devices, and the positioning accuracy to solve rifle ball linked system in the prior art is lower, the larger problem of deviations.This method are as follows: choose N number of reference point in the reference picture of gunlock acquisition, and according to N number of reference point in the position of the reference picture, and the corresponding corner of each reference point, determine calibrating parameters, and then determine the corresponding target rotation angle of target point in the image of the gunlock acquisition.In this way, this method need to only be demarcated the positioning that can be completed between rifle ball at least three reference points, and positioning accuracy is high, and positional accuracy is high.

Description

Gun ball positioning method and device
Technical Field
The invention relates to the field of video monitoring, in particular to a gun and ball positioning method and device.
Background
With the development of scientific technology, intelligent tracking technology is applied to more and more occasions, such as large exhibition halls, meeting halls and dangerous road sections. The intelligent tracking technology is combined to monitor the site, so that security personnel can be saved, and security loopholes caused by the mobility of the security personnel are avoided.
The gunlock can monitor a large-range scene, and the ball machine can amplify a monitored object, so that a user can observe the details of the monitored object. However, the gun camera alone monitors the detailed area, and the ball camera alone monitors the whole scene, so that the gun camera and the ball camera need to be linked to monitor the detailed area in a large-range scene.
The gun and ball linkage system is based on the intelligent tracking technology of a single ball machine, and can improve the single-point monitoring of the ball machine into seamless relay tracking of a single target in the system.
At present, a gun and ball linkage system generally uses a fixed corresponding point method to determine a corresponding relationship between a gun camera and a ball camera, that is, a user selects a certain number of reference point positions in an image monitored by the gun camera, the gun and ball linkage system controls the ball camera to respectively rotate to the positions with the selected reference points as centers, and records the corresponding relationship between the positions of the reference points and a rotation angle of the ball camera with the reference points as the centers, so that when the position of one of the reference points is selected in the image monitored by the gun camera, the rotation angle of the ball camera with the reference point as the center can be determined through the stored corresponding relationship, and the ball camera is controlled to rotate to the reference point as the center.
In order to ensure that the determined rotation angles of the dome camera with each reference point as the center are continuous, the user also uses an interpolation method on the basis of a fixed corresponding point method, namely the user interpolates the positions of reference points in the corresponding relation determined by the fixed corresponding point method to obtain a corresponding relation which tends to be continuous, so that the rotation angles of the dome camera with each reference point as the center tend to be continuous.
Obviously, the method can only carry out gun-ball correspondence of discrete preset effective positions, and cannot carry out gun-ball correspondence of continuous positions, so that the gun-ball linkage system has low positioning precision and large positioning deviation.
Disclosure of Invention
The embodiment of the invention provides a gun and ball positioning method and device, which are used for solving the problems of low positioning precision and large positioning deviation of a gun and ball linkage system in the prior art.
The embodiment of the invention provides the following specific technical scheme:
in a first aspect, an embodiment of the present invention provides a rifle ball positioning method, including:
acquiring a reference image acquired by a gun camera, and selecting N reference points from the reference image, wherein N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear;
aiming at each reference point in the N reference points, determining a corresponding corner of the ball machine when the ball machine takes the reference point as the center, wherein the corner corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to take the reference point as the center and a set reference angle, and the distance between the ball machine and the rifle bolt is within a set range;
determining calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock;
and acquiring the position of a target point in an image acquired by the gun camera, and determining a target corner corresponding to the target point according to the calibration parameters, wherein the target corner is used for indicating the ball machine to rotate to the target point as the center.
With reference to the first aspect, in a first possible implementation manner of the first aspect, determining the calibration parameter according to the positions of the N reference points in the reference image and a rotation angle corresponding to each reference point includes:
obtaining initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
determining a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point;
generating an iterative function of each initial calibration parameter according to the calibration matrix;
and iterating according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and ending iteration to obtain the calibration parameters.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the position of an ith reference point of the N reference points includes: the position x of the reference point in the horizontal direction in the reference imageiThe position y of the reference point in the vertical direction in the reference imagei(ii) a The corresponding turning angle of the reference point comprises: when the ball machine takes the reference point as the center, the rotating angle b of the reference point in the horizontal direction corresponds toxiAnd the corner b in the vertical direction corresponding to the reference point when the ball machine takes the reference point as the centeryi(ii) a Wherein i is a positive integer less than or equal to N;
the initial position of the optical center point of the bolt in the reference image comprises: the reference image is the initial position x of the horizontal direction where the optical center point of the bolt is located0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a When the ball machine takes the initial position as the center, the initial corner corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0The ball machine corresponds to the initial position when the ball machine takes the initial position as the centerInitial angle of rotation a in the vertical directiony0
x0According to the formulaWherein W is the width of the reference image;
y0according to the formulaWherein H is the height of the reference image;
ax0according to the formula
ay0According to the formula
With reference to the first aspect, or any one of the first and second possible implementations of the first aspect, in a third possible implementation of the first aspect, when the position of the target point includes: when the target point is at the target position x in the horizontal direction in the image collected by the bolt face and the target point is at the target position y in the vertical direction in the image collected by the bolt face, determining a target rotation angle corresponding to the target point according to the calibration parameters, including:
in the calibration parameters, the calibration position where the optical center point of the bolt in the reference image is located includes: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a When the ball machine takes the calibration position as the center, the calibration corner corresponding to the calibration position comprises: the ball machine corresponds to the calibration position when taking the calibration position as the centerCalibration corner in horizontal directionThe ball machine takes the calibration position as the center, and the calibration corner D of the ball machine in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibrated equivalent focal length f of the rifle bolt in the horizontal directionDxCalibrating equivalent focal length f in the vertical direction of the boltDy
According to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx
According to y, Dy0、fDyDetermining the projection angle T of the actual scenery corresponding to the target point in the vertical direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointy
According to Tx、TyDetermining an included angle r between the actual scene corresponding to the target point and the image collected by the gun camera;
according to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect,
Txaccording to the formula
TyAccording to the formula
With reference to the third possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, r conforms to the formula r ═ atg (tan (T)y)*cos(Tx))。
With reference to the third possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the determining a target rotation angle corresponding to the target point includes: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
According to Tx、r、Day0Determining a target rotation angle corresponding to the target point, including:
according to Tx、r、Day0Determining the intermediate quantity rt,rtAccording to the formula
According to Tx、r、Day0Determining the intermediate quantity Tax,TaxAccording to the formula
According to TaxDetermining ax
According to rt、TaxDetermining ay
With reference to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect,
axaccording to the formula
ayAccording to the formula
In a second aspect, an embodiment of the present invention provides a rifle ball positioning device, including:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a reference image acquired by a gunlock and selecting N reference points from the reference image, wherein N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear;
the processing unit is used for determining a corner corresponding to the ball machine by taking the reference point as the center aiming at each reference point in the N reference points, wherein the corner corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to take the reference point as the center and a set reference angle, and the distance between the ball machine and the rifle bolt is within a set range; and
determining calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock;
the acquisition unit is also used for acquiring the position of a target point in the image acquired by the bolt face;
the processing unit is further configured to determine a target corner corresponding to the target point according to the calibration parameter, where the target corner is used to instruct the ball machine to rotate to the target point as the center.
With reference to the second aspect, in a first possible implementation manner of the second aspect, when determining the calibration parameter according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, the processing unit is specifically configured to:
obtaining initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
determining a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point;
generating an iterative function of each initial calibration parameter according to the calibration matrix;
and iterating according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and ending iteration to obtain the calibration parameters.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the position of an ith reference point in the N reference points includes: the position x of the reference point in the horizontal direction in the reference imageiThe position y of the reference point in the vertical direction in the reference imagei(ii) a The corresponding turning angle of the reference point comprises: when the ball machine takes the reference point as the center, the rotating angle b of the reference point in the horizontal direction corresponds toxiAnd the corner b in the vertical direction corresponding to the reference point when the ball machine takes the reference point as the centeryi(ii) a Wherein,i is a positive integer less than or equal to N;
the initial position of the optical center point of the bolt in the reference image comprises: the reference image is the initial position x of the horizontal direction where the optical center point of the bolt is located0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a When the ball machine takes the initial position as the center, the initial corner corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0And the initial corner a in the vertical direction corresponding to the initial position when the ball machine takes the initial position as the centery0
x0According to the formulaWherein W is the width of the reference image;
y0according to the formulaWherein H is the height of the reference image;
ax0according to the formula
ay0According to the formula
With reference to the second aspect, or any one of the first and second possible implementations of the second aspect, in a third possible implementation of the second aspect, when the position of the target point includes: when the target position x of the target point in the horizontal direction in the image acquired by the bolt face and the target position y of the target point in the vertical direction in the image acquired by the bolt face are determined, the processing unit is specifically configured to:
in the calibration parameters, the calibration position where the optical center point of the bolt in the reference image is located includes: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a When the ball machine takes the calibration position as the center, the calibration corner corresponding to the calibration position comprises: when the ball machine takes the calibration position as the center, the calibration corner in the horizontal direction corresponding to the calibration positionThe ball machine takes the calibration position as the center, and the calibration corner D of the ball machine in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibrated equivalent focal length f of the rifle bolt in the horizontal directionDxCalibrating equivalent focal length f in the vertical direction of the boltDy
According to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx
According to y, Dy0、fDyDetermining the projection angle T of the actual scenery corresponding to the target point in the vertical direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointy
According to Tx、TyDetermining an included angle r between the actual scene corresponding to the target point and the image collected by the gun camera;
according to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect,
Txaccording to the formula
TyAccording to the formula
With reference to the third possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, r conforms to the formula r ═ atg (tan (T)y)*cos(Tx))。
With reference to the third possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, the determining, by the processing unit, a target rotation angle corresponding to the target point includes: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
The processing unit is based on Tx、r、Day0And when determining the target rotation angle corresponding to the target point, specifically:
according to Tx、r、Day0Determining the intermediate quantity rt,rtAccording to the formula
According to Tx、r、Day0Determining the intermediate quantity Tax,TaxAccording to the formula
According to TaxDetermining ax
According to rt、TaxDetermining ay
With reference to the sixth possible implementation manner of the second aspect, in a seventh possible implementation manner of the second aspect,
axaccording to the formula
ayAccording to the formula
According to the technical scheme of the embodiment of the invention, N reference points are selected from a reference image acquired by a gun camera, calibration parameters are determined according to the positions of the N reference points in the reference image and the rotating angle corresponding to each reference point, and then the target rotating angle corresponding to a target point in the image acquired by the gun camera is determined. Therefore, the method can finish the positioning between the gun balls only by calibrating at least three reference points, and has high positioning precision and high positioning accuracy.
Drawings
Fig. 1 is a flowchart of a gun ball positioning method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a rifle ball positioning device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. 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.
The embodiment of the invention provides a gun and ball positioning method and device, which are used for solving the problems of low positioning precision and large positioning deviation of a gun and ball linkage system in the prior art. The method and the device are based on the same inventive concept, and because the principles of solving the problems of the method and the device are similar, the implementation of the device and the method can be mutually referred, and repeated parts are not repeated.
By adopting the technical scheme of the embodiment of the invention, N reference points are selected from the reference image acquired by the gunlock, and the calibration parameters are determined according to the positions of the N reference points in the reference image and the rotating angle corresponding to each reference point, so that the target rotating angle corresponding to the target point in the image acquired by the gunlock is determined. Therefore, the method can finish the positioning between the gun balls only by calibrating at least three reference points, and has high positioning precision and high positioning accuracy.
In an embodiment of the present invention, the gun and ball linkage system at least includes a gun device with a fixed position and a ball device, and the gun device and the ball device are installed at positions closer to each other, that is, a distance between the gun device and the ball device is within a set range, and the set range is far smaller than an object distance corresponding to the gun device. In a specific implementation process, the ball machine can be replaced by a camera with a holder.
In addition, in the embodiment of the present invention, the method for positioning a gun ball may be implemented by, but not limited to, a processor, where the processor may be a processor in a gun camera, a processor in a ball machine, or a processor that is connected to the gun camera and the ball machine but exists separately from the gun camera and the ball machine. In the embodiments of the present invention, the execution subject is taken as the processor for detailed description.
In order to more clearly describe the technical solution of the embodiment of the present invention, the following describes in detail the method and the device for positioning a rifle ball provided by the embodiment of the present invention with reference to the accompanying drawings.
The embodiment of the invention provides a gun ball positioning method. Referring to fig. 1, the specific process of the method includes:
step 101: the processor acquires a reference image acquired by the gunlock, and selects N reference points from the reference image, wherein N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear.
Optionally, the reference image may be a still image acquired by the bolt face, or may also be any frame image in a video stream acquired by the bolt face, the processor randomly selects N reference points in the reference image, and a position of an ith reference point in the N reference points in the reference image may be denoted as (x)i,yi) Wherein x isiFor the position of each reference point in the horizontal direction in the reference image, yiFor the position of each reference point in the vertical direction in the reference image, i is a positive integer less than or equal to N, i.e. i is 1, 2, … N.
For example, when N is 3, 1 st to 3 rd reference points among the 3 reference points are in the reference imageThe positions are respectively (x)1,y1)、(x2,y2)、(x3,y3) (ii) a When N is a positive integer greater than 3, the positions of the 1 st to Nth reference points in the N reference points in the reference image are respectively (x)1,y1)、(x2,y2)、(x3,y3)…(xN,yN)。
By selecting at least three reference points which are not collinear, the obtained calibration parameters can be more accurate, and the positioning is more accurate.
Step 102: the processor determines a rotation angle corresponding to the ball machine by taking the reference point as the center aiming at each reference point in the N reference points, wherein the rotation angle corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to the center by taking the reference point as the center and a set reference angle, and the distance between the ball machine and the rifle bolt is within a set range.
Optionally, the processor determines, for each reference point of the N reference points, a rotation angle corresponding to the ball machine with the reference point as a center, where the specific method includes:
the processor controls the ball machine to rotate to a position with each reference point in the N reference points selected in the step 101 as a center, and since the rotating angle corresponding to each reference point in the N reference points is recorded in the ball machine, when the processor controls the ball machine to rotate to the corresponding position, the processor can obtain the rotating angle corresponding to the ith reference point when the ball machine automatically reads and the ith reference point in the N reference points is taken as the center, and the rotating angle is marked as (b)xi,byi) Wherein b isxiA rotation angle in the horizontal direction corresponding to the ith reference point when the ball machine takes the ith reference point in the N reference points as the center, actually a rotation angle in the horizontal direction between the current angle of the ball machine and a set reference angle when the ball machine takes the ith reference point as the center, byiUsing the N references for the ball machineThe rotation angle in the vertical direction corresponding to the ith reference point when the ith reference point in the points is taken as the center is actually the rotation angle in the vertical direction between the current angle of the ball machine and the set reference angle when the ball machine takes the ith reference point as the center.
For example, when N is 3, the positions of the 1 st to 3 rd reference points in the 3 reference images are (x)1,y1)、(x2,y2)、(x3,y3) Correspondingly, when the ball machine takes each reference point in the 3 reference points as the center, the corresponding corner of each reference point is (b)x1,by1)、(bx2,by2)、(bx3,by3) (ii) a When N is a positive integer greater than 3, the positions of the 1 st to Nth reference points in the N reference points in the reference image are respectively (x)1,y1)、(x2,y2)、(x3,y3)…(xN,yN) Correspondingly, when the ball machine takes each reference point in the N reference points as the center, the corresponding corner of each reference point is (b)x1,by1)、(bx2,by2)、(bx3,by3)…(bxN,byN)。
The rotation angle corresponding to any one reference point is a rotation angle between the current angle of the ball machine and a set reference angle, and optionally, the set reference angle may be any set angle, for example, the angle of the ball machine when the ball machine rotates to the horizontal position is set as the set angle.
Step 103: the processor determines calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock.
Optionally, in the calibration parametersThe calibration position where the optical center point of the bolt in the reference image is located comprises: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a Correspondingly, when the ball machine takes the calibration position as the center, the calibration rotation angle corresponding to the calibration position comprises: when the ball machine takes the calibration position as the center, the calibration corner D in the horizontal direction corresponding to the calibration positionax0And the ball machine takes the calibration position as the center and then calibrates the calibration corner D in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibration equivalent focal length f of the gunlock in the horizontal directionDxCalibrating equivalent focal length f of the bolt in the vertical directionDy
Optionally, the processor determines the calibration parameter according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, and may be divided into the following four steps:
a. the processor obtains initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
b. the processor determines a calibration matrix according to the positions of the N reference points in the reference image and the corner corresponding to each reference point;
c. the processor generates an iterative function of each initial calibration parameter according to the calibration matrix;
d. and the processor iterates according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and the iteration is finished to obtain the calibration parameters.
Optionally, in step a, the initial position of the optical center point of the bolt in the reference image includes: the reference image is the initial position x of the horizontal direction where the optical center point of the bolt is located0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a Correspondingly, when the ball machine uses the initial position as the center, the initial rotation angle corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0And the initial corner a in the vertical direction corresponding to the initial position when the ball machine takes the initial position as the centery0
x0According to the formula I:
wherein W is the width of the reference image;
y0the formula II is met:
wherein H is the height of the reference image;
ax0the formula three is met:
ay0the formula four is met:
wherein the calculation results of the formula three and the formula four are (a)x0,ay0) The most preferred initial rotational angle corresponding to the initial position of the ball machine is the initial rotational angle corresponding to the initial position when the initial position is the center, but the initial rotational angle corresponding to the initial position of the ball machine when the initial position is the center is not limited to be calculated by using the formula three and the formula four.
Optionally, in step a, the preset initial equivalent focal length of the bolt machine includes: the initial equivalent focal length f of the bolt in the horizontal directionxThe initial equivalent focal length f of the bolt in the vertical directionyWherein, optionally, fx,fyCan be preset to a fixed value, and the fixed value is a value between 500 and 1000, for example fxIs 600, fyIs 700; f. ofx,fyIt may also be set according to the actual focal length of the bolt, for example,
fxconforms to the formula five:
wherein f is0Is the minimum focal length, M, of the bolt0The current multiplying power of the gun camera is used, and cw is the width of a photoreceptor of the gun camera;
fyaccording to the formula six:
where ch is the height of the photoreceptor of the bolt.
Optionally, in step b, the processor determines a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, and the specific method may be as follows:
the processor establishes a first setting function F according to the positions of the N reference points in the reference image, the rotation angle corresponding to each reference point and the initialized calibration parameteriAs shown in formula seven, and a second set function GiAs shown in equation eight:
the processor is according to the function FiIn sequence to fx,fy,ax0,ay0,x0,y0Partial differentiation is carried out, and the following formulas nine to fourteen are met:
Fi_dfx=-cos(byi)*sin(bxi-ax0) Formula nine
Fi_dfy0 formula ten
Fi_dax0=(xi-x0)*cos(ay0)*cos(byi)*sin(bxi-ax0)+fx*cos(byi)*cos(bxi-ax0) Formula eleven
Fi_day0=(xi-x0)*(cos(ay0)*sin(byi)-sin(ay0)*cos(byi)*cos(bxi-ax0) Twelve) formula
Fi_dx0=-(sin(ay0)*sin(byi)+cos(ay0)*cos(byi)*cos(bxi-ax0) Thirteen formula
Fi_dy00 formula fourteen;
likewise, the processor operates according to the function G described aboveiIn sequence to fx,fy,ax0,ay0,x0,y0And (3) partial differentiation is carried out, and the following formulas fifteen to twenty are met:
Gi_dfx0 formula fifteen
Gi_dfy=-(cos(ay0)*sin(byi)-sin(ay0)*cos(byi)*cos(bxi-ax0) Sixteen formulas)
Gi_dx00 formula nineteen
Gi_dy0=-(sin(ay0)*sin(byi)+cos(ay0)*cos(byi)*cos(bxi-ax0) Twenty);
the processor determines a calibration matrix, which is denoted as a, according to values generated by the above formulas nine to twenty, wherein the processor uses values generated by the above formulas nine to fourteen in sequence as odd rows of the calibration matrix, and uses values generated by the above formulas fifteen to twenty in sequence as even rows of the calibration matrix, and the calibration matrix is a 2N x 6 matrix, that is, the number of rows of the calibration matrix is 2N, and the number of columns of the calibration matrix is 6. For example, the calibration matrix determined by the processor may be the following matrix:
optionally, in step c, the processor generates an iterative function of each initial calibration parameter according to the calibration matrix, and the specific method may be as follows:
and the processor carries out inversion calculation on the calibration matrix to obtain an inverse matrix of the calibration matrix, and the inverse matrix is marked as M, wherein the row number of M is 6, and the column number is 2N. Since the calibration matrix is not necessarily a square matrix, inverting the calibration matrix by adopting a pseudo-inverse calculation method, wherein the calculation method can be but is not limited to a singular value decomposition method;
the processor establishes a third setting function P according to the inverse matrix of the calibration matrix, the first setting function and the second setting functionkAs shown in equation twenty-one:
wherein k is an identifier of an iteration parameter, and k is a positive integer less than or equal to 6, that is, k is 1, 2, 3, 4, 5, 6;
wherein, P1For initial calibration of the parameter fxIteration parameter of, P2For initial calibration of the parameter fyIteration parameter of, P3For initial calibration of parameter ax0Iteration parameter of, P4For initial calibration of parameter ay0Iteration parameter of, P5For initial calibration of the parameter x0Iteration parameter of, P6For the initial calibration parameter y0The iteration function parameters of (1), specifically, the iteration parameters of each initial calibration parameter are as in formulas twenty-two to twenty-twoShown in equation twenty-seven:
the processor is according to PkGenerating an iterative function of each initial calibration parameter, specifically, the iterative function of each initial calibration parameter is as shown in formulas twenty-eight to thirty-three:
fx=fx+P1formula twenty-eight
fy=fy+P2Formula twenty-nine
ax0=ax0+P3Formula thirty
ay0=ay0+P4Formula thirty one
x0=x0+P5Formula thirty-two
y0=y0+P6The formula is thirty-three.
Optionally, in step d, the processor performs iteration according to each of the initial calibration parameters and the corresponding iteration function, and when a preset condition is met, the iteration is ended to obtain the calibration parameters, where the specific iteration process is as follows:
the processor substitutes each initial calibration parameter in the initial calibration parameters into a corresponding iteration function to obtain a calculation result; the processor continuously substitutes the calculation result into an iteration function to obtain a first iteration result; and the processor subsequently substitutes the iteration result obtained last time into the iteration function to obtain the iteration result of this time, and the iteration is finished to obtain the calibration parameter when the iteration result of a certain time meets the preset condition.
For example, the processor will fxAnd P1Adding to obtain a calculation result; continuing the result of the first addition with P1Adding to obtain a result of the first iteration; continuing the result of the first addition with P1Adding to obtain a result of the second iteration; then, the last iteration result is continued to be compared with P1Adding until a preset condition is met, and taking the result obtained when the preset condition is met as fDx(ii) a Analogously f can be obtained by the process described aboveDy、Dax0、Day0、Dx0、Dy0
Optionally, in step d, the preset condition may be divided into two types, one is to set the number of iterations, and the processor takes the result of the 1000 th iteration as the calibration parameter; the other is that the processor substitutes the iteration result obtained in each time into Fi、GiUntil F is obtainedi、GiSatisfies the set conditionsAnd ending the iteration, and taking the result of the last iteration as the calibration parameter.
Through the four steps, the obtained calibration parameters can be more accurate, so that the subsequent gun and ball positioning precision is higher.
Step 104: the processor acquires the position of a target point in an image acquired by the gun camera, and determines a target corner corresponding to the target point according to the calibration parameters, wherein the target corner is used for indicating the ball machine to rotate to take the target point as the center.
Optionally, the position of the target point acquired by the processor includes: the target position x of the target point in the image collected by the bolt face in the horizontal direction and the target position y of the target point in the image collected by the bolt face in the vertical direction.
After the processor obtains the calibration parameters by executing step 103, the processor determines the target rotation angle corresponding to the target point according to the calibration parameters, and optionally, the specific method may include the following steps:
a1, the processor according to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx
Optionally, TxConforms to the formula thirty-four:
b1, the processor according to y, Dy0、fDyDetermining a coordinate point corresponding to an optical center in an image acquired by the gun camera in the dome camera asThe projection angle T of the actual scenery corresponding to the target point in the vertical direction when observing the pointy
Optionally, TyConforms to the formula thirty-five:
c1, the processor is according to Tx、TyAnd determining an included angle r between the actual scene corresponding to the target point and the image collected by the gun camera.
Optionally, r conforms to the formula thirty-six:
r=atg(tan(Ty)*cos(Tx) Thirty-six of the formula;
d1, the processor is according to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
Optionally, the target rotation angle corresponding to the target point determined by the processor includes: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
The processor is according to Tx、r、Day0And determining a target corner corresponding to the target point, wherein the specific method comprises the following steps:
the processor is according to Tx、r、Day0Determining the intermediate quantity rt,rtConforms to the formula thirty-seven:
the processor is according to Tx、r、Day0Determining the intermediate quantity Tax,TaxConforms to the formula thirty-eight:
the processor is according to TaxDetermining ax
The processor is according to rt、TaxDetermining ay
Optionally, axConforms to the formula thirty-nine:
ayaccording to equation forty:
by executing the step 104, the processor may determine a target rotation angle corresponding to a target point in the image acquired by the bolt according to the calibration parameter, and further, the processor may determine a target rotation angle corresponding to any point in the image acquired by the bolt according to the calibration acquisition parameter, that is, the processor may control the ball machine to rotate to a position where any point in the image acquired by the bolt is taken as a center, thereby achieving positioning between the bolt and the ball machine, and the positioning accuracy is high and the accuracy is high.
By adopting the gun and ball positioning method provided by the embodiment of the invention, the processor selects N reference points from the reference image acquired by the gun camera, determines the calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, and further determines the target rotation angle corresponding to the target point in the image acquired by the gun camera. Therefore, the processor can complete the positioning between the gun balls only by calibrating at least three reference points, and the positioning precision and the positioning accuracy are high.
Based on the above embodiments, an embodiment of the present invention further provides a rifle ball positioning device, which has a function of implementing a rifle ball positioning method as shown in fig. 1, and as shown in fig. 2, the device 200 includes: an acquisition unit 201 and a processing unit 202, wherein,
the acquiring unit 201 is configured to acquire a reference image acquired by a bolt face and select N reference points from the reference image, where N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear;
the processing unit 202 is configured to determine, for each reference point in the N reference points, a rotation angle corresponding to the ball machine with the reference point as a center, where the rotation angle corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to the center with the reference point as the center and a set reference angle, and a distance between the ball machine and the rifle bolt is within a set range; and
determining calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock;
the acquiring unit 201 is further configured to acquire a position of a target point in an image acquired by the bolt;
the processing unit 202 is further configured to determine a target rotation angle corresponding to the target point according to the calibration parameter, where the target rotation angle is used to instruct the ball machine to rotate to the target point as the center.
Optionally, when determining the calibration parameter according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, the processing unit 202 is specifically configured to:
obtaining initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
determining a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point;
generating an iterative function of each initial calibration parameter according to the calibration matrix;
and iterating according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and ending iteration to obtain the calibration parameters.
Optionally, in the calibration parameters, the calibration position where the optical center point of the bolt in the reference image is located includes: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a When the ball machine takes the calibration position as the center, the calibration corner corresponding to the calibration position comprises: when the ball machine takes the calibration position as the center, the calibration corner in the horizontal direction corresponding to the calibration positionThe ball machine takes the calibration position as the center, and the calibration corner D of the ball machine in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibrated equivalent focal length f of the rifle bolt in the horizontal directionDxCalibrating equivalent focal length f in the vertical direction of the boltDy
Optionally, the position of the ith reference point in the N reference points includes: the position x of the reference point in the horizontal direction in the reference imageiThe position y of the reference point in the vertical direction in the reference imagei(ii) a The corresponding turning angle of the reference point comprises: when the ball machine takes the reference point as the center, the rotating angle b of the reference point in the horizontal direction corresponds toxiAnd the corner b in the vertical direction corresponding to the reference point when the ball machine takes the reference point as the centeryi(ii) a Wherein i is a positive integer less than or equal to N;
the initial position of the optical center point of the bolt in the reference image comprises: an initial position x in the horizontal direction of the optical center point of the bolt in the reference image0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a When the ball machine takes the initial position as the center, the initial corner corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0And the initial corner a in the vertical direction corresponding to the initial position when the ball machine takes the initial position as the centery0
x0According to the formulaWherein W is the width of the reference image;
y0according to the formulaWherein H is the height of the reference image;
ax0according to the formula
ay0According to the formula
Optionally, when the position of the target point includes: when the target position x in the horizontal direction where the target point is located in the image collected by the bolt face and the target position y in the vertical direction where the target point is located in the image collected by the bolt face are determined according to the calibration parameter, the processing unit 202 is specifically configured to:
according to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx(ii) a Wherein, optionally, TxAccording to the formula
According to y, Dy0、fDyDetermining the projection angle T of the actual scenery corresponding to the target point in the vertical direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointy(ii) a Wherein, optionally, TyAccording to the formula
According to Tx、TyDetermining the actual scene corresponding to the target point and the gunThe included angle r of the image collected by the camera; where, optionally, r conforms to the formula r ═ atg (tan (T)y)*cos(Tx));
According to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
Optionally, the target rotation angle corresponding to the target point determined by the processing unit 202 includes: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
The processing unit 202 is in accordance with Tx、r、Day0And when determining the target rotation angle corresponding to the target point, specifically:
according to Tx、r、Day0Determining the intermediate quantity rt,rtAccording to the formula
According to Tx、r、Day0Determining the intermediate quantity Tax,TaxAccording to the formula
According to TaxDetermining ax(ii) a Wherein, optionally, axAccording to the formula
According to rt、TaxDetermining ay(ii) a Wherein, optionally, ayAccording to the formula
By adopting the gun ball positioning device provided by the embodiment of the invention, N reference points are selected from a reference image acquired by a gun camera, calibration parameters are determined according to the positions of the N reference points in the reference image and the rotating angle corresponding to each reference point, and then the target rotating angle corresponding to a target point in the image acquired by the gun camera is determined. Therefore, the gun ball positioning can be completed only by calibrating at least three reference points, and the positioning precision and the positioning accuracy are high.
In summary, in the method, a processor selects N reference points from a reference image acquired by a bolt face, and determines a calibration parameter according to positions of the N reference points in the reference image and a rotation angle corresponding to each reference point, thereby determining a target rotation angle corresponding to a target point in the image acquired by the bolt face. Therefore, the processor can complete the positioning between the gun balls only by calibrating at least three reference points, and the positioning precision and the positioning accuracy are high.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (14)

1. A rifle ball positioning method, comprising:
acquiring a reference image acquired by a gun camera, and selecting N reference points from the reference image, wherein N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear;
aiming at each reference point in the N reference points, determining a corresponding corner of the ball machine when the ball machine takes the reference point as the center, wherein the corner corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to take the reference point as the center and a set reference angle, and the distance between the ball machine and the rifle bolt is within a set range;
determining calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock;
and acquiring the position of a target point in an image acquired by the gun camera, and determining a target corner corresponding to the target point according to the calibration parameters, wherein the target corner is used for indicating the ball machine to rotate to the target point as the center.
2. The method according to claim 1, wherein determining the calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point comprises:
obtaining initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
determining a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point;
generating an iterative function of each initial calibration parameter according to the calibration matrix;
and iterating according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and ending iteration to obtain the calibration parameters.
3. The method of claim 2, wherein the location of the ith reference point of the N reference points comprises: what is needed isThe position x of the reference point in the horizontal direction in the reference imageiThe position y of the reference point in the vertical direction in the reference imagei(ii) a The corresponding turning angle of the reference point comprises: when the ball machine takes the reference point as the center, the rotating angle b of the reference point in the horizontal direction corresponds toxiAnd the corner b in the vertical direction corresponding to the reference point when the ball machine takes the reference point as the centeryi(ii) a Wherein i is a positive integer less than or equal to N;
the initial position of the optical center point of the bolt in the reference image comprises: the reference image is the initial position x of the horizontal direction where the optical center point of the bolt is located0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a When the ball machine takes the initial position as the center, the initial corner corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0And the initial corner a in the vertical direction corresponding to the initial position when the ball machine takes the initial position as the centery0
x0According to the formulaWherein W is the width of the reference image;
y0according to the formulaWherein H is the height of the reference image;
ax0according to the formula
ay0According to the formula
4. The method of any one of claims 1-3, wherein when the location of the target point comprises: determining a target corner corresponding to the target point according to the calibration parameters when the target position x in the horizontal direction where the target point is located in the image collected by the bolt machine and the target position y in the vertical direction where the target point is located in the image collected by the bolt machine are the same, including:
in the calibration parameters, the calibration position where the optical center point of the bolt in the reference image is located includes: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a When the ball machine takes the calibration position as the center, the calibration corner corresponding to the calibration position comprises: when the ball machine takes the calibration position as the center, the calibration corner in the horizontal direction corresponding to the calibration positionThe ball machine takes the calibration position as the center, and the calibration corner D of the ball machine in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibrated equivalent focal length f of the rifle bolt in the horizontal directionDxCalibrating equivalent focal length f in the vertical direction of the boltDy
According to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx
According to y, Dy0、fDyDetermining the projection angle T of the actual scenery corresponding to the target point in the vertical direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointy
According to Tx、TyDetermining the actual scene corresponding to the target point and the target pointThe included angle r of the image collected by the gunlock;
according to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
5. The method of claim 4,
Txaccording to the formula
TyAccording to the formula
6. A method as claimed in claim 4, wherein r conforms to the formula r ═ atg (tan (T)y)*cos(Tx))。
7. The method of claim 4, wherein determining the target rotation angle corresponding to the target point comprises: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
According to Tx、r、Day0Determining a target rotation angle corresponding to the target point, including:
according to Tx、r、Day0Determining the intermediate quantity rt,rtAccording to the formula
According to Tx、r、Day0Determining the intermediate quantity Tax,TaxAccording to the formula
According to TaxDetermining ax(ii) a Wherein,
according to rt、TaxDetermining ay(ii) a Wherein,
8. a rifle ball locating device, comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a reference image acquired by a gunlock and selecting N reference points from the reference image, wherein N is a positive integer greater than or equal to 3, and at least three reference points in the N reference points are not collinear;
the processing unit is used for determining a corner corresponding to the ball machine by taking the reference point as the center aiming at each reference point in the N reference points, wherein the corner corresponding to each reference point is a rotation angle between an angle when the ball machine rotates to take the reference point as the center and a set reference angle, and the distance between the ball machine and the rifle bolt is within a set range; and
determining calibration parameters according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, wherein the calibration parameters comprise: the calibration position of the optical center point of the gunlock in the reference image, the calibration rotation angle corresponding to the calibration position when the ball machine takes the calibration position as the center, and the calibration equivalent focal length of the gunlock;
the acquisition unit is also used for acquiring the position of a target point in the image acquired by the bolt face;
the processing unit is further configured to determine a target corner corresponding to the target point according to the calibration parameter, where the target corner is used to instruct the ball machine to rotate to the target point as the center.
9. The apparatus according to claim 8, wherein the processing unit, when determining the calibration parameter according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point, is specifically configured to:
obtaining initial calibration parameters, wherein the initial calibration parameters comprise: the initial position of the optical center point of the rifle bolt in the reference image, the initial corner corresponding to the initial position when the ball machine takes the initial position as the center, and the preset initial equivalent focal length of the rifle bolt;
determining a calibration matrix according to the positions of the N reference points in the reference image and the rotation angle corresponding to each reference point;
generating an iterative function of each initial calibration parameter according to the calibration matrix;
and iterating according to each initial calibration parameter in the initial calibration parameters and the corresponding iteration function until a preset condition is met, and ending iteration to obtain the calibration parameters.
10. The apparatus of claim 9, wherein the location of the ith reference point of the N reference points comprises: the position x of the reference point in the horizontal direction in the reference imageiThe position y of the reference point in the vertical direction in the reference imagei(ii) a The corresponding turning angle of the reference point comprises: the ballThe rotation angle b of the reference point in the horizontal direction corresponds to when the machine takes the reference point as the centerxiAnd the corner b in the vertical direction corresponding to the reference point when the ball machine takes the reference point as the centeryi(ii) a Wherein i is a positive integer less than or equal to N;
the initial position of the optical center point of the bolt in the reference image comprises: the reference image is the initial position x of the horizontal direction where the optical center point of the bolt is located0And the initial position y of the reference image in the vertical direction where the optical center point of the bolt is located0(ii) a When the ball machine takes the initial position as the center, the initial corner corresponding to the initial position comprises: when the ball machine takes the initial position as the center, the initial corner a in the horizontal direction corresponding to the initial position is formed by the ball machinex0And the initial corner a in the vertical direction corresponding to the initial position when the ball machine takes the initial position as the centery0
x0According to the formulaWherein W is the width of the reference image;
y0according to the formulaWherein H is the height of the reference image;
ax0according to the formula
ay0According to the formula
11. The apparatus of any one of claims 8-10, wherein when the location of the target point comprises: when the target position x in the horizontal direction where the target point is located in the image collected by the bolt face and the target position y in the vertical direction where the target point is located in the image collected by the bolt face are determined according to the calibration parameters, the processing unit is specifically configured to:
in the calibration parameters, the calibration position where the optical center point of the bolt in the reference image is located includes: the calibration position D of the reference image in the horizontal direction where the optical center point of the bolt is locatedx0And a calibration position D in the vertical direction where the optical center point of the bolt in the reference image is locatedy0(ii) a When the ball machine takes the calibration position as the center, the calibration corner corresponding to the calibration position comprises: when the ball machine takes the calibration position as the center, the calibration corner in the horizontal direction corresponding to the calibration positionThe ball machine takes the calibration position as the center, and the calibration corner D of the ball machine in the vertical direction corresponding to the calibration positionay0(ii) a The calibration equivalent focal length of the bolt machine comprises the following steps: the calibrated equivalent focal length f of the rifle bolt in the horizontal directionDxCalibrating equivalent focal length f in the vertical direction of the boltDy
According to x, Dx0、fDxDetermining the projection angle T of the actual scenery corresponding to the target point in the horizontal direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointx
According to y, Dy0、fDyDetermining the projection angle T of the actual scenery corresponding to the target point in the vertical direction when the ball machine takes the coordinate point of the corresponding optical center in the image collected by the gun camera as the observation pointy
According to Tx、TyDetermining an included angle r between the actual scene corresponding to the target point and the image collected by the gun camera;
according to Tx、r、Day0And determining a target rotation angle corresponding to the target point.
12. The apparatus of claim 11,
Txaccording to the formula
TyAccording to the formula
13. An apparatus as claimed in claim 11, wherein r conforms to the formula r-atg (tan (T)y)*cos(Tx))。
14. The apparatus of claim 11, wherein the target rotation angle corresponding to the target point determined by the processing unit comprises: when the ball machine takes the target point as the center, the target corner a in the horizontal direction corresponding to the target pointxAnd the target corner a in the vertical direction corresponding to the target point when the ball machine takes the target point as the centery
The processing unit is based on Tx、r、Day0And when determining the target rotation angle corresponding to the target point, specifically:
according to Tx、r、Day0Determining the intermediate quantity rt,rtAccording to the formula
According to Tx、r、Day0Determining the intermediate quantity Tax,TaxAccording to the formula
According to TaxDetermining ax(ii) a Wherein,
according to rt、TaxDetermining ay(ii) a Wherein,
CN201611105536.5A 2016-12-05 2016-12-05 A kind of rifle ball positioning method and device Active CN106780602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611105536.5A CN106780602B (en) 2016-12-05 2016-12-05 A kind of rifle ball positioning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611105536.5A CN106780602B (en) 2016-12-05 2016-12-05 A kind of rifle ball positioning method and device

Publications (2)

Publication Number Publication Date
CN106780602A CN106780602A (en) 2017-05-31
CN106780602B true CN106780602B (en) 2019-09-17

Family

ID=58874234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611105536.5A Active CN106780602B (en) 2016-12-05 2016-12-05 A kind of rifle ball positioning method and device

Country Status (1)

Country Link
CN (1) CN106780602B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110248148B (en) * 2018-09-25 2022-04-15 浙江大华技术股份有限公司 Method and device for determining positioning parameters
TWI720447B (en) 2019-03-28 2021-03-01 財團法人工業技術研究院 Image positioning method and system thereof
CN112802121B (en) * 2021-01-14 2023-09-05 杭州海康威视数字技术股份有限公司 Calibration method of monitoring camera

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103700140A (en) * 2014-01-06 2014-04-02 武汉烽火众智数字技术有限责任公司 Spatial modeling method used for linkage of single gun camera and multiple dome cameras
CN105635651A (en) * 2014-10-29 2016-06-01 浙江大华技术股份有限公司 Pan/tilt/zoom positioning method and pan/tilt/zoom positioning device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5464955B2 (en) * 2009-09-29 2014-04-09 株式会社ソニー・コンピュータエンタテインメント Panorama image display device
CN103679687A (en) * 2012-09-18 2014-03-26 杭州海康威视数字技术股份有限公司 Target tracking method of intelligent tracking high-speed dome camera

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103700140A (en) * 2014-01-06 2014-04-02 武汉烽火众智数字技术有限责任公司 Spatial modeling method used for linkage of single gun camera and multiple dome cameras
CN105635651A (en) * 2014-10-29 2016-06-01 浙江大华技术股份有限公司 Pan/tilt/zoom positioning method and pan/tilt/zoom positioning device

Also Published As

Publication number Publication date
CN106780602A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106780602B (en) A kind of rifle ball positioning method and device
TWI720447B (en) Image positioning method and system thereof
CN109887087B (en) SLAM mapping method and system for vehicle
Magerand et al. Global optimization of object pose and motion from a single rolling shutter image with automatic 2d-3d matching
CN109313814A (en) Camera calibration system
CN110686595B (en) Laser beam spatial pose calibration method for non-orthogonal axis laser total station
CN107392961B (en) space positioning method and device based on augmented reality
JP2017529959A5 (en)
JP2014017539A5 (en)
CN106095103B (en) Virtual reality display control method and device and related equipment
JP6319804B2 (en) Projection image generation apparatus, projection image generation method, and projection image generation program
CN109242914A (en) A kind of stereo calibration method of movable vision system
CN106780610B (en) Position positioning method and device
JP2017208606A5 (en)
JP2015041884A5 (en)
CN103595915A (en) Method for controlling video location positioning of high-definition speed dome camera
JP2021078692A5 (en)
JP7033294B2 (en) Imaging system, imaging method
CN117911629B (en) Virtual screen display method and display system
CN106355617A (en) Dynamic positioning algorithm in the motion capture system
CN114724200B (en) Human face rigid body model and method, device and storage medium for gaze point detection
JP2012235255A5 (en) Image processing apparatus, image processing method, and program
JP2022159118A (en) Method for forming image of object, computer program product, and image forming system for carrying out method
Zeng et al. A 3D passive optical localization system based on binocular infrared cameras
JP6525195B2 (en) Method of estimating internal parameters of fisheye camera, estimation device, and estimation program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Zhejiang Huarui Technology Co.,Ltd.

Address before: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder