CN113838095B - Personnel tracking ball machine control method based on speed control - Google Patents
Personnel tracking ball machine control method based on speed control Download PDFInfo
- Publication number
- CN113838095B CN113838095B CN202111143825.5A CN202111143825A CN113838095B CN 113838095 B CN113838095 B CN 113838095B CN 202111143825 A CN202111143825 A CN 202111143825A CN 113838095 B CN113838095 B CN 113838095B
- Authority
- CN
- China
- Prior art keywords
- target
- ball machine
- image
- speed
- zoom
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000008859 change Effects 0.000 claims abstract description 14
- 238000004364 calculation method Methods 0.000 claims description 34
- 238000012545 processing Methods 0.000 claims description 6
- 230000000007 visual effect Effects 0.000 claims description 4
- 230000009467 reduction Effects 0.000 claims description 3
- 230000000694 effects Effects 0.000 description 7
- 238000012544 monitoring process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Numerical Control (AREA)
- Studio Devices (AREA)
Abstract
The invention provides a personnel tracking ball machine control method based on speed control, which comprises the following steps: s1, learning a ball machine offline, and obtaining the relation between a Zoom coefficient of the ball machine and a corresponding Zoom coordinate value, and marking the relation as F (z, F); s2, learning the ball machine offline, and obtaining the relation between the horizontal movement component and the vertical movement component of the ball machine under different pitch angles T, wherein the relation is marked as F (T, tan alpha); s3, judging whether the current target is in the central region of the image; and S4, if the current target is in the central area of the image, controlling the spherical machine to change the magnification according to the relation between the spherical machine magnification changing coefficient and the corresponding Zoom coordinate value. The personnel tracking ball machine control method based on speed control has good applicability to different ball machines, can be suitable for digital ball machines of various brands and models in the market, and can adapt to target tracking of different scenes by selecting proper parameters.
Description
Technical Field
The invention belongs to the field of ball machine control, and particularly relates to a personnel tracking ball machine control method based on speed control.
Background
With the development of society and the progress of science and technology, to improve the operation benefit of ports, the operation safety of ports gradually develop towards unmanned automation. Personnel can have certain risk when entering harbour key areas (including field bridges, shore bridges, yards, main roads and the like), so that a set of automatic monitoring equipment is needed to track the personnel track in real time, on one hand, the rear-end management and control personnel can master the real-time condition of front-end operators, and on the other hand, the safety of the operation can be ensured.
The attitude of the ball machine (Pan/Tilt) is composed of three parts of Pan (horizontal rotation angle, hereinafter abbreviated as P), tilt (vertical rotation angle, i.e., pitch angle, hereinafter abbreviated as T), and Zoom (dimensionless focal length, hereinafter abbreviated as Z), and when three coordinate values of the ball machine (Pan/Tilt) are given, the absolute attitude of the ball machine (Pan/Tilt) can be fixed. The automatic target tracking is to control the ball machine (cradle head) to track the target automatically by utilizing the ball machine (cradle head) control algorithm and combining the target detection tracking algorithm. In the control algorithm, basic control of the ball machine (cradle head) is generally realized based on a control protocol of the ball machine (cradle head), and the basic control comprises up-down, left-right zooming-in and zooming-out and the like.
The conventional dome camera (cradle head) algorithm based on video stream images generally uses a PID algorithm to control a target position according to the proportion (P), integral (I) and derivative (D) of deviation. PID control has the advantages of simple principle, easy realization, mutually independent control parameters, simple parameter selection, closed-loop control and the like. However, the conventional PID control is easy to generate obvious overshoot due to the problem of adaptability to the diversity of target speeds, and reflects the target deviation in the video to cause the image center, and finally causes tracking failure.
Disclosure of Invention
In view of the above, the invention aims to provide a personnel trackball machine control method based on speed control so as to solve the problem of adaptation of the existing PID control algorithm to target diversity.
In order to achieve the above purpose, the technical scheme of the invention is realized as follows:
the personnel trackball machine control method based on speed control comprises the following steps:
s1, learning a ball machine offline, and obtaining the relation between a Zoom coefficient of the ball machine and a corresponding Zoom coordinate value, and marking the relation as F (z, F);
s2, learning the ball machine offline, and obtaining the relation between the horizontal movement component and the vertical movement component of the ball machine under different pitch angles T, wherein the relation is marked as F (T, tan alpha);
s3, judging whether the current target is in the central region of the image;
s4, if the current target is in the central area of the image, controlling the spherical machine to change the magnification according to the relation between the spherical machine magnification changing coefficient and the corresponding Zoom coordinate value;
s5, if the current target is not in the central area of the image, judging whether the current target is a first speed value in the horizontal direction and the vertical direction of the target, calculating the speed values in the horizontal direction and the vertical direction of the target according to a judging result, and controlling the ball machine to rotate and track the target according to the calculated speed value;
and S6, repeating the steps S3 to S5 until the current target leaves the visual area of the dome camera, and controlling the dome camera to rotate back to the original preset position.
Further, the method for obtaining the relationship between the Zoom coefficient of the dome camera and the corresponding Zoom coordinate value in step S1 is as follows: and sequentially controlling the ball machine to perform Zoom operation under each z coordinate, respectively calculating corresponding Zoom values F of two adjacent z coordinate position images by using an image matching algorithm, recording the relation between the corresponding z coordinate positions and the Zoom values F, and obtaining the relation between the Zoom coefficient of the ball machine and the corresponding Zoom coordinate values, and marking as F (z, F).
Further, the specific method for obtaining the relationship between the horizontal motion component and the vertical motion component of the ball machine in step S2 is as follows:
s571, under the TILT coordinate t0, recording the current image as M0, and controlling the ball machine to sequentially rotate three different angles to the right to respectively obtain images M1, M2 and M3;
s572, acquiring the center (x 0, y 0) of the image M0 by using an image matching algorithm, and sequentially acquiring corresponding positions (x 1, y 1), (x 2, y 2), (x 3, y 3) in the images M1, M2, M3;
s573, calculating a relation Tan alpha between a motion component and a component of vertical motion when the ball machine rotates horizontally under a t0 coordinate system, wherein the calculation formula is as follows:
ΔX1=x1-x0,ΔY1=y1-y0;tanα1=ΔX1/ΔY1;
ΔX2=x2-x0,ΔY2=y2-y0;tanα2=ΔX2/ΔY2;
ΔX3=x3-x0,ΔY3=y3-y0;tanα3=ΔX3/ΔY3;
Tanα=(tanα1+tanα2+tanα3)/3;
s574, at different TILT coordinates t n Lower calculation of corresponding Tan alpha n The corresponding relationship is recorded in turn, denoted as F (t n ,Tanα n ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein n is greater than or equal to 0.
Further, the specific step of determining whether the current target is in the central area of the image in the step S3 is as follows:
s31, setting the left upper corner coordinate of a target frame of the target as (Xti, yti); the center coordinates of the image are (X0, Y0), the length of the image is W, the width of the image is H, and the calculation formula of the radius R of the center area of the image is:
R=(Xti-X0)*(Xti-X0)+(Yti-Y0)*(Yti-Y0);
s32, if R > W0.175 and R < W0.375, then the target is in the image center region, otherwise the target is not in the image center region.
Further, the specific steps of controlling the ball machine to perform zooming in the step S4 are as follows:
s41, judging whether the zoom of the dome camera needs to be controlled according to the proportion of the target size to the image size of the whole dome camera;
s42, if the ball machine does not need to change the magnification, the current frame image processing is finished;
and S43, if the zoom of the dome camera is needed, controlling the zoom of the dome camera, and after the zoom of the dome camera is finished, finishing the processing of the current frame image.
Further, in the step S43, the specific manner of zooming the ball machine is as follows:
s431, calculating the zoom coefficient of the ball machine as delta S according to the length and the width of the target, wherein the calculation formula is as follows:
s1=Wt*4/W;
s2=Ht*4/H;
Δs=min (S1, S2); wherein Wt represents the length of the target, ht represents the width of the target, W represents the length of the image, and H represents the width of the image;
s432, recording Z coordinate values of the current ball machine as Z0, and recording Z coordinates adjacent to Z0 in F (Z, F) as Zm and Z (m+1) respectively; wherein Zm < Z0, Z (m+1) is greater than or equal to Z0;
zm and Z (m+1) are brought into a relation F (Z, F), and the corresponding zoom factor Fm and F (m+1) are obtained, wherein the calculation formula is as follows:
f'=(Z-Zm/Z(m+1)-Zm)*F(m+1);
wherein F represents the calculated zoom factor;
s433, setting a corresponding subscript as n when the F value is larger than DeltaS, recording a corresponding Z coordinate as Zn, and recording a corresponding F value as Fn; the new Zoom coordinate value Z' is calculated as follows:
Z'=Zn*(F-ΔS)/Fn;
s434, controlling the ball machine to change the magnification according to the new Zoom coordinate value Z'.
Further, in the step S5, when the speed values in the horizontal and vertical directions are calculated for the first time, the specific calculation steps of the speed values in the horizontal and vertical directions are as follows:
s51, setting the left upper corner coordinates of a target frame of a target as (Xt 0, yt 0), the length of the target frame as Wt0 and the width of the target frame as Ht0; setting the center coordinates of the image as (X0, Y0), the length of the image as W and the width of the image as H;
s52, a calculation formula of the velocity value P (Vxto) in the target horizontal direction is as follows:
p (Vxto) = (Xt 0-X0) ×2xvp0/W; wherein, vp0 is an adjustable parameter, vpp 0 is more than 0 and less than or equal to 100;
s53, calculating a speed value T (Vyto) of the target in the vertical direction as follows:
t (Vyto) = (Yt 0-Y0) 2×vt0/H; wherein Vt0 is an adjustable parameter, and Vt0 is more than 0 and less than or equal to 100;
s54, setting a control expectation, and recording an expected value of the control expectation as xi; wherein, controlling the expected representation makes the goal locate at the centre of the picture, need to control the number of times that the ball machine rotates;
s56, calculating control results delta X and delta Y according to the expected value xi, wherein the calculation formula is as follows:
ΔX=(Xt0-X0)/ξ;
ΔY=(Xt0-X0)/ξ;
wherein, xi is an adjustable parameter, and xi is more than or equal to 1; the control result indicates the distance of the object near the center of the image.
Further, in the step S5, when the target does not perform the calculation of the velocity values in the horizontal and vertical directions for the first time, the specific calculation steps of the velocity values in the horizontal and vertical directions of the target are as follows:
s57, calculating the difference value between the distance between the current frame target and the center of the previous frame target, and respectively recording the difference value as delta Xt and delta Yt; calculating new offset delta Xt 'and delta Yt' corresponding to delta Xt according to F (t, tanα);
recording the current TILT coordinate as t and the corresponding offset relation angle as alpha; then for deltaxt, new offsets deltaxt 'and deltayt' due to the rotation of the ball machine can be generated as follows:
ΔYt'=ΔXt/Tanα;
ΔXt'=ΔXt;
if Deltat' > DeltaX, the horizontal direction of the ball machine is adjusted too fast, and the speed is required to be reduced; if Deltat' < DeltaX, the horizontal direction of the ball machine is adjusted too slowly, and the speed is required to be increased; wherein Δx is the control result in step S56;
if Deltat '> DeltaY represents that the vertical direction of the ball machine is adjusted too fast, the speed needs to be reduced, and if Deltat' < DeltaY represents that the vertical direction of the ball machine is adjusted too slow, the speed needs to be increased; wherein Δy is the control result in step S56;
s58, setting the current learning rate as le; wherein le >0;
assuming that the control speeds of the previous frame target are P (Vt-1) and T (Vt-1), the speeds PVt and TVt of the current frame are:
during the speed reduction: pvt=p (Vt-1) ×1-le |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1-le) |ΔYt'-Yt| ;
Pvt=p (Vt-1) ×1+le at the speed increase |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1+le) |ΔYt'-Yt| ;
And S59, controlling the ball machine to rotate according to the calculated speed values PVt and TVt.
Compared with the prior art, the personnel trackball machine control method based on speed control has the following advantages:
the personnel tracking ball machine control method based on speed control has good applicability to different ball machines, can be suitable for digital ball machines of various brands and models in the market, is simple to operate, and can adapt to the target adaptability tracking problem of different scenes by selecting proper parameters; the invention can ensure that the ball machine always accurately tracks the target, is beneficial to improving the continuous tracking effect of the ball machine on the target, can also improve the stability of the ball machine in the process of following the rotation of the target, ensures that the ball machine can clearly shoot or identify the target, and is beneficial to improving the monitoring effect of the ball machine.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention. In the drawings:
FIG. 1 is a flow chart of a method for controlling a personal trackball based on speed control according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an automatic tracking system based on speed control personnel according to an embodiment of the present invention.
Detailed Description
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other.
In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", etc. may explicitly or implicitly include one or more such feature. In the description of the present invention, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be either fixedly connected, detachably connected, or integrally connected, for example; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art in a specific case.
The invention will be described in detail below with reference to the drawings in connection with embodiments.
The following names appear below with reference to the following explanation, as shown in fig. 1 and 2: 1. image: generally refers to all pictures with visual effects, in which the figures refer to digital images for recording information of points on the images. 2. The object is: refer broadly to objects of interest to a user in an image, such as a person, a car, a boat, etc. 3. Target position: refers to the circumscribed rectangle of the object in the image. 4. Ball machine position: the posture of the ball machine consists of three parts, namely Pan (horizontal rotation angle), tilt (vertical rotation angle, namely pitch angle) and Zoom (nondimensional focal length).
The personnel trackball machine control method based on speed control comprises the following steps: s1, learning a ball machine offline, and obtaining the relation between a Zoom coefficient of the ball machine and a corresponding Zoom coordinate value, and marking the relation as F (z, F); learning the ball machine offline, and obtaining the relation between the horizontal movement component and the vertical movement component of the ball machine under different pitch angles T, wherein the relation is marked as F (T, tan alpha); s3, judging whether the current target is in the central region of the image; s4, if the current target is in the central area of the image, controlling the spherical machine to change the magnification according to the relation between the spherical machine magnification changing coefficient and the corresponding Zoom coordinate value; s5, if the current target is not in the central area of the image, judging whether the current target is a first speed value in the horizontal direction and the vertical direction of the target, calculating the speed values in the horizontal direction and the vertical direction of the target according to a judging result, and controlling the ball machine to rotate and track the target according to the calculated speed value; and S6, repeating the steps S3 to S5 until the current target leaves the visual area of the dome camera, and controlling the dome camera to rotate back to the original preset position.
The method for obtaining the relation between the Zoom coefficient of the dome camera and the corresponding Zoom coordinate value in the step S1 is as follows: and sequentially controlling the ball machine to perform Zoom operation under each z coordinate, respectively calculating corresponding Zoom values F of two adjacent z coordinate position images by using an image matching algorithm, recording the relation between the corresponding z coordinate positions and the Zoom values F, and obtaining the relation between the Zoom coefficient of the ball machine and the corresponding Zoom coordinate values, and marking as F (z, F).
The specific method for obtaining the relationship between the horizontal motion component and the vertical motion component of the ball machine in the step S2 is as follows: under the TILT coordinate t0, recording the current image as M0, and controlling the ball machine to sequentially rotate three different angles to the right to respectively obtain images M1, M2 and M3;
optionally, firstly, under the t0 coordinate, recording the current image as M0, and controlling the ball machine to sequentially rotate to the right for different degrees, such as 10 degrees, 20 degrees and 30 degrees, so as to respectively obtain images M1, M2 and M3;
then, the center (x 0, y 0) of the image M0 can be obtained by using the existing image matching algorithm, and corresponding positions (x 1, y 1), (x 2, y 2), (x 3, y 3) in the images M1, M2, M3 are sequentially obtained; calculating a relation Tanα between a motion component and a component of vertical motion when the ball machine rotates horizontally under a t0 coordinate system, wherein the calculation formula is as follows:
ΔX1=x1-x0,ΔY1=y1-y0;tanα1=ΔX1/ΔY1;
ΔX2=x2-x0,ΔY2=y2-y0;tanα2=ΔX2/ΔY2;
ΔX3=x3-x0,ΔY3=y3-y0;tanα3=ΔX3/ΔY3;
Tanα=(tanα1+tanα2+tanα3)/3;
finally, sitting at a different TILTLabel t n Lower calculation of corresponding Tan alpha n The corresponding relationship is recorded in turn, denoted as F (t n ,Tanα n ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein n is more than or equal to 0; for example, the corresponding Tan alpha at TILT coordinates t1, t2, t3, t4, t5 to t10 may be calculated sequentially n Obtaining the relation between the motion component and the motion component in the vertical direction when the ball machine horizontally rotates; in the actual debugging process, the number of times of calculation can be increased or decreased by those skilled in the art as required.
The invention solves the problem of controlling the ball machine when the target is right below or near the ball machine, and the invention considers the curve rotation characteristic of the ball machine, and when the radian is bigger (namely the pitch angle of the ball machine is bigger), the components in the horizontal and vertical directions are bigger; the control method disclosed by the invention integrates the displacement component in the control of the ball machine by learning the relation between the pitch angle and the corresponding vertical component under horizontal rotation in advance, so that the problem of control failure of the ball machine when the pitch angle is overlarge in the conventional control method is solved.
The specific step of judging whether the current target is in the central area of the image in the step S3 is as follows: s31, setting the left upper corner coordinate of a target frame of the target as (Xti, yti); the center coordinates of the image are (X0, Y0), the length of the image is W, the width of the image is H, and the calculation formula of the radius R of the center area of the image is:
R=(Xti-X0)*(Xti-X0)+(Yti-Y0)*(Yti-Y0);
s32, if R > W0.175 and R < W0.375, then the target is in the image center region, otherwise the target is not in the image center region.
Optionally, 0.175 and 0.375 are both adjustable parameters, and in the actual calculation process, those skilled in the art can adjust as needed; wherein 0.175 and 0.375 respectively represent 1/8 and 3/8 of the image, and through practical tests, 0.175 and 0.375 are experience parameters, so that the method has a better reference effect, and can improve the accuracy of judging whether the target is in the central region of the image.
The specific steps for controlling the ball machine to change the magnification in the step S4 are as follows: s41, judging whether the zoom of the dome camera needs to be controlled according to the proportion of the target size to the image size of the whole dome camera; s42, if the ball machine does not need to change the magnification, the current frame image processing is finished; and S43, if the zoom of the dome camera is needed, controlling the zoom of the dome camera, and after the zoom of the dome camera is finished, finishing the processing of the current frame image.
Alternatively, the logic for determining the proportion of the target size to the size of the entire dome camera image may be: when the width or the height of the target is larger than 1/4 of the width or the height of the image, the target needs to be reduced to 1/4 of the image, and when the width or the height of the target is smaller than 1/8 of the width or the height of the image, the target needs to be enlarged to 1/4 of the image, wherein 1/4 is an adjustable parameter, and in the actual calculation process, the target can be adjusted according to the requirements of a person skilled in the art; through practical tests, 1/4 is an empirical parameter, has a better reference effect, and can improve the accuracy of whether the zoom judgment of the ball machine needs to be controlled.
In the step S43, the specific manner of zooming the ball machine is as follows: s431, calculating the zoom coefficient of the ball machine as delta S according to the length and the width of the target, wherein the calculation formula is as follows:
s1=wt×4/W; s2=ht 4/H; Δs=min (S1, S2); wherein Wt represents the length of the target, ht represents the width of the target, W represents the length of the image, and H represents the width of the image;
s432, recording Z coordinate values of the current ball machine as Z0, and recording Z coordinates adjacent to Z0 in F (Z, F) as Zm and Z (m+1) respectively; wherein Zm < Z0, Z (m+1) is greater than or equal to Z0; zm and Z (m+1) are brought into a relation F (Z, F), and the corresponding zoom factor Fm and F (m+1) are obtained, wherein the calculation formula is as follows:
f'=(Z-Zm/Z(m+1)-Zm)*F(m+1);
wherein F represents the calculated zoom factor;
s433, setting a corresponding subscript as n when the F value is larger than DeltaS, recording a corresponding Z coordinate as Zn, and recording a corresponding F value as Fn; the new Zoom coordinate value Z' is calculated as follows:
Z'=Zn*(F-ΔS)/Fn;
s434, controlling the ball machine to change the magnification according to the new Zoom coordinate value Z'.
The quantitative zoom is adopted, so that the problem of visibility is solved, namely, the zoom operation is carried out on the ball machine, so that the target is clearly presented in the image; the traditional zoom of the existing ball machine is qualitative zoom, namely only the zoom-in or zoom-out is known, so that the problem of overshoot easily occurs.
In the step S5, when the speed values in the horizontal and vertical directions of the target are calculated for the first time, the specific calculation steps of the speed values in the horizontal and vertical directions of the target are as follows: s51, setting the left upper corner coordinates of a target frame of a target as (Xt 0, yt 0), the length of the target frame as Wt0 and the width of the target frame as Ht0; setting the center coordinates of the image as (X0, Y0), the length of the image as W and the width of the image as H;
s52, a calculation formula of the velocity value P (Vxto) in the target horizontal direction is as follows:
p (Vxto) = (Xt 0-X0) ×2xvp0/W; wherein, vp0 is an adjustable parameter, vpp 0 is more than 0 and less than or equal to 100;
s53, calculating a speed value T (Vyto) of the target in the vertical direction as follows:
t (Vyto) = (Yt 0-Y0) 2×vt0/H; wherein Vt0 is an adjustable parameter, and Vt0 is more than 0 and less than or equal to 100;
s54, setting a control expectation, and recording an expected value of the control expectation as xi; wherein, controlling the expected representation makes the goal locate at the centre of the picture, need to control the number of times that the ball machine rotates;
s56, calculating control results delta X and delta Y according to the expected value xi, wherein the calculation formula is as follows:
ΔX=(Xt0-X0)/ξ;
ΔY=(Xt0-X0)/ξ;
wherein, xi is an adjustable parameter, and xi is more than or equal to 1; the control result indicates the distance of the object near the center of the image. Optionally, the ζ may be 15, and through an actual test, the expected value ζ is set to 15, so that the control requirement can be met, and compared with other data, the method has a better effect.
The invention can stably control the rotation of the ball machine, so that the target is clearly distinguished in the image all the time, and the problem that the ball machine can keep up with the target only by rotating faster under long focus when the zoom of the ball machine is larger, namely the focal length is increased; the goal can be gradually close to the center of the image after each time of the ball machine control by utilizing control expectations, so that the situation that the goal cannot be identified due to image blurring caused by mutation in large-scale rapid control is avoided, and the definition of the goal in the ball machine image is improved; the ball machine controlled by the control method can also be connected with the image storage device to realize the storage of the target image, thereby being convenient for the subsequent recording and analysis of the target.
In the step S5, when the target does not perform the calculation of the velocity values in the horizontal and vertical directions for the first time, the specific calculation steps of the velocity values in the horizontal and vertical directions of the target are as follows: s57, calculating the difference value between the distance between the current frame target and the center of the previous frame target, and respectively recording the difference value as delta Xt and delta Yt; calculating new offset delta Xt 'and delta Yt' corresponding to delta Xt according to F (t, tanα);
recording the current TILT coordinate as t and the corresponding offset relation angle as alpha; then for deltaxt, new offsets deltaxt 'and deltayt' due to the rotation of the ball machine can be generated as follows:
ΔYt'=ΔXt/Tanα;
ΔXt'=ΔXt;
if Deltat' > DeltaX, the horizontal direction of the ball machine is adjusted too fast, and the speed is required to be reduced; if Deltat' < DeltaX, the horizontal direction of the ball machine is adjusted too slowly, and the speed is required to be increased; wherein Δx is the control result in step S56;
if Deltat '> DeltaY represents that the vertical direction of the ball machine is adjusted too fast, the speed needs to be reduced, and if Deltat' < DeltaY represents that the vertical direction of the ball machine is adjusted too slow, the speed needs to be increased; wherein Δy is the control result in step S56;
s58, setting the current learning rate as le; wherein le >0;
assuming that the control speeds of the previous frame target are P (Vt-1) and T (Vt-1), the speeds PVt and TVt of the current frame are:
during the speed reduction: pvt=p (Vt-1) ×1-le |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1-le) |ΔYt'-Yt| ;
Pvt=p (Vt-1) ×1+le at the speed increase |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1+le) |ΔYt'-Yt| ;
And S59, controlling the ball machine to rotate according to the calculated speed values PVt and TVt.
The invention can adapt to different speeds of the target, can utilize the control acceleration to gradually match the control speed of the ball machine with the actual speed of the target, finally achieves the basic convergence of the speed of the ball machine and the speed of the target, improves the accuracy of tracking the target of the ball machine, and ensures that the ball machine can continuously and stably track the target for rotation.
The invention grasps the control problem essence of the ball machine, and solves the problems of control overshoot, unsmooth control, control failure under a large depression angle and the like in the traditional control by using the technologies and means of quantitative zoom, control expectation of a target position and a control expected position, learning rate, learning of a displacement relation between an image level and a vertical caused by mechanical movement of the ball machine, learning of a zoom curve of the ball machine and the like.
In an optional embodiment, in combination with the ball machine control method of the present invention, an automatic tracking system based on speed control personnel may be designed, where the system may include software and hardware devices and be deployed as follows: 1. the monitoring ball machines are respectively arranged at the positions of the personnel inlet and outlet; 2. the analysis server is deployed in an electrical room, and an automatic tracking system based on speed control is installed; 3. the video client is installed in the general control room.
The main working flow based on the automatic speed control personnel tracking system is as follows: 1. detecting personnel at a monitoring entrance in real time; 2. after the personnel are found, the personnel are tracked in real time by using a speed control-based ball machine control method; 3. storing the corresponding video, and displaying the track and the picture of the target in real time at the video client.
The personnel tracking ball machine control method based on speed control has good applicability to different ball machines, can be suitable for digital ball machines of various brands and models in the market, is simple to operate, and can adapt to the target adaptability tracking problem of different scenes by selecting proper parameters; the invention can ensure that the ball machine always accurately tracks the target, is beneficial to improving the continuous tracking effect of the ball machine on the target, can also improve the stability of the ball machine in the process of following the rotation of the target, ensures that the ball machine can clearly shoot or identify the target, and is beneficial to improving the monitoring effect of the ball machine.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.
Claims (6)
1. The personnel trackball machine control method based on speed control is characterized by comprising the following steps:
s1, learning a ball machine offline, and obtaining the relation between a Zoom coefficient of the ball machine and a corresponding Zoom coordinate value, and marking the relation as F (z, F);
s2, learning the ball machine offline, and obtaining the relation between the horizontal movement component and the vertical movement component of the ball machine under different pitch angles T, wherein the relation is marked as F (T, tan alpha);
s3, judging whether the current target is in the central region of the image;
s4, if the current target is in the central area of the image, controlling the spherical machine to change the magnification according to the relation between the spherical machine magnification changing coefficient and the corresponding Zoom coordinate value;
s5, if the current target is not in the central area of the image, judging whether the current target is a first speed value in the horizontal direction and the vertical direction of the target, calculating the speed values in the horizontal direction and the vertical direction of the target according to a judging result, and controlling the ball machine to rotate and track the target according to the calculated speed value;
s6, repeating the steps S3 to S5 until the current target leaves the visual area of the dome camera, and controlling the dome camera to rotate back to the original preset position;
the specific steps for controlling the ball machine to change the magnification in the step S4 are as follows:
s41, judging whether the zoom of the dome camera needs to be controlled according to the proportion of the target size to the image size of the whole dome camera;
s42, if the ball machine does not need to change the magnification, the current frame image processing is finished;
s43, if the ball machine needs to change the magnification, controlling the ball machine to change the magnification, and after the ball machine finishes changing the magnification, finishing the current frame image processing;
in the step S43, the specific manner of zooming the ball machine is as follows:
s431, calculating the zoom coefficient of the ball machine as delta S according to the length and the width of the target, wherein the calculation formula is as follows:
s1=Wt*4/W;
s2=Ht*4/H;
Δs=min (S1, S2); wherein Wt represents the length of the target, ht represents the width of the target, W represents the length of the image, and H represents the width of the image;
s432, recording Z coordinate values of the current ball machine as Z0, and recording Z coordinates adjacent to Z0 in F (Z, F) as Zm and Z (m+1) respectively; wherein Zm < Z0, Z (m+1) is greater than or equal to Z0;
zm and Z (m+1) are brought into a relation F (Z, F), and the corresponding zoom factor Fm and F (m+1) are obtained, wherein the calculation formula is as follows:
f'=(Z-Zm/Z(m+1)-Zm)*F(m+1);
wherein F represents the calculated zoom factor;
s433, setting a corresponding subscript as n when the F value is larger than DeltaS, recording a corresponding Z coordinate as Zn, and recording a corresponding F value as Fn; the new Zoom coordinate value Z' is calculated as follows:
Z'=Zn*(F-ΔS)/Fn;
s434, controlling the ball machine to change the magnification according to the new Zoom coordinate value Z'.
2. The speed control-based personnel trackball machine control method according to claim 1, wherein the acquiring method of the relationship between the Zoom coefficient of the dome machine and the corresponding Zoom coordinate value in step S1 is as follows: and sequentially controlling the ball machine to perform Zoom operation under each z coordinate, respectively calculating corresponding Zoom values F of two adjacent z coordinate position images by using an image matching algorithm, recording the relation between the corresponding z coordinate positions and the Zoom values F, and obtaining the relation between the Zoom coefficient of the ball machine and the corresponding Zoom coordinate values, and marking as F (z, F).
3. The method for controlling a personal trackball machine based on speed control according to claim 1, wherein the specific method for acquiring the relationship between the horizontal movement component and the vertical movement component of the dome machine in step S2 is as follows:
s571, under the TILT coordinate t0, recording the current image as M0, and controlling the ball machine to sequentially rotate three different angles to the right to respectively obtain images M1, M2 and M3;
s572, acquiring the center (x 0, y 0) of the image M0 by using an image matching algorithm, and sequentially acquiring corresponding positions (x 1, y 1), (x 2, y 2), (x 3, y 3) in the images M1, M2, M3;
s573, calculating a relation Tan alpha between a motion component and a component of vertical motion when the ball machine rotates horizontally under a t0 coordinate system, wherein the calculation formula is as follows:
ΔX1=x1-x0,ΔY1=y1-y0;tanα1=ΔX1/ΔY1;
ΔX2=x2-x0,ΔY2=y2-y0;tanα2=ΔX2/ΔY2;
ΔX3=x3-x0,ΔY3=y3-y0;tanα3=ΔX3/ΔY3;
Tanα=(tanα1+tanα2+tanα3)/3;
s574, at different TILT coordinates t n Lower calculation of corresponding Tan alpha n The corresponding relationship is recorded in turn, denoted as F (t n ,Tanα n ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein n is greater than or equal to 0.
4. The speed control-based personal trackball machine control method according to claim 1, wherein the specific step of determining whether the current target is in the image center area in step S3 is as follows:
s31, setting the left upper corner coordinate of a target frame of the target as (Xti, yti); the center coordinates of the image are (X0, Y0), the length of the image is W, the width of the image is H, and the calculation formula of the radius R of the center area of the image is:
R=(Xti-X0)*(Xti-X0)+(Yti-Y0)*(Yti-Y0);
s32, if R > W0.175 and R < W0.375, then the target is in the image center region, otherwise the target is not in the image center region.
5. The method for controlling a personal trackball machine based on speed control according to claim 1, wherein in step S5, when the speed value calculation in the target horizontal and vertical directions is performed for the first time, the specific speed value calculation in the target horizontal and vertical directions is as follows:
s51, setting the left upper corner coordinates of a target frame of a target as (Xt 0, yt 0), the length of the target frame as Wt0 and the width of the target frame as Ht0; setting the center coordinates of the image as (X0, Y0), the length of the image as W and the width of the image as H;
s52, a calculation formula of the velocity value P (Vxto) in the target horizontal direction is as follows:
p (Vxto) = (Xt 0-X0) ×2xvp0/W; wherein, vp0 is an adjustable parameter, vpp 0 is more than 0 and less than or equal to 100;
s53, calculating a speed value T (Vyto) of the target in the vertical direction as follows:
t (Vyto) = (Yt 0-Y0) 2×vt0/H; wherein Vt0 is an adjustable parameter, and Vt0 is more than 0 and less than or equal to 100;
s54, setting a control expectation, and recording an expected value of the control expectation as xi; wherein, controlling the expected representation makes the goal locate at the centre of the picture, need to control the number of times that the ball machine rotates;
s56, calculating control results delta X and delta Y according to the expected value xi, wherein the calculation formula is as follows:
ΔX=(Xt0-X0)/ξ;
ΔY=(Xt0-X0)/ξ;
wherein, xi is an adjustable parameter, and xi is more than or equal to 1; the control result indicates the distance of the object near the center of the image.
6. The method for controlling a personal trackball based on speed control according to claim 5, wherein in step S5, when the target does not perform the calculation of the speed values in the horizontal and vertical directions for the first time, the specific calculation steps of the speed values in the horizontal and vertical directions of the target are as follows:
s57, calculating the difference value between the distance between the current frame target and the center of the previous frame target, and respectively recording the difference value as delta Xt and delta Yt; calculating new offset delta Xt 'and delta Yt' corresponding to delta Xt according to F (t, tanα);
recording the current TILT coordinate as t and the corresponding offset relation angle as alpha; then for deltaxt, new offsets deltaxt 'and deltayt' due to the rotation of the ball machine can be generated as follows:
ΔYt'=ΔXt/Tanα;ΔXt'=ΔXt;
if Deltat' > DeltaX, the horizontal direction of the ball machine is adjusted too fast, and the speed is required to be reduced; if Deltat' < DeltaX, the horizontal direction of the ball machine is adjusted too slowly, and the speed is required to be increased; wherein Δx is the control result in step S56;
if Deltat '> DeltaY represents that the vertical direction of the ball machine is adjusted too fast, the speed needs to be reduced, and if Deltat' < DeltaY represents that the vertical direction of the ball machine is adjusted too slow, the speed needs to be increased; wherein Δy is the control result in step S56;
s58, setting the current learning rate as le; wherein le >0;
assuming that the control speeds of the previous frame target are P (Vt-1) and T (Vt-1), the speeds PVt and TVt of the current frame are:
during the speed reduction: pvt=p (Vt-1) ×1-le |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1-le) |ΔYt'-Yt| ;
Pvt=p (Vt-1) ×1+le at the speed increase |ΔXt'-Xt| ;
TVt=T(Vt-1)*(1+le) |ΔYt'-Yt| ;
And S59, controlling the ball machine to rotate according to the calculated speed values PVt and TVt.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111000751 | 2021-08-30 | ||
CN202111000751X | 2021-08-30 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113838095A CN113838095A (en) | 2021-12-24 |
CN113838095B true CN113838095B (en) | 2023-12-29 |
Family
ID=78967058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111143825.5A Active CN113838095B (en) | 2021-08-30 | 2021-09-28 | Personnel tracking ball machine control method based on speed control |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113838095B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114565638B (en) * | 2022-01-25 | 2022-10-28 | 上海安维尔信息科技股份有限公司 | Multi-target tracking method and system based on tracking chain |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101873477A (en) * | 2010-02-26 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for realizing monitoring by fast ball tracking system |
KR101153919B1 (en) * | 2011-08-05 | 2012-06-08 | 웅진보안시스템(주) | Device and recording medium for tracking object |
CN103595920A (en) * | 2013-11-15 | 2014-02-19 | 浙江宇视科技有限公司 | Image collection equipment and auxiliary focusing method and device in zooming process |
CN103679687A (en) * | 2012-09-18 | 2014-03-26 | 杭州海康威视数字技术股份有限公司 | Target tracking method of intelligent tracking high-speed dome camera |
CN104184932A (en) * | 2013-05-20 | 2014-12-03 | 浙江大华技术股份有限公司 | Spherical camera control method and device thereof |
CN104754302A (en) * | 2015-03-20 | 2015-07-01 | 安徽大学 | Target detecting tracking method based on gun and bullet linkage system |
KR101547910B1 (en) * | 2015-07-03 | 2015-08-28 | 서광항업 주식회사 | An operating method of image processing system for synthesis photo image with position information |
CN107659790A (en) * | 2017-10-23 | 2018-02-02 | 上海集光安防科技股份有限公司 | A kind of method of ball machine automatically track target |
CN107948946A (en) * | 2017-11-09 | 2018-04-20 | 南京南自信息技术有限公司 | A kind of industrial site high accuracy personnel positioning ball-shaped camera tracking |
CN108495085A (en) * | 2018-03-14 | 2018-09-04 | 成都新舟锐视科技有限公司 | A kind of ball machine automatic tracking control method and system based on moving target detection |
CN111627050A (en) * | 2020-07-27 | 2020-09-04 | 杭州雄迈集成电路技术股份有限公司 | Training method and device for target tracking model |
CN111784734A (en) * | 2020-07-17 | 2020-10-16 | Oppo广东移动通信有限公司 | Image processing method and device, storage medium and electronic equipment |
CN112601012A (en) * | 2020-12-07 | 2021-04-02 | 深圳市维海德技术股份有限公司 | Zoom follow-up method, device and computer readable storage medium |
-
2021
- 2021-09-28 CN CN202111143825.5A patent/CN113838095B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101873477A (en) * | 2010-02-26 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for realizing monitoring by fast ball tracking system |
KR101153919B1 (en) * | 2011-08-05 | 2012-06-08 | 웅진보안시스템(주) | Device and recording medium for tracking object |
CN103679687A (en) * | 2012-09-18 | 2014-03-26 | 杭州海康威视数字技术股份有限公司 | Target tracking method of intelligent tracking high-speed dome camera |
CN104184932A (en) * | 2013-05-20 | 2014-12-03 | 浙江大华技术股份有限公司 | Spherical camera control method and device thereof |
CN103595920A (en) * | 2013-11-15 | 2014-02-19 | 浙江宇视科技有限公司 | Image collection equipment and auxiliary focusing method and device in zooming process |
CN104754302A (en) * | 2015-03-20 | 2015-07-01 | 安徽大学 | Target detecting tracking method based on gun and bullet linkage system |
KR101547910B1 (en) * | 2015-07-03 | 2015-08-28 | 서광항업 주식회사 | An operating method of image processing system for synthesis photo image with position information |
CN107659790A (en) * | 2017-10-23 | 2018-02-02 | 上海集光安防科技股份有限公司 | A kind of method of ball machine automatically track target |
CN107948946A (en) * | 2017-11-09 | 2018-04-20 | 南京南自信息技术有限公司 | A kind of industrial site high accuracy personnel positioning ball-shaped camera tracking |
CN108495085A (en) * | 2018-03-14 | 2018-09-04 | 成都新舟锐视科技有限公司 | A kind of ball machine automatic tracking control method and system based on moving target detection |
CN111784734A (en) * | 2020-07-17 | 2020-10-16 | Oppo广东移动通信有限公司 | Image processing method and device, storage medium and electronic equipment |
CN111627050A (en) * | 2020-07-27 | 2020-09-04 | 杭州雄迈集成电路技术股份有限公司 | Training method and device for target tracking model |
CN112601012A (en) * | 2020-12-07 | 2021-04-02 | 深圳市维海德技术股份有限公司 | Zoom follow-up method, device and computer readable storage medium |
Non-Patent Citations (3)
Title |
---|
PTZ摄像机跟踪运动目标的智能控制算法的研究;陈双叶;《计算机科学》;第42卷(第11期);135-139 * |
智能化自动跟踪摄像机全解析;亦飞;《中国安防》;47-49 * |
自动变倍镜头在机器视觉检测中的应用;戴福春;《现代计算机(专业版)》;58-61 * |
Also Published As
Publication number | Publication date |
---|---|
CN113838095A (en) | 2021-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3749475B1 (en) | Method for seam tracking in pipe welding | |
US7706575B2 (en) | System and method providing improved head motion estimations for animation | |
CN113038016B (en) | Unmanned aerial vehicle image acquisition method and unmanned aerial vehicle | |
CN104067111B (en) | For following the tracks of the automated systems and methods with the difference on monitoring objective object | |
US6807290B2 (en) | Rapid computer modeling of faces for animation | |
CN113838095B (en) | Personnel tracking ball machine control method based on speed control | |
CN107824940A (en) | Welding seam traking system and method based on laser structure light | |
EP2736247A1 (en) | A method for obtaining a virtual object within a virtual studio from a real object | |
CN109087261B (en) | Face correction method based on unlimited acquisition scene | |
CN104469170B (en) | Binocular camera shooting device, image processing method and device | |
CN109886995B (en) | Multi-target tracking method in complex environment | |
CN108127217A (en) | Spiral heat exchanger edge weld guides the welder and method of welding automatically | |
US11763506B2 (en) | Generating animations in an augmented reality environment | |
JP2010123019A (en) | Device and method for recognizing motion | |
CN107071347A (en) | The method of adjustment and headend equipment of a kind of wireless localization apparatus | |
CN110602376B (en) | Snapshot method and device and camera | |
JP4464902B2 (en) | Camera control apparatus and camera control program | |
CN111753650A (en) | Camera rotation control method for automatically tracking human face | |
TW201310993A (en) | Display device and rotation method thereof | |
JP5044582B2 (en) | Photography camera learning device and program thereof | |
KR20120115871A (en) | Method and system for 3d reconstruction from surveillance video | |
JP2003158664A (en) | Camera controller | |
CN111541846A (en) | Automatic ice kettle image following and shooting system | |
CN109584314B (en) | Method and device for measuring water surface flow field and electronic equipment | |
Brunelli et al. | A generative approach to audio-visual person tracking |
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 |