Summary of the invention
The purpose of this invention is to provide a kind of tower machine video monitoring system that has from the motion 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 operating efficiency is lower; Also attend to one thing and lose sight of another easily, cause the problem of misoperation.
Another object of the present invention provides a kind of tower machine video frequency monitoring method that has from the motion tracking anamorphosis function.
The technical scheme that the present invention adopted is; A kind of tower machine video monitoring system that has from the motion tracking anamorphosis function comprises control, demonstration and the recording section of camera part, middle signal hop and the rear end of front end, and 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 display of control, demonstration and recording section; The signal hop 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 decoder, 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 that the present invention adopted is that a kind of tower machine video frequency monitoring method that has from the motion tracking anamorphosis function is installed on camera part on the amplitude variation trolley of tower machine earlier; The camera lens of camera vertically downward; The object of regular shape is set on suspension hook, connects camera part and control, demonstration and recording section through the signal hop again, it is indoor that control, demonstration and recording section are installed in the tower machine operation; Camera is connected with control, demonstration and recording section through decoder; The adjustment camera makes object clearly to be presented in the image, and selected tracking target; In tower machine running; Change automatically adjustment 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 in the display image of control, demonstration and recording section all the time, the practical implementation step is following:
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 representes tone, and S representes saturation, and V representes brightness; R, G, B represent red, green, blue respectively, through 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 is quantized to [0,255], obtains 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 through the Meanshift algorithm, concrete steps are following:
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 obtains the area s and the barycenter c of tracking target object image in the current search window, will 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 elevating movement synchronously;
Automatically become in times tracing process at camera, each Meanshift algorithmic statement finishes, and the camera multiplying power will be adjusted 1 times on demand, and The Cloud Terrace angle of pitch adjustment 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 characteristic to the consecutive image sequence, and all frames of continuous videos image are done the MeanShift computing, and utilizes every frame result's search window size to change 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 following:
7.1) size and the position of initialization search window;
7.2) the interior color probability distribution of calculating search 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) multiplying power and the The Cloud Terrace motion of control camera, 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 the adjustment of camera multiplying power and The Cloud Terrace; With obtaining the new searching image of a frame; 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) step carries 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 moving object; Carrying out shape judges; Judge that the moving object shape weighs moving object again and whether disappear,, then continue to follow the tracks of if moving target is consistent with blip thing shape; If it is inconsistent; Then make search window get back to the most initial position of whole track algorithm, promptly the Camshift track algorithm is restarted in the camera below; 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, gets into the multiplying power adjustment and the tracking of a new round.
The invention has the beneficial effects as follows that tower machine video monitoring has from the motion tracking anamorphosis function, this video monitoring system lens ratio can be regulated according to surrounding environment automatically; Make tower machine operation personnel to see hanging object and peripheral situation thereof in real time clearly through display device in the control room; Thereby carry out correct operation, alleviate tower machine operation personnel's labour intensity, simultaneously; Effectively avoid because the major accident that commander's error causes provides safer construction environment.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is elaborated.
Like Fig. 1, shown in Figure 2; The structure of supervisory control system of the present invention is, comprises camera part 1, middle signal hop 2 and control, demonstration and recording section 3, and 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, and object 4 (adopting spherical mark among the present invention) is set on suspension hook, and object 4 remains in the monitoring range of camera 5; It is indoor that control, demonstration and recording section 3 are installed in the tower machine operation; Be connected through the transmission medium in the signal hop 2 between camera part 1 and control, demonstration and the recording section 3, tower machine operation personnel just can observe suspended object and surrounding condition thereof through the display screen in control, demonstration and the recording section 3 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 decoder 6; The function of decoder 6 is that the content that camera 5 is monitored is converted into picture signal, and is sent to signal on the display of control, demonstration and recording section 3.
Signal hop 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 adopted video lines, power line, 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, accomplish the real-time Presentation Function of vision signal.Consider that space, tower machine operation chamber is narrow and small, be inappropriate for and place big more article that control, demonstration and recording section 3 have adopted the panel computer with touch function.
Tower machine video monitoring system of the present invention, utilize image processing techniques accomplish zoom camera 5 from motion tracking with become doubly, its operation principle is: the target that the object that is provided with on the suspension hook 4 is followed the tracks of as supervisory control system; When the tower machine hoists or descending motion, the area of object 4 can change in the image information of camera 5, according to these characteristics; System passes through image processing algorithm; Calculate the variation of object 4 areas in real time, become foundation doubly automatically, realize from motion tracking as control camera 5; 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 operation principle of the Camshift algorithm after the improvement is: the iconic model of at first confirming tracking target object 4; Specify first frame search the window's position and the size then, with the barycenter and the area of object 4 in the Meanshift algorithm keeps track search window, if algorithmic statement then utilize result of calculation adjustment 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 through 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 practical 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 running, change automatically adjustment 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, concrete performing step is following:
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 television set and computer more.Through 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 dimensions corresponding to other color of white from initial point summit farthest corresponding to black, and is as shown in Figure 3; Diagonal 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 saturation) of the direct corresponding human eye color vision characteristic in HSV space, three components are independent mutually.As shown in Figure 4, the HSV coordinate system adopts is that circular cylindrical coordinate and all definitions of color are in hexagonal pyramid.Tone (Hue) is decided by dominant wavelength in the reflection object light, and different wavelengths produces the various colors sensation.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 saturation (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 distincter, otherwise, will become light more.Its span is from 0 to 1, when S=1, obtains the purest color (being not white); 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 correlation 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 intensity of illumination 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 amount of calculation 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 basically 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 representes tone, and S representes saturation, and V representes brightness; R, G, B represent red, green, blue respectively.Through 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 characteristic 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, T (M [i, j]) is 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.Each pixel of current search window statistic with respective pixel in the color histogram of tracking target image is replaced; 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 following:
(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 the motion tracking zooming system, gets 5-8 pixel at the tower machine.
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 obtains the area s and the barycenter c of tracking target object image in the current search window, will 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 elevating movement synchronously;
Automatically become in times tracing process at camera; The elevating movement of adjustment of camera multiplying power and The Cloud Terrace is that unit carries out (precision and following rate that this step-length value depends on tracking) with step-length mouth c, and each Meanshift algorithmic statement finishes, the adjustment camera multiplying power c and the The Cloud Terrace angle of pitch; The camera multiplying power will be adjusted 1 times on demand; The Cloud Terrace angle of pitch adjustment 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 characteristic to the consecutive image sequence; All frames to the continuous videos image are done the MeanShift computing, and utilize every frame result's search window size to change 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 following:
(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 the adjustment of camera multiplying power and The Cloud Terrace, with obtaining the new searching image of a frame, and big or small s and the new search window of position c initialization of the rope window that obtains with (7.3) step, jump to (7.2) again and go on foot and carry 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; Explain that the Camshift following calculation goes wrong; Then extract the profile of current moving object, carry out shape and judge, judge that the moving object shape weighs moving object 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 let search window get back to the most initial position of whole track algorithm, promptly the Camshift track algorithm is restarted in camera 5 belows; 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, gets into the multiplying power adjustment and the tracking of a new round.