Summary of the invention
The purpose of this invention is to provide a kind of tower machine video monitoring system with automatic tracking anamorphosis function, solved and existed in the prior art, tower machine operation personnel need manually to control at any time the adjustment of camera multiplying power during work, and the operability of system is bad, and work efficiency is lower; Also attend to one thing and lose sight of another easily, cause the problem of maloperation.
Another object of the present invention provides a kind of tower machine video frequency monitoring method with automatic tracking anamorphosis function.
The technical solution adopted in the present invention is, a kind of tower machine video monitoring system with automatic tracking anamorphosis function, the control, demonstration and the recording section that comprise camera part, middle signal transporting part and the rear end of front end, camera part is installed on the amplitude variation trolley of tower machine, the camera lens of camera vertically downward, object is set on suspension hook, is used for the content that camera is monitored is converted into picture signal, and signal is sent on the telltale of control, demonstration and recording section; The signal transporting part is used for camera part is connected with control, demonstration and recording section; It is indoor that control, demonstration and recording section are installed in the tower machine operation, and camera is connected with control, demonstration and recording section by demoder, and the change that is used to control The Cloud Terrace and camera doubly and is handled in real time and shown vision signal.
Another technical scheme of the present invention is, a kind of tower machine video frequency monitoring method with automatic tracking anamorphosis function, earlier camera part is installed on the amplitude variation trolley of tower machine, the camera lens of camera vertically downward, the object of regular shape is set on suspension hook, connect camera part and control by the signal transporting part again, show and recording section, control, it is indoor that demonstration and recording section are installed in the tower machine operation, camera is by demoder and control, show and the recording section connection, adjust camera, make object clearly to be presented in the image, and selected tracking target, in tower machine operational process, change automatic compensation camera multiplying power and The Cloud Terrace angle according to object area and barycenter and realize that camera becomes doubly and tracking automatically, guarantee that object clearly is presented at control all the time, in the display image of demonstration and recording section, concrete implementation step is as follows:
Image M in the window of step 1, initialization tracking target thing will comprise whole object in the image M;
Step 2, extract tracking target image M, and with target image M according to following formula with the color space of pixel from the RGB color space conversion to the hsv color space, obtain tracking target image M '
HSV:
V=max(R,G,B) (1)
When H<0, H=H+360 then
Wherein, H represents tone, and S represents degree of saturation specific humidity, and V represents brightness; R, G, B represent red, green, blue respectively, by formula (1), (2), (3), each pixel among the target image M are transformed into the HSV space from RGB, obtain the HSV model M of tracking target image M '
HSV
The HSV model M of step 3, tracking target image M that step 2 is obtained '
HSVIn value on the H passage of each pixel sample, thereby obtain the color histogram of tracking target image M, with the color histogram model of this color histogram as tracking target image M;
Step 4, initialization current search position of window and size, the current search window will comprise the object of whole tracking target;
The color probability distribution graph of step 5, generation current search window, each pixel of current search window statistic with respective pixel in the color histogram of tracking target image M is replaced, the re-quantization as a result that will obtain then, the scope that is about to the H component quantizes to [0,255], obtain the color probability distribution graph of current search window;
Step 6, utilize the Meanshift iterative algorithm, obtain in the current search window area and the barycenter of institute's tracking target color:
The current search video in window is converted into the color probability distribution graph, finds out the barycenter and the area of this color probability distribution graph by the Meanshift algorithm, concrete steps are as follows:
6.1) calculate the zeroth order square M of current search video in window
00:
Wherein, (x y) is image mid point (x, the pixel value of y) locating, (x, y) value in the current image window scope to I;
6.2) calculating current search video in window x axle and the axial first moment of y:
Then the coordinate of barycenter c is:
6.3) reset the big or small s of search window:
6.4) repeating step 6.1) to step 6.3), obtain next step new search window barycenter c ' (x '
c, y '
c) with the big or small s ' of new search window, in the iterative process, when centroid position changes less than given threshold epsilon, promptly ‖ c '-c ‖≤ε reaches convergence, stops iteration;
In the process of iterative computation, the size of search window constantly changes, to the last the iterative center of mass change in location just reaches convergence less than given threshold value, promptly obtain the area s and the barycenter c of tracking target object image in the current search window, to become doubly and the mobile reference of tracking as camera with this, if iteration result's search window s area increases, then control the camera multiplying power and increase; If search window s area reduces, then reduce the camera multiplying power; Simultaneously, according to the relative change direction of centroid position, adjust the The Cloud Terrace luffing synchronously;
Automatically become in times tracing process at camera, each Meanshift algorithm convergence finishes, and the camera multiplying power will be adjusted 1 times on demand, and the The Cloud Terrace pitch angle is adjusted 1 degree, changes next step then over to, carries out consecutive image and follows the tracks of;
Step 7:Camshift algorithm is to use color histogram as feature to the consecutive image sequence, all frames to the continuous videos image are done the MeanShift computing, and the search box size of utilizing every frame result changes the change of control camera doubly, obtain the next frame new images then, again carry out the MeanShift iteration, so iteration is gone down, up to the size variation of search window less than threshold values ε, thereby realize becoming doubly automatically
Adopt improved Camshift algorithm that tower machine mark is followed the tracks of, improved CamShift algorithm steps is as follows:
7.1) size and the position of initialization search window;
7.2) calculate and search for the interior color probability distribution of window;
7.3) operation Meanshift iterative algorithm, if iteration does not restrain, change step 8 over to; If iteration convergence then obtains the big or small s and the position c of search window, continue next step;
7.4) control multiplying power of camera and The Cloud Terrace motion, if search window area s increases then corresponding increase camera multiplying power, opposite search window area s reduces, then reduce the camera multiplying power, in tracing process, the camera multiplying power is that unit adjusts with each 1 times;
7.5) after camera multiplying power and The Cloud Terrace adjust, the new searching image of a frame will be obtained, and with step 7.3) the big or small s and the new search window of position c initialization of the rope window that obtains, jump to step 7.2 again) go on foot and carry out the Camshift tracing process again, in whole tracing process, thereby iteration realizes in the suspension hook motion process, the tracking of mark;
Step 8, when the iterations of search window or relative distance changes or window size changes and surpasses certain threshold value, then extract the profile of current mobile, carrying out shape judges, judge that the mobile shape weighs mobile again and whether disappear, if moving target is consistent with blip thing shape, then continue to follow the tracks of; If it is inconsistent, then make search window get back to the most initial position of whole track algorithm, it is the camera below, restart the Camshift track algorithm, the object of waiting for set shape occurs, the convergence of Meanshift iterative algorithm then restarts to control the motion of camera multiplying power and The Cloud Terrace, enters the multiplying power adjustment and the tracking of a new round.
The invention has the beneficial effects as follows, tower machine video monitoring has the automatic tracking anamorphosis function, this video monitoring system lens ratio can be according to the surrounding environment automatically regulating, make tower machine operation personnel can see the situation of hanging object and periphery thereof in real time clearly by display equipment at control cabin, thereby carry out correct operation, alleviate tower machine operation personnel's labour intensity, simultaneously, effectively avoid because the grave accident that commander's error causes provides safer building operation environment.
The specific embodiment
The present invention is described in detail below in conjunction with the drawings and specific embodiments.
As Fig. 1, shown in Figure 2, the structure of monitored control system of the present invention is, comprise camera part 1, middle signal transporting part 2 and control, show and recording section 3, camera part 1 is installed on the amplitude variation trolley of tower machine, camera 5 wherein is with the luffing moving of car, and camera lens vertically downward, object 4 (adopting the ball-shaped mark among the present invention) is set on suspension hook, object 4 remains in the monitoring range of camera 5, control, it is indoor that demonstration and recording section 3 are installed in the tower machine operation, camera part 1 and control, connect by the transmission medium in the signal transporting part 2 between demonstration and the recording section 3, tower machine operation personnel are by control, read-out in demonstration and the recording section 3 just can be observed suspended object and surrounding condition thereof always.
Camera part 1 comprises camera 5, these camera 5 additional corresponding protective cover, support and The Cloud Terraces of being provided with, camera 5 is connected with demoder 6, the function of demoder 6 is that the content that camera 5 is monitored is converted into picture signal, and signal is sent on the telltale of control, demonstration and recording section 3.
Signal transporting part 2 is passages of system diagram image signal, control signal, power supply signal, is bearing the transmission work of image data stream, control signal, power supply signal, transmission medium 9 corresponding employing video lines, power lead, control line.
Control, demonstration and recording section 3 are cores of whole monitoring system, mainly comprise two parts function, the one, and the change of control The Cloud Terrace and camera 5 is doubly; The 2nd, finish the real-time Presentation Function of vision signal.Consider that space, tower machine operation chamber is narrow and small, be unsuitable for placing big more article, control, demonstration and recording section 3 have adopted the panel computer with touch function.
Tower machine video monitoring system of the present invention, utilize automatic tracking that image processing techniques finishes zoom camera 5 and become doubly, its principle of work is: the target that the object 4 that is provided with on the suspension hook is followed the tracks of as monitored control system, when the tower machine hoists or descending motion, the area of object 4 can change in the graphicinformation of camera 5, according to these characteristics, system passes through image processing algorithm, calculate the variation of object 4 areas in real time, automatically become foundation doubly as control camera 5, realize automatic tracking, thereby guarantee tower machine operation personnel at work, visual effect is best.Quick and effective for what guarantee to follow the tracks of, in control of the present invention, demonstration and the recording section 3, adopted improved Camshift algorithm, color is combined as tracking target with area; Simultaneously, under special circumstances with the mark shape as tracking target, thereby improve to follow the tracks of efficient;
The inventive method is improved existing C amshift algorithm, the principle of work of the Camshift algorithm after the improvement is: the iconic model of at first determining tracking target object 4, specify first frame search the window's position and the size then, barycenter and area with object 4 in the Meanshift algorithm keeps track search window, if algorithm convergence then utilize result of calculation to adjust the camera multiplying power, and control The Cloud Terrace, simultaneously, utilize new search window position and size in the result of calculation initialization next frame image, and start new round Camshift algorithm; If algorithm is not restrained, then judge by shape facility whether this object is the tracking target shape, if then continue to follow the tracks of, get back to camera 5 belows and wait for that object 4 occurs once more if not then abandoning following the tracks of.
The concrete implementation step of the inventive method is:
At first adjust camera 5, make object 4 clearly to be presented in the image, and selected tracking target, in tower machine operational process, change automatic compensation camera multiplying power and The Cloud Terrace angle according to object 4 areas and barycenter and realize that camera becomes doubly and tracking automatically, guarantee that object 4 clearly is presented in the image all the time, the specific implementation step is as follows:
Image M in the window of step 1, initialization tracking target thing 4 will comprise whole object 4;
Step 2, extract tracking target image M, and with target image M from the RGB color space conversion to the hsv color space, obtain tracking target image M '
HSV
(1) RGB model
The RGB color space is by red (R), and green (G), blue (B) three kinds of colors are formed, and it is the most frequently used a kind of color model of hardware device, is used for the colour display system of vision receiver and computing machine more.By red, green, blue three kinds of mix of basic colors obtain most color.What the RGB color space adopted is Cartesian coordinates, and three axles are respectively R, G, B.Initial point then drops in the color cube of being made up of red-green-blue in the three dimensional space, as shown in Figure 3 corresponding to other color of white from initial point summit farthest corresponding to black, diagonal line arrives (1 from (0,0,0), 1,1) representative is to change to the lime degree from black.
(2) HSV model
HSV model (Hue saturation value) model is a kind of color matching model corresponding to the artist, can better reflect perception and the discriminating of people to color, the three elements (form and aspect, lightness and degree of saturation specific humidity) of the direct corresponding human eye color vision feature in HSV space, three components are independent mutually.As shown in Figure 4, the HSV system of axes adopts is that circular cylindrical coordinate and all definitions of color are in hexagonal pyramid.Tone (Hue) is decided by dominant wavelength in the object reflected light rays, and different wavelength produces different color perceptions.It is not influenced by bright light, the light and shade of color, and its span is 0 to 360; The in bright gay color light degree of degree of saturation specific humidity (Saturation) expression, the ratio of white of promptly mixing in the color of same form and aspect if wherein not having white mixes, is called pure color, and the low more then color of white ratio is distinct more, otherwise, will become light more.Its span is from 0 to 1, obtains the purest color (being not white) when S=1; The GTG degree of brightness (Value) expression color shade is as the power of tone color.Its value also is from 0 to 1, obtains black when getting 0 value.
Though the RGB color space is that the correlativity of three components of RGB is very big in the RGB color space towards the most frequently used a kind of color space of hardware device, that is to say at R, G, when certain component of B changed, other components also can and then change.The variation of Illumination intensity also has bigger influence to the value of RGB component in addition, and this has just brought very big inconvenience to practical application.Comparatively speaking, hsv color space shown in Figure 4 more meets human vision property than RGB color space, and three components of HSV are independently, can consider separately that calculated amount is littler than three components of RGB color space.Therefore with current video image from the RGB color space conversion to the hsv color space.
Transfer algorithm from the GRB color space to the hsv color space has a lot, although they are different on arithmetic speed, complexity, but the H component that obtains at last is similar substantially with the S component image, and the present invention adopts following formula that the color space of pixel is transformed into the HSV space from RGB:
V=max(R,G,B) (1)
When H<0, H=H+360 then
Wherein, H represents tone, and S represents degree of saturation specific humidity, and V represents brightness; R, G, B represent red, green, blue respectively.By formula (1), (2), (3), each pixel among the target image M is transformed into the HSV space from RGB, obtain the HSV model M of tracking target image M '
HSV
The HSV model M of step 3, tracking target image M that step 2 is obtained '
HSVIn value on the H passage of each pixel sample, thereby obtain the color histogram of tracking target image M, this color histogram is preserved the color histogram model that is used as tracking target image M down.
Color histogram has characterized the distribution frequency of color of image, describes the integral color feature of image with color histogram.Suppose that for tracking target image M size is I
1* I
2, each component value is C
k(C
k=1,2 ..., n), define the statistical value h[C of one group of pixel
1], h[C
2] ..., h[C
n] be the color frequency of this image:
H[C wherein
k] be color value C
kAppearance frequency in image, and T (M[i, j]) be pixel (i, j) color value in color space.With the color progression in the image is abscissa, and the color frequency of occurrences is the color histogram that the figure of ordinate just is called image.
Need consider the problem of the span of H component at this, the span of H component is [0,360], the value of this span can not be represented with a byte, in order to represent that the present invention does suitable quantification treatment with the H value with a byte, the scope of H component is quantized to [0,255].
Step 4, initialization current search position of window and size, current search window will comprise the object 4 of whole tracking target.
Step 5: the color probability distribution graph that generates the current search window.Use the statistic of respective pixel in the color histogram of tracking target image to replace each pixel of current search window, the re-quantization as a result that will obtain then, the scope that is about to the H component is quantized to [0,255], just obtains the color probability distribution graph of current search window.In order to reduce the expense of time, among the present invention as probability 0 zone with extra-regional other zones of image processing.
Step 6: utilize the Meanshift iterative algorithm, obtain in the current search window area of tracking target color and barycenter.
After the current search video in window is converted into the color probability distribution graph, the Meanshift algorithm will be found out the barycenter and the area of this color probability distribution graph, and calculation procedure is as follows:
(6.1) the zeroth order square M of calculating current search video in window
00:
Wherein, (x y) is image mid point (x, the pixel value of y) locating, (x, y) value in the current image window scope to I;
(6.2) calculate current search video in window x axle and the axial first moment of y:
Then the coordinate of barycenter c is:
(6.3) reset the big or small s of search window:
(6.4) repeat (6.1) step to (6.3) step, obtain next step new search window barycenter c ' (x '
c, y '
c) with the big or small s ' of new search window, in the iterative process, when centroid position changes less than given threshold epsilon, be ‖ c '-c ‖≤ε, reach convergence, stop iteration, wherein the value of ε depends on the needed precision of engineering, threshold epsilon depends on follows the tracks of desired precision, in tower machine automatic tracking zooming system, gets 5-8 pixel.
In the process of iterative computation, the size of search window constantly changes, to the last the iterative center of mass change in location just reaches convergence less than given threshold value, promptly obtain the area s and the barycenter c of tracking target object image in the current search window, to become doubly and the mobile reference of tracking as camera with this, if iteration result's search window s area increases, then control the camera multiplying power and increase; If search window s area reduces, then reduce the camera multiplying power; Simultaneously, according to the relative change direction of centroid position, adjust the The Cloud Terrace luffing synchronously;
Automatically become in times tracing process at camera, the luffing of adjustment of camera multiplying power and The Cloud Terrace is that unit carries out (precision and rate of following that this step-length value depends on tracking) with step-length mouth c, each Meanshift algorithm convergence finishes, adjust camera multiplying power c and The Cloud Terrace pitch angle, the camera multiplying power will be adjusted 1 times on demand, the The Cloud Terrace pitch angle is adjusted 1 degree, changes next step then over to, carries out consecutive image and follows the tracks of;
Step 7:Camshift algorithm is to use color histogram as feature to the consecutive image sequence, all frames to the continuous videos image are done the MeanShift computing, and the search box size of utilizing every frame result changes the change of control camera doubly, obtain the next frame new images then, again carry out the MeanShift iteration, so iteration is gone down, up to the size variation of search window less than threshold values ε, thereby realize becoming doubly automatically.
Among the present invention, adopt improved Camshift algorithm that tower machine mark is followed the tracks of; Because tower machine building site circumstance complication inevitably has the building site article color situation identical with the characteristics of image color and occurs, therefore, the improvement track algorithm that the present invention adopts shape and Camshift algorithm to combine, improved CamShift algorithm steps is as follows:
(7.1) size of initialization search window and position;
(7.2) calculate the interior color probability distribution of search window;
(7.3) operation Meanshift iterative algorithm if iteration does not restrain, changes step 8 over to; If iteration convergence then obtains the big or small s and the position c of search window, continue next step;
(7.4) multiplying power of control camera 5 and The Cloud Terrace motion, if search window area s increases, the then corresponding camera multiplying power that reduces, opposite search window area s reduces, and then increases the camera multiplying power.In tracing process, the adjustment of camera multiplying power is that unit carries out with 1 times;
(7.5) after camera multiplying power and The Cloud Terrace are adjusted, will obtain the new searching image of a frame, and the big or small s and the new search window of position c initialization of the rope window that obtains with (7.3) step, jumping to for (7.2) step again carries out the Camshift tracing process again.In whole tracing process, thereby iteration realizes in the suspension hook motion process tracking of mark.
Step 8: when the iterations of search window or relative distance changes or window size changes and surpasses certain threshold value, illustrate that Camshift follows the tracks of calculating and goes wrong, then extract the profile of current mobile, carrying out shape judges, judge that the mobile shape weighs mobile again and whether disappear, if moving target consistent with the blip thing (being circular in this algorithm) then continues to follow the tracks of; If it is inconsistent, then allow search window get back to the most initial position of whole track algorithm, be camera 5 belows, restart the Camshift track algorithm, wait for that the circular target mark occurs, the Meanshift iterative algorithm can be restrained, and restarts to control camera multiplying power and The Cloud Terrace motion, enters the multiplying power adjustment and the tracking of a new round.