Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 2 is the flow chart of one embodiment of the invention method.In embodiments of the present invention, described method is used for picture pick-up device, and picture pick-up device refers to video camera.Be understandable that, picture pick-up device can also be camera, mobile phone, the first-class all kinds of instrument and equipment with camera function of shooting in other embodiments of the present invention.In addition, in other embodiments of the present invention, described method can also be used for non-picture pick-up device, and as image processing equipment, described non-picture pick-up device is connected with picture pick-up device and receives the image that described picture pick-up device obtains.For the equipment used for described method, the embodiment of the present invention does not limit.Also need to do some basic preparations before this external use embodiment of the present invention method, such as pass through the button on click video camera or select in graphical user interfaces, to open many pictures output mode or to be switched to many pictures output mode from common output mode.
The method of the embodiment of the present invention comprises following step:
S201: the one or more focuses extracting shooting from the image that picture pick-up device obtains, to form focus set.One frame (or being called a width) image exports from absorption video camera to eventually to the external world, in video camera internal processes, links may exist with the form of (or claiming interim) processing result image in the middle of corresponding (certainly have may at last one group of signal and can not image be called).Can in these between select a width as the image obtaining focus in image and the last image exported.Specifically focus acquisition is carried out to the image of video camera inside AD/DA (analog-to-digital conversion/digital-to-analogue conversion) module output element in embodiments of the present invention.Below the image that described picture pick-up device obtains is called original image or described image.
After obtaining original image, focus can be identified according to any one prior art or algorithm from original image.Preferably can obtain one or more focus, to form focus set according to sound to the algorithm of locating, the algorithm of motion detection and/or the algorithm of recognition of face.Such as sound is the MIC (Microphone of multiple sensing shooting area that is built-in by video camera or that be connected with video camera to location algorithm, microphone) collect on-the-spot sound, the orientation angle according to the size of collected sound, frequency and each MIC can calculate the sound source number in raw frames and record the position coordinates (x of each sound source in raw frames
1, y
1), (x
2, y
2) ....Focus can be obtained according to the one in these three kinds of algorithms to form focus set, the multiple focus that obtains wherein also can be used simultaneously to form focus set.Multiple focus may be had in described focus set, also may only have a focus.Certainly, the focus of the repetition that various algorithm obtains preferably also should be rejected in focus set.
In addition, the embodiment of the present invention mainly describes the situation automatically identifying focus, be understandable that, in other embodiments of the present invention, focus can also mode manually obtain, such as, click certain point in original image on the touchscreen, then join in focus set using this o'clock as the focus that is manually specified, to this, the embodiment of the present invention does not limit.
S202: obtain picture window to be output and described picture window is divided into some sprites, becomes many pictures to make described picture window.In embodiments of the present invention, if the resolution of video camera original image is w × h, set the resolution of output signal as W × H simultaneously, for the ease of understanding and describing, be that the output signal of W × H is called picture window to be output herein by this resolution, therefore picture window resolution to be output and W × H, and the process of the data in this output signal being carried out resetting just is equivalent to carry out cutting to picture window to be output.
(or claim cutting) is divided to obtain multiple sprite thus the cutting method forming many pictures can comprise two kinds to picture window to be output: one is manual type, the layout of namely specifying according to user divides, another kind is automated manner, namely automatically divides according to the focus number obtained.In embodiments of the present invention, the layout of preferentially specifying by user divides, and when user does not specify, enables automated manner to divide.
When being divided by manual type, the concrete steps of S202 can be: obtain the layout pattern of specifying, according to described layout pattern, described picture window is divided into some sprites.Such as can user be allowed to input sprite number in video camera UI interface, picture window to be output be divided equally by the number according to sprite; Also user can be allowed from pre-configured many picture layout pattern to select one, then picture window to be output is divided into the layout pattern that user selects; User even can also be allowed in the picture window to be output of one piece of simulation to carry out any specified layout pattern by adding the form splitting line, and to this, the embodiment of the present invention does not limit.Wherein a kind of layout pattern can be shown in Figure 3, and in Fig. 3, CP1, CP2... etc. number each sprite represented in a picture window to be output, and its size (in units of pixel) is respectively W
cp1× H
cp1, W
cp2× H
cp2..., and W
cp1× H
cp1+ W
cp2× H
cp2+ ...=W × H.Certainly, in other embodiments of the present invention, CP1, CP2 etc. may not be the situation of just filling up picture window, i.e. W
cp1× H
cp1+ W
cp2× H
cp2+ ... can W × H be less than, now the vacant position in picture window be filled out black.The numbering principle of sprite can be: the numbering taking breadth larger in (1) picture is less; (2) numbering more close to center in picture is less.
When being divided by automated manner, the concrete steps of S202 can be: obtain one according to the focus number in described focus set and specify integer; According to described appointment integer, equal divisional processing is carried out to described picture window, to obtain some sprites.Preferably, described appointment integer is specially the number being more than or equal to focus in described focus set and the smallest positive integral that can extract square root: can circulate from 1, step-length is+1, each power once, the integer c obtained and focus number n is compared, if this integer c is less than focus number n, continues circulation, if this integer c is more than or equal to focus number n, exit circulation, and c is described appointment integer, now each sprite will be all same size W
cp× H
cp, namely
suppose that focus is 7, so can be regarded as c is 9, be divided into 3 × 3 pieces, then 7 focuses inserted 7 sprites respectively by picture window to be output, 2 vacant sprites are filled out black.In addition, described appointment integer can also be a minimum non-prime integer being more than or equal to focus number, is now the product of two immediate integers by this Integer Decomposition, then divides equally described picture window by these two immediate integers.Such as focus number is 11, then find an integer 12,12 to can be analyzed to 3 × 4, so described picture window can be divided into 3 × 4 sprites.
Select the implementation automatically divided if it should be noted that, then S202 needs after S201, if if but the implementation of selection artificial division, then S202 can before or after S201.
S203: the padding performing predetermined number of times, described padding comprises: in described focus set, choose a focus do not chosen, a unfilled sprite is chosen in described some sprites, extract in described image and at least comprise selected focus and show with selected sprite the subimage block requiring to match, and described subimage block is filled in selected sprite.Preferably, described predetermined number of times specifically can be determined according to the one in following several numerical value: the focus number in the sprite quantity in described some sprites, described focus set, the numerical value of specifying.In other words, because sprite or focus generally have multiple, all above padding can be carried out repeatedly, until all sprites all complete, or the focus in focus set has all been selected, or reach the number of times of miscellaneous stipulations, or reach number of times that user specifies and stop.
Preferably, when choosing a unfilled sprite in S203 in described some sprites, can choose in the following order: according to taking the higher rule of the larger sprite priority of breadth, or according to more close to the rule that the priority of the sprite of center is higher, for each sprite arranges priority; Then in described some sprites, a unfilled sprite is chosen according to sprite priority order from high to low.
Preferably, choose in described focus set in S203 one do not choose focus time, can choose in the following order: first the focus obtained by algorithms of different in focus set is returned in different queues, as being placed on sound in positioning of focal queue by by sound to the focus that location algorithm obtains, then focus sequence is chosen according to sound to the large order of location > motion detection > recognition of face, again by the time order and function obtained or this focus queue of little order traversal such as focus and original image centre distance size in each focus queue, selected focus is judged whether in many pictures when traveling through, if do not existed, focus is inserted selected sprite, if, get next focus, if queue arrives tail of the queue, next queue is then selected to proceed traversal, until get a focus not in many pictures.In addition, that also can determine focus as follows chooses order: repeatedly obtain focus set at multiple time point, then add up, obtain the active degree of focus, the priority of focus large for active degree is decided to be height, then according to priority chooses focus from high to low.
More than select the relevant configuration information of the order of the order of focus and/or chooser picture can be stored in advance in the internal memory of video camera, for user.Can certainly be defined by user oneself and select the order of focus and/or the order of chooser picture.In addition, in other embodiments of the present invention, focus choose and/or sprite choose also can be do not have sequential, such as can the focus do not chosen of random selecting one and a unfilled sprite, then the subimage block at selected focus place is inserted in selected sprite.
If after all focuses are filled into many pictures all successively, remain unfilled sprite in addition, then residue sprite can be carried out filling out black process.If after all sprites are all filled, in focus set, also have residue focus not insert, then residue focus can be ignored.
In addition, in embodiments of the present invention, be the empty sprite of first according to priority selective sequential one and then go to fill by way selection focus be not included in many pictures of traversal, namely first select sprite to select focus more in brief.In other embodiments of the present invention, can also be first select focus to select sprite again, the sequencing of the two be not unique, and to this, the embodiment of the present invention does not limit.
Preferably, extract in S203 at least to comprise selected focus and show with selected sprite in described image and require that the step of the subimage block matched specifically can comprise:
S2031: the size of scaling coefficient to selected sprite according to specifying reduces process, to obtain size to be intercepted.
S2032: intercept parts of images around selected focus according to described size to be intercepted in described image.
S2033: amplification process is carried out, to obtain subimage block to described parts of images according to described scaling coefficient of specifying.
If the size of sprite to be filled is W
cp× H
cp, the method that the focus just obtained according to three kinds of focus acquisition algorithms respectively below carries out filling carries out specifically describing:
If by the focus selected be the focus found by motion detection algorithm, then can: first determine a scaling coefficient L, L can be empirical value, also can be specified by user, can obtain reasonable observing effect after amplifying L times respectively to make the wide height of the following parts of images intercepted.Exactly because also need the wide height of the parts of images of intercepting to amplify respectively L doubly after fill, therefore calculate the wide height of parts of images that intercepts should be respectively accordingly
with
with the coordinate (x having the position at moving displacement place that namely focus detects
b, y
b) centered by, with
as top left co-ordinate, with
as lower right corner coordinate, in original image, intercept a wide height be respectively
with
parts of images (for rectangle).And then by interpolation amplification algorithm, the wide high ratio of the parts of images of described intercepting is amplified L doubly, obtains a subimage block, just in time can insert W
cp× H
cpsprite in.
If be the focus found to location algorithm by sound by the focus selected, then the step and the motion detection that intercept subimage block are similar, that is: first determine a scaling coefficient M, the coordinate (x of the position of the determination sound source then namely detected with focus
c, y
c) centered by, with
as top left co-ordinate, with
as lower right corner coordinate, in original image, intercept a wide height be respectively
with
parts of images, and then by interpolation amplification algorithm, wide high than amplifying M doubly by the parts of images of described intercepting, just in time can insert W
cp× H
cpsprite in.
If by the focus selected be the focus found by face recognition algorithms, the step then intercepting subimage block can locate with the sound and motion detection algorithm similar, namely wide high than intercepting one subimage block centered by focal coordinates, by selected sprite, and then amplify and fill.But also can do some optimization processes according to the characteristic of face: because the face focus detected is often a face rectangular block, so preferentially subimage block can be intercepted in the ratio of face rectangular block, and then by the mode of transverse direction or longitudinal compensation, the wide height of subimage block is become the wide high ratio with selected sprite, insert in selected sprite after finally subimage block geometric ratio being amplified.If selected scaling coefficient is K, then the wide height of parts of images to be intercepted should be distinguished
with
set again the ratio of width to height of face rectangular block as
and the center point coordinate of face rectangular block is (xa, ya).Will
with
compare: if
explanation enlargement ratio is
and high direction need compensate, then with
As top left co-ordinate, with
As lower right corner coordinate, in original image intercept a wide height be respectively Km and
parts of images, then by interpolation amplification algorithm, wide high than amplifying by the parts of images of described intercepting
doubly, then just in time W can be inserted
cp× H
cpsprite in.If
explanation enlargement ratio is
and cross direction need compensate, then with
as top left co-ordinate, with
as lower right corner coordinate, in original image, intercept a wide height be respectively
with the parts of images of Kn, and then by interpolation amplification algorithm, the wide high ratio of the parts of images of described intercepting is amplified
doubly, then just in time W can be inserted
cp× H
cpsprite in.Fig. 4 is the schematic diagram being carried out filling by the focus sprite obtained according to above three kinds of algorithms.
It should be noted that, in embodiments of the present invention, be all go out a less size by the Size calculation of selected sprite in original image, then according to this less size cut parts of images, geometric ratio is filled in selected sprite after amplifying.Such as, and in other embodiments of the present invention, the extracting at least to comprise selected focus and show with selected sprite in described image of S203 requires that the step of the subimage block matched can also be specifically other situations, comprises the following steps:
S2031 ': read size to be intercepted that is preset or input.Namely need not calculate size to be intercepted, but direct reading system is preset or a value of user's input.
S2032 ': intercept parts of images around selected focus according to described size to be intercepted in described image.
S2033 ': amplification process is carried out, to obtain subimage block to described parts of images according to described scaling coefficient of specifying.If such as selected sprite is larger, when then being amplified by the parts of images of intercepted fixed dimension, its amplification coefficient is just corresponding larger, otherwise, if selected sprite is comparatively large, if its amplification coefficient is just corresponding comparatively large when then being amplified by the parts of images of intercepted fixed dimension.Certainly, if this sprite is not filled complete after filling, then vacant position is filled out black.
Again such as, the parts of images of intercepting can not carry out amplifying and directly inserting in sprite, is also to play the object that focus become be easy to observe, reach outstanding focus.
Also such as, the partial original image at whole original image or multiple focus place can be chosen, be filled in a sprite after then being reduced, can panorama be taken into account to make user while each focus of observation.
S204: export the many pictures be made up of described some sprites.Described output may be export directly to the external world, and such as outputting to monitor or memory device etc., also may be next processing links outputting to video camera inside, concrete relevant to selected original image.
It should be noted that in addition, above step is all the process carried out a frame or title piece image, be understandable that, when after the information such as the position size getting subimage block, later each two field picture no longer can carry out the steps such as focus acquisition but the information extraction subimage blocks such as the position size of the direct subimage block according to obtaining in the past continue to fill many pictures, thus forms video flowing.
In addition, preferably, following step of updating can also be comprised after step S204:
According to the new image that described picture pick-up device obtains, upgrade described focus set, and according to the focus set after renewal, the subimage block that each sprite in described many pictures is filled is upgraded.In the scene being shot had, focus may can not change, and now only need obtain a secondary focal point set when initial; And focus may change to some extent in the scene had, the position of the focus of walking about or disappearing and causing of such as spokesman changes or disappears, and now can also re-start to fill to many pictures to upgrade in other words conj.or perhaps.Described renewal can be real-time, such as all carry out focus to every two field picture to obtain to obtain up-to-date focus set, and the subimage block new according to new focus set extract real-time carries out filling (or perhaps upgrading the subimage block that each sprite fills); Described renewal also can be regular, such as, carry out a secondary focal point acquisition to the image of present frame at set intervals, to upgrade focus set, and extracts new subimage block according to new focus set and fills.
Upgrade the step of described focus set with S201 step is similar above, such as: first use face recognition algorithms to regain some face focuses, then travel through the face focus queue in focus set and compare with the some face focuses regained, if there is newly-increased face focus, then add in the queue of face focus, if some focuses disappear, it is deleted from face queue.Use motion detection and sound to location algorithm upgrade the method for corresponding focus queue and above recognition of face similar, repeat no more herein.
The step upgraded the subimage block that each sprite in described many pictures is filled according to the focus set after upgrading is with S203 step is similar above, such as: from many pictures, choose a sprite according to the first order and from focus set, choose a focus according to the second order, then judge whether the coordinate of selected focus is included in the scope of the subimage block in selected sprite, if then continue to choose next focus, then subimage block corresponding for this focus is filled in selected sprite if not.
In addition, preferably, if the number of focus changes in the focus set after upgrading, then can also comprise in above-mentioned step of updating: the change according to focus number in the focus set after described renewal adjusts the layout pattern of sprite in described many pictures.In other words, if find after upgrading, the number of focus has become, then can adjust many pictures neutron picture layout pattern, and opportunity of described adjustment can be real-time also can be regular, and adjusting method used can be similar with step S202.Such as, many pictures of 16 sprite compositions if current, and after upgrading focus set, find that unduplicated focus number becomes 12, then adjustment exports automatically is many pictures that 12 sprites form, the size of sprite also adjusts accordingly simultaneously, can be fully exploited to make whole picture window to be output; In like manner, be many pictures of 12 sprite compositions if current, and find after upgrading focus set that unduplicated focus number becomes 16, then adjustment exports automatically is many pictures that 16 sprites form, and the size of sprite also adjusts accordingly.
By the method in the embodiment of the present invention, picture window to be output for video camera can be divided into the form of many pictures, and video camera obtain image in automatic search focus, then extract focus place parts of images and output to for viewing in each sprite of many pictures, thus each focus in scene is highlighted simultaneously, be easy to observe.In addition this many picture also can adjust according to the change of each focus automatically.
Fig. 5 is the flow chart of another embodiment of the present invention method, in video camera, comprises the following steps:
S501: the Sensor movement sampling in video camera;
S502:AD conversion, quantification, coding composition one frame original image;
S503: judge whether to open many image modes, if open, enter S504, if do not open, jumps directly to S519 and exports;
S504: obtain focus set in raw frames.Namely in raw frames, one or more focuses of shooting are extracted, to form focus set;
S505: judge the configuration information that whether there is many picture layout pattern in internal memory, if exist, enters S506, if do not exist, enters S507;
S506: read configuration information, and enter S508;
S507: according to the automatic segmentation of focus number, and enter S508;
S508: according to configuration information or automatic segmentation, determines many picture layout pattern;
S509: judge whether many pictures fill up, if then enter S517, then enter S510 if not;
S510: obtain the n-th sprite according to the first appointment order from many pictures;
S511: travel through according to the focus in the second appointment order focusing set;
S512: judge current selected focus whether in many pictures, if then carry out operation S511, then enter S513 if not;
S513: the parts of images intercepting this focal position from original image;
S514: carry out uniform zoom;
S515: insert in the n-th sprite;
S516: make n increase progressively 1, and continue to perform S509;
S517: export.
By the method in the embodiment of the present invention, picture window to be output for video camera can be divided into the form of many pictures, and video camera obtain image in automatic search focus, then extract focus place parts of images and output to for viewing in each sprite of many pictures, thus each focus in scene is highlighted simultaneously, be easy to observe.
Fig. 6 is the schematic diagram of further embodiment of this invention device, and described device comprises:
Focus acquiring unit 601, for extracting one or more focuses of shooting in the image that obtains from picture pick-up device, to form focus set;
Many pictures setting unit 602, for obtaining picture window to be output and described picture window being divided into some sprites;
Focus chooses unit 603, for choosing a focus do not chosen in described focus set;
Sprite chooses unit 604, for choosing a unfilled sprite in described some sprites;
Subimage block extraction unit 605, at least comprises selected focus for extracting in described image and shows with selected sprite the subimage block requiring to match;
Sprite filler cells 606, for being filled in selected sprite by described subimage block;
Filling control unit 607, for choosing unit to described focus, described sprite chooses unit, described subimage block extraction unit and described sprite filler cells carry out calling of predetermined number of times;
Many pictures output unit 608, for exporting the many pictures be made up of described some sprites.
Preferably, described subimage block extraction unit 605 specifically comprises:
Size reduces subelement, for reducing process according to the size of scaling coefficient to selected sprite of specifying, to obtain size to be intercepted;
Image interception subelement, for intercepting parts of images around selected focus according to described size to be intercepted in described image;
Nonlinear magnify subelement, for carrying out amplification process, to obtain subimage block according to described scaling coefficient of specifying to described parts of images.
Preferably, described subimage block extraction unit 605 specifically comprises:
Size obtains subelement, for reading size to be intercepted that is preset or input;
Image interception subelement, for intercepting parts of images around selected focus according to described size to be intercepted in described image;
Nonlinear magnify subelement, carries out amplification process, to obtain subimage block for the size according to selected sprite to described parts of images.
Preferably, described many pictures setting unit 602 specifically comprises:
Sprite number obtains subelement, for determining an appointment integer according to the focus number in described focus set;
Picture window cutting subelement, for obtaining picture window to be output and carrying out equal divisional processing according to described appointment integer to described picture window, becomes many pictures to make described picture window.
Preferably, described many pictures setting unit 602 specifically comprises:
Layout pattern obtains subelement, for obtaining the layout pattern of specifying;
Picture window cutting subelement, for obtaining picture window to be output and according to described layout pattern, described picture window being divided into some sprites, becomes many pictures to make described picture window.
Preferably, described device also comprises:
Updating block, for focus set acquiring unit described in the new image notification that obtains according to described picture pick-up device, described focus set is upgraded, and notify that described filling control unit upgrades the subimage block that each sprite in described many pictures is filled according to the focus set after upgrading.
Preferably, described updating block also adjusts for the division of many pictures setting unit to described picture window according to the change notification of focus number in the focus set after described renewal.
By the device in the embodiment of the present invention, picture window to be output for video camera can be divided into the form of many pictures, and video camera obtain image in automatic search focus, then extract focus place parts of images and output to for viewing in each sprite of many pictures, thus each focus in scene is highlighted simultaneously, be easy to observe.In addition this many picture also can adjust according to the change of each focus automatically.
Fig. 7 is the schematic diagram of yet another embodiment of the invention image processing equipment, for exporting many pictures, comprising:
Processor 701: for extracting one or more focuses of shooting in the image that obtains from picture pick-up device, to form focus set; Obtain picture window to be output and described picture window is divided into some sprites; Perform the padding of predetermined number of times, described padding comprises: in described focus set, choose a focus do not chosen, a unfilled sprite is chosen in described some sprites, extract in described image and at least comprise selected focus and show with selected sprite the subimage block requiring to match, and described subimage block is filled in selected sprite; Export the many pictures be made up of described some sprites;
Memory 702: for storing described focus set.
For apparatus embodiments, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
By the image processing equipment in the embodiment of the present invention, picture window to be output can be divided into the form of many pictures, and video camera obtain image in automatic search focus, then extract focus place parts of images and output to for viewing in each sprite of many pictures, thus each focus in scene is highlighted simultaneously, be easy to observe.
It should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
One of ordinary skill in the art will appreciate that all or part of step realized in said method execution mode is that the hardware that can carry out instruction relevant by program has come, described program can be stored in computer read/write memory medium, here the alleged storage medium obtained, as: ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.