Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
The frame convergent-divergent that draws of the present invention comprises: draw the frame amplification and draw frame to dwindle.Wherein: drawing the frame amplification is that the image that will play appointed area in the pane is amplified to whole broadcast pane, and drawing frame to dwindle is that the current in progress image of broadcast pane is narrowed down to the appointed area, and other zones of playing pane will show the image that will not be shown before.
Main thought of the present invention is: when the user play the pane center select the zone that need amplify or dwindle (hereinafter to be referred as: in the time of zoom area), client sends to the front monitoring front-end encoder by server end and draws the instruction of frame convergent-divergent, the front monitoring front-end encoder is by the distance measurement function of video camera, calculating moves to the rotational angle of the central point of this zoom area from the central point of playing pane, send to The Cloud Terrace in view of the above and horizontally rotate and/or the vertical rotation instruction, and calculating convergent-divergent multiple, send to The Cloud Terrace in view of the above and amplify instruction or dwindle instruction, thus accurately realize monopod video camera draw the frame zoom function.
The present invention is described in detail below by two embodiment.
Embodiment one:
Fig. 1 realizes drawing the schematic flow sheet of frame convergent-divergent in supervisory control system for the embodiment of the invention one.The equipment that Fig. 1 relates to comprises: client, server end and front monitoring front-end.Wherein: front monitoring front-end comprises equipment such as front monitoring front-end encoder, The Cloud Terrace and video camera, and The Cloud Terrace and front monitoring front-end encoder can be arranged to all-in-one, also can be discrete.Flow process shown in Figure 1 comprises step 101~105:
Step 101: the user selects zoom area by client at broadcast pane center, as shown in Figure 2.
Can make an appointment: from upper left toward lower right box when selecting zoom area, expression need draw frame to amplify, and when selecting zoom area from the bottom right toward upper left box, expression need draw frame to dwindle, like this, client just can be determined to amplify or dwindle by the frame direction of drawing that detects the user.Perhaps, also can provide the option of " draw frame amplify " and " drawing frame to dwindle ", when detecting the user and select corresponding option, determine to amplify or dwindle in client.
Step 102: client is drawn the instruction of frame convergent-divergent according to the zoom area of user institute frame choosing to the server end transmission.
In this step, obtain center point coordinate and the length and the width of this zoom area by client, and judge according to the described detection method of step 101 and to amplify or dwindle, thereby determine the value of convergent-divergent indication, then, with convergent-divergent indication, the center point coordinate of zoom area, the length and the width of zoom area, be carried on together to draw in the instruction of frame convergent-divergent with the length of this broadcast pane and width and send to server end.Here, convergent-divergent indicates this and draws frame convergent-divergent instruction to be used for amplifying still to dwindle.
Step 103: server end will draw the instruction of frame convergent-divergent to be handed down to the front monitoring front-end encoder.
Step 104: after the front monitoring front-end encoder receives and draws frame convergent-divergent instruction,, and this instruction transformation become corresponding rotation command and become doubly instruction according to calculation of parameter rotational angle and the convergent-divergent multiple in this instruction.
Here, rotational angle comprises the rotational angle of horizontal direction and the rotational angle of vertical direction.
Step 105: the front monitoring front-end encoder sends rotation command and/or becomes doubly instruction to The Cloud Terrace.
Step 106: The Cloud Terrace according to rotate, amplify from the instruction of front monitoring front-end encoder/dwindle, thereby realize drawing the frame convergent-divergent.
Being implemented as follows of above-mentioned steps 104:
Among the present invention, relate to and play the pairing actual physics picture of pane and play shown these the two kinds of different pictures of picture of pane, below abbreviate the physics picture of playing pane and the display frame of playing pane respectively as, coherent element in two kinds of pictures is corresponding one by one, can change mutually by conversion, the present invention is follow-up will to be described in detail.If no special instructions, " broadcast pane " is interpreted as " playing the pairing display frame of pane ".
As previously mentioned, the frame convergent-divergent instruction of drawing of sending from client need be carried following parameter: the length and the width of the center point coordinate of zoom area, the length of zoom area and width, broadcast pane, above-mentioned parameter is the parameter in the display frame.Fig. 3 draws the physical significance key diagram of parameter entrained in the instruction of frame convergent-divergent for the embodiment of the invention one.Picture shown in Fig. 3 is for playing the display frame ABDC of pane, and three pairs of parameters that wherein comprise are:
MidPointX, midPointY: the center point coordinate of zoom area (is that initial point calculates to play the pane center);
LengthX, lengthY: the length of zoom area and width;
Width, height: length and the width of playing pane.
Among Fig. 3, the E point is the central point of zoom area, and the G point is the central point of the display frame of playing pane, and the intersection point that along continuous straight runs passes the straight line that E order and vertically passes the straight line that G orders is designated as F.
Fig. 4 is the method schematic diagram that calculates rotational angle in the embodiment of the invention one.Shown in Fig. 4 is the physics picture A ' B ' D ' C ' that plays pane, the central point of playing the physics picture of pane is E ', zoom area corresponding physical picture central point be G ', the intersection point that along continuous straight runs passes the straight line of E ' point and the straight line that vertically passes G ' point is designated as F '.Some A '~G ' in the physics picture shown in Figure 4 corresponds respectively to the some A~G in the display frame shown in Figure 3.
Coordinate among Fig. 4 is: the video camera position is defined as initial point, be designated O, the corresponding axle of center E ' point from video camera O point to the physics picture of playing pane is the Z axle, X-axis is parallel with the trunnion axis B ' D ' of the physics picture of playing pane, and Y-axis is parallel with the vertical axis A ' B ' of the physics picture of playing pane.
The physical meaning of other symbols explanation among Fig. 4:
Physical distance from video camera O point to the central point E ' that plays the current corresponding physical picture of pane is D, i.e. distance between the OE '.
Center E ' is L to the distance of center G ', i.e. distance between the G ' E '.
OE ' is vertical with plane A ' B ' C ' D ', and F ' E ' is parallel with B ' D ', and G ' F ' is parallel with C ' D '.
The angle of F ' OE ' is ax, is that video camera needs the angle of rotation in the horizontal direction; The angle of G ' OF ' is ay, is that video camera needs the angle of rotation in vertical direction.
The method of calculating ax and ay is shown in F1~F6:
F1: obtain the current multiplication factor of video camera, be designated as Zoom1.
F2: according to the resolution of video camera and play the length of pane and the pixel of pixel that width is determined video camera and broadcast pane between conversion relation α.Suppose: the resolution of video camera is 800 * 600, and length and the width of playing pane are 400 * 300, and so, a pixel in the broadcast pane is with regard to 2 pixels of corresponding video camera, and at this moment, the value of α is 2.
F3: obtain the pixel distance of video camera and the corresponding relation β between the actual physics distance.This corresponding relation is that video camera does not carry out under the situation of any amplification, and a fixing physical attribute of video camera is known.For example: for the video camera of a certain particular type, it may be 1 centimetre that the distance between adjacent two pixels of level corresponds to actual physical length, and at this moment, the value of β is 1 centimetre.Distance between two vertically adjacent pixels corresponds to actual physical length may be different with the situation of level, can obtain with reference to said method.
F4: calculate angle ax.
Because OE ' is perpendicular to plane A ' B ' C ' D ', therefore, angle OE ' F ' is the right angle, and triangle OE ' F ' is a right-angled triangle, and relational expression Sin (ax)/Cos (ax)=F ' E '/OE ' sets up.
Calculating about OE ' and F ' E ':
Video camera supports distance measurement function, video camera center O to put to play can being known by range finding by video camera apart from OE ' of central point of pane corresponding physical picture, and offers the front monitoring front-end encoder.The length of FE can obtain according to the coordinate Calculation that G point and E are ordered, and at this moment, what calculate is the range of a signal of FE in display frame.This range of a signal need be converted to actual physical apart from F ' E ' according to formula " physical distance=range of a signal * Zoom1 * α * β ", and the unit of measurement of ability and OE ' is complementary.
After determining OE ' and F ' E ', just can calculate ax according to Sin (ax)/Cos (ax)=F ' E '/OE '.
F5: calculate angle ay.
Because G ' F ' is vertical with F ' E ', and OE ' is vertical with G ' F ', so G ' F ' is vertical with plane OF ' E ', thereby it is vertical with F ' O to draw G ' F ', so the angle of G ' F ' O is 90 degree, triangle G ' F ' O is a right-angled triangle, and relational expression Sin (ay)/Cos (ay)=G ' F '/OF ' sets up.
In addition, OE ' is vertical with plane A ' B ' C ' D ', and triangle OE ' F ' is a right-angled triangle, and known OE ' and F ' E ' can calculate OF ' according to Pythagorean theorem.The range of a signal of GF in screen can obtain according to the coordinate Calculation that G point and E are ordered, and is converted into the actual physics length G ' F ' of GF.
After determining G ' F ' and OF ', just can calculate ay according to Sin (ay)/Cos (ay)=G ' F '/OF '.
F6: the front monitoring front-end encoder sends rotation command to The Cloud Terrace, and the request The Cloud Terrace is move angle ax, move angle ay in vertical direction in the horizontal direction.
F7: The Cloud Terrace receives rotation command, drives internal mechanical device (such as motor) move angle ax, move angle ay in vertical direction in the horizontal direction.
Illustrate: move angle is being for just, then forward rotation; Move angle is negative, then backward rotation.
Calculate the method for amplification or minification:
Owing to when frame selects zoom area, be difficult to guarantee that the Aspect Ratio of zoom area equates with the Aspect Ratio of playing pane, therefore, when calculating the convergent-divergent multiple, need determine with length still to be that width is as the criterion.Can make an appointment and calculate the foundation of convergent-divergent multiple, for example: can make an appointment: be as the criterion or be as the criterion with length, also can arrange:, perhaps be as the criterion with the shorter one with being as the criterion in the length of zoom area and the width than the elder with width.In the present embodiment, suppose with being as the criterion in the length of zoom area and the width than the elder.
Suppose lengthX>=lengthy, then be as the criterion with lengthX, particularly:
When convergent-divergent indicates need amplify the time multiplication factor=width/lengthX
When convergent-divergent indicates need dwindle the time minification=lengthX/width
After determining the convergent-divergent multiple, need amplify if convergent-divergent indicates, then the front monitoring front-end encoder sends to The Cloud Terrace and amplifies instruction, and selected area extension is arrived whole broadcast pane; Need dwindle if convergent-divergent indicates, then the front monitoring front-end encoder sends to The Cloud Terrace and dwindles instruction, narrows down to selected zone with playing the current in progress image of pane, and other zones of playing pane will show the image that is not shown before.
Embodiment two:
As an expanded application of drawing the frame convergent-divergent, the user moves to mouse some positions of playing pane, and click, adopt technical scheme provided by the invention can control The Cloud Terrace the position at mouse place is moved to the pane center of playing, thereby realize the mobile of playout center point, the image of being play is not amplified or dwindles.
Among this embodiment, the instruction transmission flow process between client, server end, front monitoring front-end encoder and the The Cloud Terrace is identical with the Fig. 1 among the embodiment one, and difference is:
In step 101, the user needs to click on the position at the center of moving in playing pane;
In step 102, client sends to drawing in the instruction of frame convergent-divergent of server end, only carries parameter: the coordinate of the position that the user clicked (center point coordinate that is equivalent to zoom area) and length and the width of playing pane;
In step 104, the front monitoring front-end encoder only according to the calculation of parameter rotational angle in this instruction, need not to calculate the convergent-divergent multiple after receiving and drawing the instruction of frame convergent-divergent;
In step 105: the front monitoring front-end encoder need not to send to The Cloud Terrace and becomes doubly instruction;
In step 106: The Cloud Terrace need not image is amplified or dwindles processing.
Present embodiment calculates being implemented as follows of rotational angle in step 104:
The parametric representation of sending from client of carrying the instruction of frame convergent-divergent of drawing is:
PointX, PointY: the coordinate of the position that the user clicked (hereinafter referred to as the G point) (is that initial point calculates with the pane center);
Width, height: length and the width of playing pane.
Fig. 5 is the method schematic diagram that calculates rotational angle in the embodiment of the invention two.The coordinate system of Fig. 5 and the physical meaning of each symbol are identical with Fig. 4, do not repeat them here.According to the method identical with embodiment one, utilize the distance measurement function of video camera, can calculate and move to G ' point from the current central point of the physics picture of playing pane and need the angle ax and the ay that rotate, the front monitoring front-end encoder sends corresponding rotation command according to the rotational angle that calculates to The Cloud Terrace can realize moving of screen center.
Based on the main thought of the present invention and the foregoing description, the present invention proposes a kind of method that the frame convergent-divergent is drawn in realization in supervisory control system, its flow chart is as shown in Figure 6.This method can be applied to the front monitoring front-end encoder, and this method may further comprise the steps:
Step 601: receive and draw the instruction of frame convergent-divergent, the parameter of carrying in this instruction comprises: the width of the center point coordinate of zoom area, the length of playing pane and broadcast pane.
When only adopting technical solution of the present invention to realize playout center point mobile, draw the frame convergent-divergent to carry above-mentioned parameter in instructing and get final product.When adopting technical solution of the present invention to realize drawing the frame convergent-divergent, also need to carry parameter in this instruction: convergent-divergent indication, the length of zoom area, the width of zoom area; Wherein, convergent-divergent indicates and describedly draws frame convergent-divergent instruction to be used for amplifying still to dwindle.
Step 602: obtain the distance of video camera to the described video camera that draws the corresponding The Cloud Terrace of frame convergent-divergent instruction to control, move to the rotational angle of the central point of zoom area according to above-mentioned parameter and video camera to the distance calculation of the central point of playing pane corresponding physical picture from the central point of broadcast pane to the central point of playing pane corresponding physical picture.
In this step, if draw and also carry parameter in the instruction of frame convergent-divergent: convergent-divergent indication, the length of zoom area, the width of zoom area, so, need further to calculate the convergent-divergent multiple according to the length of zoom area, the width of zoom area, the length of broadcast pane and the width of broadcast pane.
Particularly: the mode of calculating the convergent-divergent multiple comprises:
Make an appointment and calculate the foundation of convergent-divergent multiple;
Determine to be as the criterion according to the foundation of this calculating convergent-divergent multiple and calculate the convergent-divergent multiple and still be as the criterion and calculate the convergent-divergent multiple with width with length;
If be as the criterion with length, so, when convergent-divergent indicates this and draws frame convergent-divergent instruction to be used to amplify, the length of the length/zoom area of multiplication factor=broadcast pane; When convergent-divergent indicates this and draws frame convergent-divergent instruction to be used to dwindle, the length of the length of minification=zoom area/broadcast pane;
If be as the criterion with width, so, when convergent-divergent indicates this and draws frame convergent-divergent instruction to be used to amplify, the width of the width/zoom area of multiplication factor=broadcast pane; When convergent-divergent indicates this and draws frame convergent-divergent instruction to be used to dwindle, the width of the width of minification=zoom area/broadcast pane.
Step 603: send rotation command to The Cloud Terrace according to the rotational angle that calculates.
In this step, if the rotational angle of horizontal direction is not 0, then sends to The Cloud Terrace and horizontally rotate instruction, order parameter is the rotational angle of the horizontal direction that calculates; If the rotational angle of vertical direction is not 0, then send vertical rotation instruction to The Cloud Terrace, order parameter is the rotational angle of the vertical direction that calculates.
If the convergent-divergent multiple that calculates in the step 602 is not 0, so, in this step, need further carry out following processing: draw the instruction of frame convergent-divergent to be used for amplifying if convergent-divergent indicates this, then send to The Cloud Terrace and amplify instruction, order parameter is the convergent-divergent multiple that calculates; Draw the instruction of frame convergent-divergent to be used to dwindle if convergent-divergent indicates this, then send to The Cloud Terrace and dwindle instruction, order parameter is the convergent-divergent multiple that calculates.
Corresponding to said method, the present invention also provides a kind of device of realizing drawing the frame convergent-divergent, as shown in Figure 7.This device comprises: command reception module 710, processing module 720 and instruction sending module 730; Wherein:
Command reception module 710 is used for receiving and draws the instruction of frame convergent-divergent, and the received frame convergent-divergent instruction of drawing is sent to processing module 720; The parameter of carrying in this instruction comprises: the width of the center point coordinate of zoom area, the length of playing pane and broadcast pane;
Processing module 720, be used for obtaining the distance of video camera to the central point of playing pane corresponding physical picture to the described video camera that draws the corresponding The Cloud Terrace of frame convergent-divergent instruction to control, and according to the rotational angle that draws the parameter of carrying in the frame convergent-divergent instruction and described distance calculation to move to the central point of zoom area from the central point of playing pane, and, rotation command is sent to instruction sending module 730 according to the rotational angle generation rotation command that calculates;
Instruction sending module 730 is used for and will sends to The Cloud Terrace from the rotation command of handling module 710.
Preferably, described command reception module 710 is further used for reception and carries parameter: the frame convergent-divergent that draws of the length of convergent-divergent indication, zoom area, the width of zoom area instructs; Wherein, convergent-divergent indicates and describedly draws frame convergent-divergent instruction to be used for amplifying still to dwindle;
Described processing module 720, be further used for length according to described zoom area, the width of zoom area, play the length of pane and the width of broadcast pane and calculate the convergent-divergent multiple, at the convergent-divergent multiple is not 0 o'clock, described processing module also is used for indicating at convergent-divergent described when drawing frame convergent-divergent instruction to be used to amplify, generating order parameter is the amplification instruction of described convergent-divergent multiple, the amplification instruction that is generated is sent to instruction sending module 730, and be used for indicating described when drawing frame convergent-divergent instruction to be used to dwindle at convergent-divergent, generating order parameter is the instruction of dwindling of described convergent-divergent multiple, and the instruction of dwindling that is generated is sent to instruction sending module 730;
Described instruction sending module 730 is further used for sending to The Cloud Terrace with instructing from the amplification of handling module or dwindling instruction.
Preferably, the position at video camera place is designated as O, the central point of playing pane corresponding physical picture is designated as E ', video camera is designated as OE ' to the distance of the central point of playing pane corresponding physical picture, the central point of zoom area is designated as G ' in the physics picture, the intersection point that along continuous straight runs is passed E ' straight line of putting and the straight line that vertically passes G ' point is designated as F ', some E ' in the physics picture, F ', G ' corresponds to and is E in the display frame of playing pane, F, G, FE represents the range of a signal between F point and the E point, GF represents the range of a signal between G point and the F point, the physical distance between OF ' expression O point and the F ' point; The rotational angle that described processing module calculates comprises: the rotational angle of horizontal direction and the rotational angle of vertical direction are designated as ax and ay respectively;
Described processing module 720 also is used to carry out following operation:
Obtain the current multiplication factor of video camera, be designated as Zoom1;
According to the resolution of video camera and play the length of pane and the pixel of pixel that width is determined video camera and broadcast pane between conversion relation α;
Obtain the pixel distance of video camera and the corresponding relation β between the actual physics distance;
The coordinate Calculation FE and the GF of ordering according to G point and E, and according to formula: physical distance=range of a signal * Zoom1 * α * β, FE and GF are converted to corresponding physical distance, be designated as F ' E ' and G ' F ' respectively;
According to OF '
2=(F ' E ')
2+ OE
2Calculate OF ';
Calculate ax according to Sin (ax)/Cos (ax)=F ' E '/OE ', calculate ay according to Sin (ay)/Cos (ay)=G ' F '/OF '.
Rotational angle in the horizontal direction is not 0 o'clock, described processing module 720 also be used to generate order parameter be described horizontal direction rotational angle horizontally rotate instruction, and the instruction that horizontally rotates that is generated is sent to instruction sending module 730; Rotational angle in vertical direction is not 0 o'clock, and described processing module 720 also is used to generate the vertical rotation instruction that order parameter is the rotational angle of described vertical direction, and the vertical rotation instruction that is generated is sent to instruction sending module 730;
Described instruction sending module 730, also be used for be received from processing module horizontally rotate instruction or vertical rotation instruction sends to The Cloud Terrace.
Preferably, when calculating the convergent-divergent multiple, described processing module 720 also is used to carry out following operation:
Determine to be as the criterion according to the foundation of the calculating convergent-divergent multiple of making an appointment and calculate the convergent-divergent multiple and still be as the criterion and calculate the convergent-divergent multiple with width with length;
Under situation about being as the criterion with length, when convergent-divergent indicates describedly when drawing frame convergent-divergent instruction to be used to amplify, processing module 720 is according to the length of the length/zoom area of multiplication factor=broadcasts pane, calculating multiplication factor; When convergent-divergent indicates describedly when drawing frame convergent-divergent instruction to be used to dwindle, processing module 720 is according to the length of the length of minification=zoom area/broadcasts pane, calculating minification;
Under situation about being as the criterion with width, when convergent-divergent indicates describedly when drawing frame convergent-divergent instruction to be used to amplify, processing module 720 is according to the width of the width/zoom area of multiplication factor=broadcasts pane, calculating multiplication factor; When convergent-divergent indicates describedly when drawing frame convergent-divergent instruction to be used to dwindle, processing module 720 is according to the width of the width of minification=zoom area/broadcasts pane, calculating minification.
As seen from the above-described embodiment, realization provided by the invention draws the technical scheme of frame convergent-divergent to make full use of the distance measurement function of video camera, by calculating rotational angle and the convergent-divergent multiple that moves to the central point of zoom area from the central point of current broadcast pane, and send corresponding rotation command and become doubly instruction to The Cloud Terrace in view of the above, thereby accurately realized drawing the frame zoom function by some The Cloud Terrace commonly used basis control commands.Because The Cloud Terrace basis control command meets unified standard, be not subjected to the different restrictions that realize of each producer, therefore, technical solution of the present invention possesses versatility.
And the present invention need not zoning in screen in advance, but the zoom area that user's actual frames is selected is carried out convergent-divergent, has strengthened the flexibility and the accuracy of drawing the frame convergent-divergent.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within the scope of protection of the invention.