CN104202529B - A kind of camera status control method and its device - Google Patents

A kind of camera status control method and its device Download PDF

Info

Publication number
CN104202529B
CN104202529B CN201410479776.6A CN201410479776A CN104202529B CN 104202529 B CN104202529 B CN 104202529B CN 201410479776 A CN201410479776 A CN 201410479776A CN 104202529 B CN104202529 B CN 104202529B
Authority
CN
China
Prior art keywords
image
state
camera
smooth grey
smooth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410479776.6A
Other languages
Chinese (zh)
Other versions
CN104202529A (en
Inventor
陈先开
吴金勇
王军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhongzhi Weian Robot Technology Co.,Ltd.
Original Assignee
Shenzhen Zhongzhi Kechuang Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhongzhi Kechuang Robot Co Ltd filed Critical Shenzhen Zhongzhi Kechuang Robot Co Ltd
Priority to CN201410479776.6A priority Critical patent/CN104202529B/en
Publication of CN104202529A publication Critical patent/CN104202529A/en
Application granted granted Critical
Publication of CN104202529B publication Critical patent/CN104202529B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention belongs to intelligent video teaching fields, provide a kind of method and its device of camera status control.It the described method comprises the following steps:Obtain the coloured image of preset format in the picture of camera shooting;Gray scale pretreatment is carried out to the coloured image;Judge whether the state of the camera meets state handover triggering condition according to preset algorithm and the coloured image for carrying out gray scale pretreatment;If it is satisfied, then sending status switching instruction corresponding with the state, state switching is carried out to control the camera.Method and apparatus provided in an embodiment of the present invention can efficiently carry out logic control and the state switching control of complex scene switching.

Description

A kind of camera status control method and its device
Technical field
The present invention relates to intelligent tutoring video recorded broadcast field more particularly to a kind of camera status control method and its devices.
Background technology
It imparts knowledge to students in recorded broadcast, there are the shooting fields that multiple, different classrooms may need for the scene of teachers' instruction track up Scape is also different, there may be handoff relation between scene, the switching of scene there is also certain directionality, such as scenario A can not Switch to scenario B, on the contrary then can be switched, if scene is expressed as node, the handoff relation between scene is with directive line segment It expresses, then the switching between scene is represented by a digraph, switching between practical Scene needs a period of time, So need algorithm judge camera stop and allow camera it is smooth be moved to specified scene.The mode that digraph is realized is more, As directly can simply realized it by the way of hard coded.
But such realization method is excessively complicated, mentality of designing is not clear enough;A kind of better way is using design State design mode in pattern can realize it, such realization method favorable expandability, it is easy to accomplish.But it directly adopts It is that cannot be fully solved the problem of proposed with state design mode, during scene switching, it is also necessary to whether judge camera Stable state is stopped to, the triggering algorithm of the switching between scene also may be different, therefore only direct adoption status Design pattern be cannot solve the problems, such as it is described.
Invention content
The purpose of the present invention is to provide a kind of camera status control methods, it is intended to which solving existing camera tracer technique cannot The problem of carrying out logic control and the triggering switching of complex scene switching.
In order to solve the above-mentioned technical problem, the invention is realized in this way:A kind of method of camera status control, the side Method includes the following steps:
Obtain the coloured image of preset format in the picture of camera shooting;
Gray scale pretreatment is carried out to the coloured image;
Judge whether the state of the camera meets state according to the coloured image of preset algorithm and the carry out gray scale pretreatment Handover triggering condition;
If it is satisfied, then sending status switching instruction corresponding with the state, state switching is carried out to control the camera.
Preferably, this includes to the step of coloured image progress gray scale pretreatment:
The coloured image is converted into single channel gray level image;
By normalization algorithm by the single channel greyscale image transitions be normal grayscale image;
Mean filter smoothing processing is carried out to the normal grayscale image, to obtain smooth grey image.
Preferably, the coloured image according to preset algorithm and the carry out gray scale pretreatment judge the camera state whether The step of meeting state handover triggering condition include:
The state set of the camera is initialized, which includes the operating status and panoramic scene state of the camera;
Obtain the smooth grey image;
Control the camera enter with the smooth grey image corresponding states, and according to default scene switching trigger algorithm judge Whether the smooth grey image corresponding states is motion state;
If it is, executing the corresponding with the motion state first default triggering judges algorithm;
If it is not, then executing the corresponding with the smooth grey image corresponding states second default triggering judges algorithm.
Preferably, it is also wrapped after the step of execution the first default triggering corresponding with the motion state judges algorithm It includes:
Judge whether the camera is static;
If it is, when the motion state variable of the camera is set as static the corresponding state variable of scene and return with Obtain the smooth grey image;
The smooth grey image is obtained if it is not, then directly returning.
Preferably, the step of algorithm is judged in the execution the second default triggering corresponding with the smooth grey image corresponding states Further include after rapid:
Judge whether the smooth grey image corresponding states meets state handover triggering condition;
If it is, setting the smooth grey image corresponding states variable to interim scene corresponding states variable and returning Obtain the smooth grey image.
The smooth grey image is obtained if it is not, then returning.
Preferably, the default scene switching triggering algorithm of the basis judges whether the smooth grey image corresponding states is movement The step of state includes:
The sport foreground binary map B of current smooth grey-level image frame is calculated according to following formulat
The foreground area accounting Ar of area-of-interest is calculated according to following formula;
Meet the lasting frame number count of foreground area accounting Ar according to following formula statistics;
Judge that this continues whether frame number is more than default triggering frame number threshold value;
Wherein, Gt-2,Gt-1,GtIndicate that the smooth grey image of t-2 frames, t-1 frames, t frames, t are positive integer respectively, X, y indicate that the position of image pixel column and row, T indicate the threshold value of binaryzation respectively, and Tr ∈ [0.1,1], x, y, w, h are indicated respectively The abscissa of the top left corner apex of region in the picture, ordinate, the width in region and the height in region, i, j indicate region respectively The high start of wide starting point and region.
The present invention also aims to provide a kind of device of camera status control, which includes:
Acquiring unit, the coloured image for obtaining preset format in the picture that camera is shot;
Pretreatment unit, for carrying out gray scale pretreatment to the coloured image;
Judging unit, the state for judging the camera according to the coloured image of preset algorithm and the carry out gray scale pretreatment Whether state handover triggering condition is met;
Transmission unit, for when the state of the camera meets state handover triggering condition, sending corresponding with the state Status switching instruction carries out state switching to control the camera.
Preferably, which includes:
First conversion subunit, for the coloured image to be converted to single channel gray level image;
Second conversion subunit is standard grayscale figure for passing through normalization algorithm by the single channel greyscale image transitions Picture;
Smoothing processing subelement, for carrying out mean filter smoothing processing to the normal grayscale image, to obtain smooth ash Spend image.
Preferably, which includes:
Subelement is initialized, the state set for initializing the camera, which includes the operation shape of the camera State and panoramic scene state;
Subelement is obtained, for obtaining the smooth grey image;
Subelement is controlled, is entered and the smooth grey image corresponding states for controlling the camera;
First judgment sub-unit judges the smooth grey image corresponding states for triggering algorithm according to default scene switching Whether it is motion state;
First executes subelement, for when the smooth grey image corresponding states is motion state, executing and the movement The corresponding first default triggering of state judges algorithm;
Second executes subelement, flat with this for when the smooth grey image corresponding states is not motion state, executing Sliding gray level image corresponding states corresponding second presets triggering and judges algorithm.
Preferably, which further includes:
Second judgment sub-unit, for judging whether the camera is static;
First setting subelement, is used for when the camera is static, when the motion state variable of the camera is set as static The corresponding state variable of scene and return obtain the smooth grey image;
Second setting subelement, for when the camera is not static, returning and obtaining the smooth grey image.
Preferably, which further includes:
Third judgment sub-unit, for judging whether the smooth grey image corresponding states meets state handover trigger item Part;
Subelement is arranged in third, for when the smooth grey image corresponding states meets state handover triggering condition, It sets the smooth grey image corresponding states variable to interim scene corresponding states variable and returns described smooth to obtain Gray level image.
The smooth grey image is obtained if it is not, then directly returning.
Preferably, which is specifically used for:
The sport foreground binary map B of current smooth grey-level image frame is calculated according to following formulat
The foreground area accounting Ar of area-of-interest is calculated according to following formula;
Meet the lasting frame number count of foreground area accounting Ar according to following formula statistics;
Judge that this continues whether frame number is more than default triggering frame number threshold value;
Wherein, Gt-2,Gt-1,GtIndicate that the smooth grey image of t-2 frames, t-1 frames, t frames, t are positive integer respectively, X, y indicate that the position of image pixel column and row, T indicate the threshold value of binaryzation respectively, and Tr ∈ [0.1,1], x, y, w, h are indicated respectively The abscissa of the top left corner apex of region in the picture, ordinate, the width in region and the height in region, i, j indicate region respectively The high start of wide starting point and region.
In the embodiment of the present invention, the coloured image of preset format and to the colour in the picture by obtaining camera shooting Image carries out gray scale pretreatment and obtains the current state of camera, according to preset algorithm and the cromogram for carrying out gray scale pretreatment As judging whether the state of the camera meets state handover triggering condition, the state of camera is cut according to judging result It changes.Method and apparatus provided in an embodiment of the present invention can efficiently carry out logic control and the state switching of complex scene switching Control.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is the flow chart of camera status control method provided in an embodiment of the present invention;
Fig. 2 is the implementation flow chart of the camera status control method of first embodiment of the invention;
Fig. 3 is the implementation flow chart of the camera status control method of second embodiment of the invention;
Fig. 4 is the implementation flow chart of the camera status control method of third embodiment of the invention;
Fig. 5 is the frame construction drawing of camera status control device provided in an embodiment of the present invention;
Fig. 6 is the frame construction drawing of pretreatment unit provided in an embodiment of the present invention;
Fig. 7 is the frame construction drawing of judging unit provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 shows the flow of camera status control method provided in an embodiment of the present invention, specifically includes following steps:
Step S101 obtains the coloured image of preset format in the picture of camera shooting.
In embodiments of the present invention, which carrys out phase for teacher's tracking in teaching writing/playing system, cromogram image source The picture of machine shooting, obtains the coloured image I of the i-th frame YUVY formats (preset format) from the picture that camera is shoti, wherein scheming Image width height is respectively R ', C '.
Step S102 carries out gray scale pretreatment to the coloured image.
As shown in Fig. 2, step S102's specifically includes following steps:
Step S201, by coloured image IiBe converted to single channel gray level image G 'i
Step S202, by normalization algorithm by single channel gray level image G 'iBe converted to (wide R and high C) standard grayscale Image G "i.In this embodiment, it is preferred that R=352 and C=288.
Step S203, to normal grayscale image G "i(a × a) mean filter smoothing processing is carried out, to obtain smooth grey Image Gi.In the present embodiment, preferably a=3 (a is positive integer).
Step S103 judges whether the state of the camera is full according to preset algorithm and the coloured image for carrying out gray scale pretreatment Sufficient state handover triggering condition.
If so, thening follow the steps S104;If it is not, then cycle executes step S103.
In embodiments of the present invention, in recorded broadcast of imparting knowledge to students, the state of camera have it is multiple, such as camera movement shape State, the pan-shot state of camera, the feature shooting state of camera, and feature shooting can have multiple scenes, pass through progress The coloured image of gray scale pretreatment judges the state of camera, and judges whether the state meets state switching by preset algorithm Trigger condition, when teacher walks about under some scene, if not triggering the condition of scene switching, camera will be located always In the scene, without being switched in other scenes, if meet state handover triggering condition, such as teacher walks from scene Go out, then can be switched to suitable scene to record the teaching process of teacher, the movement of camera is will produce during scene switching, is sentenced Whether disconnected camera stops contributing to the analysis of image.
As shown in figure 3, as a preferred embodiment of the present invention, step S103 specifically includes following steps:
Step S301 initializes the state set of camera, which includes the operating status and panoramic scene of camera State.
In embodiments of the present invention, the state set of camera is denoted as S, S={ s0,s1,…,sK, which includes Camera motion state (is denoted as s0, camera motion state can have it is multiple, in this example, it is assumed that only there are one camera motion State), camera panoramic scene state (is denoted as s1, panorama state can have it is multiple, in this example, it is assumed that only there are one complete The scene of scape shooting), camera feature scene state (is denoted as s2,…,sK).Scene state s1,…,sKCamera has been corresponded to respectively Posture p1,…,pK, wherein pi={ pani,tilti,zoomi, i=1,2 ..., K, wherein pani,tilti,zoomiIt indicates respectively Scene state siThe feathering angle of lower camera, camera and horizontal line inclination angle, the scaling multiplying power of camera.Because of the height of camera installation Degree is fixed, therefore three parameters are that can determine the posture of camera.Due to needing to judge camera when starting teachers ' teaching recorded broadcast algorithm Whether stop settling out, it is therefore assumed that the state of the initialization of camera is motion state, has remembered that the state s of camera is movement State s0.The temporary variable st=s of scene state1, i.e., after camera motion stopping to stable state, panorama triggering field will be switched to Scape s1
Step S302, (from step S102) obtain smooth grey image Gi
Step S303, control camera enter and smooth grey image GiCorresponding state S, and according to default scene switching Triggering algorithm judges whether smooth grey image corresponding states S is motion state S0
If so, thening follow the steps S304;If not, thening follow the steps S305.
Step S304, (when smooth grey image corresponding states S is motion state S0When, it is unsatisfactory for state handover trigger Condition) it executes and motion state S0Corresponding first default triggering judges algorithm, and executes step S306;
Step S305, (when smooth grey image corresponding states S is not motion state S0When, meet state handover trigger Condition) it executes and smooth grey image GiThe corresponding second default triggerings of corresponding states S judge algorithm, and execute step S308。
Step S306 judges whether camera is static.
If so, thening follow the steps S307;If not, thening follow the steps S302.
Step S307, the corresponding state variable of scene (state S settings when the motion state variable of camera is set as static For state st), and return to step S302.
In embodiments of the present invention, step S307 indicates that camera is stable, successful switch to state st
Step S308, judges whether smooth grey image corresponding states S meets state handover triggering condition;
If so, S309 is thened follow the steps, if not, thening follow the steps S302.
Step S309 sets the smooth grey image corresponding states S variables to interim scene corresponding states variable (state S is set as S0), and return to step S302.
In the present embodiment, the triggering preset algorithm of camera motion state uses two kinds of strategies, the first is the set time Determination strategy, be fixed since algorithm obtains image, such as with 25fps, then algorithm can be executed every 40 milliseconds it is primary, As long as algorithm executed in 40 milliseconds completion so ensure that real-time, if therefore assume image obtain frame per second be m fps, Setting meets trigger condition after maxT second, then meets trigger condition after algorithm performs maxT × m times, i.e. execution step S307.
Second is the determination strategy for inquiring camera posture, due to the value of Pan, Tilt and the Zoom of known switching, therefore CP, cT and cZ value that can be current by constantly inquiring camera, then compares the value of Pan, Tilt and Zoom, that is, is required to meet item Part:
|Pan-cP|<Tp and | Tilt-cT |<Tt and | Zoom-cZ |<Tz
Wherein, cP indicates the current level angle of camera, and unit is identical as Pan, and cT indicates the current vertical pivoting angle of camera, Unit is identical as Tilt, and cZ indicates the current focal length of camera, and unit is identical as Zoom, and Tp ∈ [0,360), Tt ∈ [0,90], Tz ∈[0,10].Preferred Tp=0.1 in this example, Tt=0.1, Tz=0.01.If formula condition in satisfaction, thens follow the steps S307。
The triggering algorithm of panoramic scene state.In the present embodiment, a kind of simply and effectively triggering algorithm of design, it is interested The region of image is (x, y, w, h), and x, y, w, h indicate the abscissa of the top left corner apex of region in the picture respectively, ordinate, The width in region and the height in region, area-of-interest may be other irregular regions, and the area-of-interest in this example is Rectangle.The difference of area-of-interest, it is meant that if detecting the condition for meeting triggering, phase in the area-of-interest Machine will switch to the scene of other features from panoramic scene.
As shown in figure 4, as a preferred embodiment of the present invention, step S303 includes the following steps:
Step S401 calculates the sport foreground binary map of current smooth grey-level image frame.It is calculated according to following formula current The sport foreground binary map B of smooth grey image framet
In the present embodiment, the sport foreground of current smooth grey-level image frame is obtained, it is assumed that execute to t frames, obtain ash Spend image Gt-2,Gt-1,Gt, wherein x, y indicate that the pixel column of smooth grey image, capable position, T indicate the threshold value of binaryzation.
Step S402 calculates the foreground area accounting of area-of-interest.Before area-of-interest being calculated according to following formula Scape area accounting Ar:
In the present embodiment, it by formula it is found that Ar illustrates the accounting (scope of activities) in specified area-of-interest, takes It is worth range between 0 to 1, value is bigger to illustrate that scope of activities is bigger, on the contrary then smaller.
In addition, in the present embodiment, the region of image of interest is (x, y, w, h), and x, y, w, h indicate that region is being schemed respectively As in top left corner apex abscissa, ordinate, region width and region height, i, j indicate respectively region wide starting point and The high start in region, area-of-interest may be other irregular regions, and the area-of-interest in this example is rectangle.Sense The difference in interest region, it is meant that if detecting the condition for meeting triggering in the area-of-interest, camera will be from Panoramic scene switches to the scene of other features.
Step S403, statistics meet the lasting frame number of foreground area accounting Ar.Meet foreground facets according to following formula statistics The lasting frame number count of product accounting Ar:
In the present embodiment, Tr is the threshold value of mobility, and value range is between 0.1 to 1, we are preferred in this example 0.4, the scope of activities for accurately judging the target in given region can be reached, panorama triggering is the most reasonable.max(v1, V2) function representation obtains the maximum value in in-real v1, v2.
Step S404 judges that this continues whether frame number count is more than default triggering frame number threshold value Tc.
In the present embodiment, be preferably Tc=10 in this example if count is more than the threshold value Tc of a certain positive integer, then it is full Sufficient state handover triggering condition.
It should be noted that in embodiments of the present invention, the target in feature scene is larger, moving target can be carried out with Track, and the track moved according to target, whether analysis meets the condition of triggering under the feature scene, in the feelings that video camera is static Under condition, more ripe triggering algorithm, such as w4 track algorithms (W4 can be used:Real-Time Surveillance of People and Their Activities, Ismail Haritaoglu, David Harwood, Larry S.Davis) etc..
Step S104 sends status switching instruction corresponding with the state, and state switching is carried out to control camera.
In embodiments of the present invention, step S309 is completed to need to send new phase it means that scene will switch Machine control instruction, the movement speed { vpan of video cameraj,vtiltjAnd new posture pj={ panj,titlj,zoomjSo that Camera motion is to new scene.Assuming that the camera posture of a upper scene is po={ pano,tilto,zoomo, what current queries arrived Camera posture is pc={ panc,tiltc,zoomc, then the speed calculation formula of Current camera movement is as follows:
Wherein α, β indicate to rotate horizontally the decay factor of the decay factor and vertical rotary speed of speed, sgn (x) respectively For sign function, even x >=0, sgn (x)=1, otherwise sgn (x)=- 1.It is preferably α=2, β=1 in this example.
After camera motion speed is calculated according to above formula, the instruction for being sent to camera is { vpanj,vtiltj, panj,tiltj,zoomj, after camera receives parameter, smooth movement will be carried out according to given speed, solve picture not Smooth problem.
In embodiments of the present invention, by the coloured image of preset format in the picture of acquisition camera shooting and to the coloured silk Color image carries out gray scale pretreatment and obtains the current state of camera, according to preset algorithm and the colour for carrying out gray scale pretreatment Image judges whether the state of the camera meets state handover triggering condition, is cut to the state of camera according to judging result It changes.Method and apparatus provided in an embodiment of the present invention can efficiently carry out logic control and the state switching of complex scene switching Control.
The purpose of the embodiment of the present invention also resides in the device 1 for providing a kind of control of camera status, including acquiring unit 10, pre- Processing unit 20, judging unit 30 and transmission unit 40.
In embodiments of the present invention, acquiring unit 10 is used to obtain the cromogram of preset format in the picture that camera is shot Picture;Pretreatment unit 20 is used to carry out gray scale pretreatment to the coloured image;Judging unit 30 is used for according to preset algorithm and is somebody's turn to do The coloured image for carrying out gray scale pretreatment judges whether the state of camera meets state handover triggering condition;Transmission unit 40 is used for When the state of camera meets state handover triggering condition, status switching instruction corresponding with the state is sent, to control camera Carry out state switching.
As a preferred embodiment of the present invention, pretreatment unit 20 includes that the first conversion subunit 201, second conversion is single Member 202, smoothing processing subelement 203.
In embodiments of the present invention, the first conversion subunit 201 is used to the coloured image being converted to single channel gray-scale map Picture;Second conversion subunit 202 is used to through normalization algorithm be normal grayscale image by the single channel greyscale image transitions;It is flat Sliding processing subelement 203 is used to carry out mean filter smoothing processing to the normal grayscale image, to obtain smooth grey image.
As a preferred embodiment of the present invention, judging unit 30 includes initialization subelement 301, obtains subelement 302, control Subunit 303, the first judgment sub-unit 304, first execute subelement 305, second and execute judgement of subelement 306, second Unit 307, first is arranged subelement 308, second and subelement 309, third judgment sub-unit 310 and third setting son list is arranged Member 311.
In embodiments of the present invention, initialization subelement 301 is used to initialize the state set of camera, the state set packet Include the operating status and panoramic scene state of camera;Subelement 302 is obtained for obtaining the smooth grey image;Control subelement 303 enter and the smooth grey image corresponding states for controlling camera;First judgment sub-unit 304 is used for according to default scene Handover trigger algorithm judges whether the smooth grey image corresponding states is motion state;First, which executes subelement 305, is used for When the smooth grey image corresponding states is motion state, executes the corresponding with the motion state first default triggering and judge to calculate Method;Second, which executes subelement 306, is used for when the smooth grey image corresponding states is not motion state, executes and the smooth ash The corresponding second default triggering of degree image corresponding states judges algorithm;Second judgment sub-unit 307 is for judging whether camera is quiet Only;First setting subelement 308 is used for when camera is static, and scene corresponds to when the motion state variable of camera is set as static State variable and return obtain the smooth grey image;Second setting subelement 309 is used for when camera is not static, is returned Obtain the smooth grey image;Third judgment sub-unit 310 is for judging whether the smooth grey image corresponding states meets shape State handover triggering condition;Third setting subelement 311 is used to meet state handover trigger item in smooth grey image corresponding states When part, sets the smooth grey image corresponding states variable to interim scene corresponding states variable and return smooth to obtain this Gray level image.
As a preferred embodiment of the present invention, first judgment sub-unit 304 is specifically used for:
The sport foreground binary map B of current smooth grey-level image frame is calculated according to following formulat
The foreground area accounting Ar of area-of-interest is calculated according to following formula;
Meet the lasting frame number count of foreground area accounting Ar according to following formula statistics;
Judge that this continues whether frame number is more than default triggering frame number threshold value;
Wherein, Gt-2,Gt-1,GtIndicate that the smooth grey image of t-2 frames, t-1 frames, t frames, t are positive integer respectively, X, y indicate that the position of image pixel column and row, T indicate the threshold value of binaryzation respectively, and Tr ∈ [0.1,1], x, y, w, h are indicated respectively The abscissa of the top left corner apex of region in the picture, ordinate, the width in region and the height in region, i, j indicate region respectively The high start of wide starting point and region.
The embodiment phase for the method that camera status control device provided in an embodiment of the present invention is controlled with above-mentioned camera status Corresponding, operation principle and mode are corresponding applicable, just repeat no more here.
In embodiments of the present invention, by the coloured image of preset format in the picture of acquisition camera shooting and to the coloured silk Color image carries out gray scale pretreatment and obtains the current state of camera, according to preset algorithm and the colour for carrying out gray scale pretreatment Image judges whether the state of the camera meets state handover triggering condition, is cut to the state of camera according to judging result It changes.Method and apparatus provided in an embodiment of the present invention can efficiently carry out logic control and the state switching of complex scene switching Control.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in computer read/write memory medium In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (4)

1. a kind of method of camera status control, which is characterized in that the described method comprises the following steps:
Obtain the coloured image of preset format in the picture of camera shooting;
Gray scale pretreatment is carried out to the coloured image;Including:The coloured image is converted into single channel gray level image;Pass through The single channel greyscale image transitions are normal grayscale image by normalization algorithm;Mean value filter is carried out to the normal grayscale image Wave smoothing processing, to obtain smooth grey image;
Judge whether the state of the camera meets state according to preset algorithm and the coloured image for carrying out gray scale pretreatment Handover triggering condition;Including:The state set of the camera is initialized, the state set includes the operating status of the camera With panoramic scene state;Obtain the smooth grey image;It controls the camera and enters shape corresponding with the smooth grey image State, and algorithm is triggered according to default scene switching and judges whether the smooth grey image corresponding states is motion state;If It is then to execute the corresponding with the motion state first default triggering to judge algorithm;Judge whether the camera is static;If It is the corresponding state variable of scene and to be returned described flat to obtain when the motion state variable of the camera being then set as static Sliding gray level image;The smooth grey image is obtained if it is not, then directly returning;If it is not, then executing and the smooth grey The corresponding second default triggering of image corresponding states judges algorithm;Judge whether the smooth grey image corresponding states meets shape State handover triggering condition;If it is, setting the smooth grey image corresponding states variable to interim scene corresponding states Variable simultaneously returns to the acquisition smooth grey image;The smooth grey image is obtained if it is not, then returning;
If it is satisfied, then sending status switching instruction corresponding with the state, state switching is carried out to control the camera.
2. the method as described in claim 1, which is characterized in that the basis presets scene switching triggering algorithm and judges described put down Slide that the step of whether gray level image corresponding states is motion state includes:
The sport foreground binary map B of current smooth grey-level image frame is calculated according to following formulat
The foreground area accounting Ar of area-of-interest is calculated according to following formula;
Meet the lasting frame number count of foreground area accounting Ar according to following formula statistics;
Judge the frame number that continues whether more than default triggering frame number threshold value;If it is greater, then meeting state handover triggering condition;
Wherein, Gt-2, Gt-1, GtIndicate that the smooth grey image of t-2 frames, t-1 frames, t frames, t are positive integer respectively, x, y divide Not Biao Shi image pixel column and row position, T indicate binaryzation threshold value, Tr ∈ [0.1,1], x, y, w, h indicate that region exists respectively The abscissa of top left corner apex in image, ordinate, the width in region and the height in region, i, j indicate the wide starting point in region respectively With the high start in region.
3. a kind of device of camera status control, which is characterized in that described device includes:
Acquiring unit, the coloured image for obtaining preset format in the picture that camera is shot;
Pretreatment unit, for carrying out gray scale pretreatment to the coloured image;The pretreatment unit includes:First conversion Unit, for the coloured image to be converted to single channel gray level image;Second conversion subunit, for passing through normalization algorithm It is normal grayscale image by the single channel greyscale image transitions;Smoothing processing subelement, for the normal grayscale image Mean filter smoothing processing is carried out, to obtain smooth grey image;
Judging unit, the state for judging the camera according to preset algorithm and the coloured image for carrying out gray scale pretreatment Whether state handover triggering condition is met;Including:Subelement is initialized, the state set for initializing the camera is described State set includes the operating status and panoramic scene state of the camera;Subelement is obtained, for obtaining the smooth grey Image;Subelement is controlled, is entered and the smooth grey image corresponding states for controlling the camera;First judges that son is single Member judges whether the smooth grey image corresponding states is motion state for triggering algorithm according to default scene switching;The One executes subelement, for when the smooth grey image corresponding states is motion state, executing and the motion state pair The the first default triggering answered judges algorithm;Second judgment sub-unit, for judging whether the camera is static;First setting is single Member, for when the camera is static, the corresponding state of scene to become when the motion state variable of the camera is set as static It measures and returns and obtain the smooth grey image;Second setting subelement, for when the camera is not static, returning and obtaining The smooth grey image;Second executes subelement, for when the smooth grey image corresponding states is not motion state, It executes the corresponding with the smooth grey image corresponding states second default triggering and judges algorithm;Third judgment sub-unit, is used for Judge whether the smooth grey image corresponding states meets state handover triggering condition;Subelement is arranged in third, in institute When stating smooth grey image corresponding states and meeting state handover triggering condition, the smooth grey image corresponding states variable is set It is set to interim scene corresponding states variable and returns to obtain the smooth grey image;
Transmission unit, for when the state of the camera meets state handover triggering condition, sending corresponding with the state Status switching instruction carries out state switching to control the camera.
4. device as claimed in claim 3, which is characterized in that first judgment sub-unit is specifically used for:
The sport foreground binary map B of current smooth grey-level image frame is calculated according to following formulat
The foreground area accounting Ar of area-of-interest is calculated according to following formula;
Meet the lasting frame number count of foreground area accounting Ar according to following formula statistics;
Judge the frame number that continues whether more than default triggering frame number threshold value;If it is greater, then meeting state handover triggering condition;
Wherein, Gt-2, Gt-1, GtIndicate that the smooth grey image of t-2 frames, t-1 frames, t frames, t are positive integer respectively, x, y divide Not Biao Shi image pixel column and row position, T indicate binaryzation threshold value, Tr ∈ [0.1,1], x, y, w, h indicate that region exists respectively The abscissa of top left corner apex in image, ordinate, the width in region and the height in region, i, j indicate the wide starting point in region respectively With the high start in region.
CN201410479776.6A 2014-09-18 2014-09-18 A kind of camera status control method and its device Active CN104202529B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410479776.6A CN104202529B (en) 2014-09-18 2014-09-18 A kind of camera status control method and its device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410479776.6A CN104202529B (en) 2014-09-18 2014-09-18 A kind of camera status control method and its device

Publications (2)

Publication Number Publication Date
CN104202529A CN104202529A (en) 2014-12-10
CN104202529B true CN104202529B (en) 2018-07-24

Family

ID=52087751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410479776.6A Active CN104202529B (en) 2014-09-18 2014-09-18 A kind of camera status control method and its device

Country Status (1)

Country Link
CN (1) CN104202529B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812572B (en) * 2016-04-27 2020-01-07 努比亚技术有限公司 Image saving method and terminal
CN106546196B (en) * 2016-10-13 2018-04-03 深圳市保千里电子有限公司 A kind of optical axis real-time calibration method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287073A (en) * 2008-05-12 2008-10-15 吉林大学 Adaptive acquiring method of lightness stabilized image from machine vision system in variable irradiation surroundings
CN102724404A (en) * 2012-06-08 2012-10-10 北京大恒图像视觉有限公司 All weather exposure gaining automatic regulation method and system
CN103093654A (en) * 2013-01-28 2013-05-08 北京航空航天大学 Double video camera interactive intelligent tracking teaching system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287073A (en) * 2008-05-12 2008-10-15 吉林大学 Adaptive acquiring method of lightness stabilized image from machine vision system in variable irradiation surroundings
CN102724404A (en) * 2012-06-08 2012-10-10 北京大恒图像视觉有限公司 All weather exposure gaining automatic regulation method and system
CN103093654A (en) * 2013-01-28 2013-05-08 北京航空航天大学 Double video camera interactive intelligent tracking teaching system

Also Published As

Publication number Publication date
CN104202529A (en) 2014-12-10

Similar Documents

Publication Publication Date Title
CN103093654B (en) Double video camera interactive intelligent tracking teaching system
CN1156151C (en) Automatic determining preset position corresponding to television conference attendance
CN103716594B (en) Panorama splicing linkage method and device based on moving target detecting
CN102576466B (en) For the system and method for trace model
JP2020025320A (en) Video presentation device, video presentation method, and program
US8241125B2 (en) Apparatus and method of interaction with a data processor
US20180077345A1 (en) Predictive camera control system and method
CN103780837B (en) A kind of motion detection and the method and its device of positioning shooting
CN1425171A (en) Method and system for coordination and combination of video sequences with spatial and temporal normalization
CN1976445A (en) Multi-camera monitoring system based on three-dimensional video frequency dynamic tracking and tracking method thereof
WO2003036557A1 (en) Method and apparatus for background segmentation based on motion localization
CN108310764A (en) Assisted location method, device and equipment
CN107050803A (en) A kind of shuttlecock training supervision assessment system
CN104349038B (en) Enable the method and electronic equipment of pan-shot
CN104202529B (en) A kind of camera status control method and its device
WO2020228767A1 (en) Video fusion-based dynamic scene simulation method, system and storage medium
CN108594823A (en) The control method and its control system of sweeping robot
CN115334249B (en) Focus following method based on motion center, storage medium and camera system
Pidaparthy et al. Keep your eye on the puck: Automatic hockey videography
CN106991358A (en) The algorithm that automatic identification football match based on panoramic video is scored
US10122984B2 (en) Pan/tilt/zoom camera based video playing method and apparatus
CN109345614A (en) The animation simulation method of AR augmented reality large-size screen monitors interaction based on deeply study
CN111131713B (en) Lens switching method, device, equipment and computer readable storage medium
CN107396059A (en) A kind of panorama position adaptive student graphical analysis control method
CN115348392A (en) Shooting method and system based on template material

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Guangdong province Shenzhen City Guangming Street million Daiheng high tech Industrial Park No. 5 Building 5 floor

Applicant after: Shenzhen City Zhongzhi Kechuang Robot Co.,Ltd.

Address before: 518000 Guangdong province Shenzhen City Guangming Street million Daiheng high tech Industrial Park No. 5 Building 5 floor

Applicant before: SHENZHEN COSON ELECTRONIC CO.,LTD.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 518000 Shenzhen, Guangdong Guangming New District Guangming Street Wan Dai Heng hi tech Industrial Park 5, 5 floor.

Patentee after: SMART SECURITY & SURVEILLANCE ROBOT Co.,Ltd.

Address before: 518000 Shenzhen, Guangdong Guangming New District Guangming Street Wan Dai Heng hi tech Industrial Park 5, 5 floor.

Patentee before: Shenzhen City Zhongzhi Kechuang Robot Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180930

Address after: 518000 Shenzhen, Guangdong Guangming New District Guangming Street Wan Dai Heng hi tech Industrial Park 5, 5 floor.

Patentee after: SHENZHEN ZHONGZHI KECHUANG ROBOT Co.,Ltd.

Address before: 518000 Shenzhen, Guangdong Guangming New District Guangming Street Wan Dai Heng hi tech Industrial Park 5, 5 floor.

Patentee before: SMART SECURITY & SURVEILLANCE ROBOT Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210507

Address after: 518000 Room 201, building a, No.1 Qianhai 1st Road, Qianhai Shenxiang cooperation zone, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Zhongzhi Weian Robot Technology Co.,Ltd.

Address before: 518000 5th floor, No.5 workshop, wandaiheng hi tech Industrial Park, Guangming Street, Guangming New District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN ZHONGZHI KECHUANG ROBOT Co.,Ltd.