Specific embodiment
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, Detailed description of the invention will be compareed below
A specific embodiment of the invention.It should be evident that drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing, and obtain other embodiments.
To make simplified form, part related to the present invention is only schematically shown in each figure, they are not represented
Its practical structures as product.In addition, there is identical structure or function in some figures so that simplified form is easy to understand
Component only symbolically depicts one of those, or has only marked one of those.In addition, unless otherwise instructed, in this hair
" upper and lower " of bright middle appearance, " left and right ", " forward and backward ", " one, another " etc. are relative concept.
In one embodiment of the invention, as shown in Figure 1, a kind of automatic photography patterning process, comprising:
The profile information of step S100 acquisition photographic subjects.
Specifically, as needed, photographic subjects can be adult or children, it can be one or more personages.Work as shooting
When target is personage, profile information include the head of people, body, each artis location information, can by these location informations
To describe the appearance profile of a people.Since profile information is for photography composition service, so not needing to obtain body curve's
Precise information, volume available is slightly larger and the simple closed geometry body of characteristic replaces.As an example, one as shown in Figure 6
The profile information of people, wherein head position information is expressed with the position of the rectangle frame (head frame 1) comprising head, further
Ground can use the upper left point coordinate and lower-right most point coordinate representation of head frame, or be indicated with lower-left point coordinates and upper right point coordinates;Body
Location information is expressed with the position of the rectangle frame (body frame 3) comprising body, further, can be sat with the upper left point of body frame
Mark and lower-right most point coordinate representation, or indicated with lower-left point coordinates and upper right point coordinates;Each artis, with the central point in each joint
The coordinate of (artis 4) is expressed;The data volume of processing can be reduced in this way, reduced and calculated photography complexity.Profile information can lead to
Cross human testing, critical point detection technology obtains.
Step S200 generates initial composition frame to the photographic subjects according to the profile information.
Specifically, composition frame refers to the closure frame with certain shapes and size, for limiting the shape, big of photographic picture
It is small.In general, composition frame is rectangle frame, left and right width is greater than upper-lower height.As needed, it is rotated by 90 ° in such as camera
When realizing perpendicular clap, the upper-lower height of composition frame is then greater than left and right width.The ratio between wide height of composition frame is to have certain requirements, mainly
The size of sensor depending on photographic units such as cameras, popular has 3:2 format, and there are also the formats such as 1:1,4:3, so
Composition frame needs to meet preset photography the ratio of width to height requirement.
Destruction personage's integrality such as limb is cut off or cut in order to avoid occurring photographic subjects in the picture exported of photographing, image
The phenomenon that, it needs to generate composition frame according to the profile information of photographic subjects.Optionally, it is required according to photography, for example, only needing to shoot
The upper part of the body of personage, then extract the upper part of the body information of photographic subjects from profile information, and composition frame can only include photographic subjects
Upper part of the body information;If being required without special photography, usually press and guarantee that the entire integrality of personage considers, composition frame needs include
The entire profile information of photographic subjects.
In addition, according to composition rule, photographic subjects usually require to be placed in order to protrude photographic subjects, promote shooting quality
The central area position of composition frame.As a preferred embodiment, optionally it is also possible to consider photographies to want according to profile information
It asks, obtains the external envelope frame of photographic subjects;Using the center of the external envelope frame as the center of composition frame, then it is wide high by preset photography
Than obtaining the rectangle frame of a complete external envelope frame comprising photographic subjects, a more satisfactory composition frame is so obtained, until
It is the composition frame for meeting predeterminated position composition rule and pre-set dimension composition rule less, i.e., by taking personage is shone as an example, if this composition
There was only photographic subjects in frame, without other personages, exports and photograph by this composition frame, then photographic subjects are in picture (or photo)
Corresponding position meets position composition rule, and size of the photographic subjects in picture (or photo) is also to meet size composition rule
Then.Predeterminated position/size composition rule is upper in picture (or photo) to photographic subjects according to the aesthetic requirement of shooting
The set of the default judgement of the factors such as lower left and right spatial position/size.
To sum up, the above-mentioned composition frame obtained according to the profile information of photographic subjects, referred to as initial composition frame.
Step S300, which judges to whether there is in the initial composition frame, accompanies body, described to accompany body photographic subjects for other.
Specifically, body is accompanied to refer to that other similar with photographic subjects can photographic subjects.For example, photographic subjects are natural person
When, accompany body for other people or crowd.In the occasion of such as more people's aggregation, by photographic subjects (specific one natural person) and one
It is a or it is multiple accompany body (other natural persons) to carry out identification differentiation, so as to be obtained as far as possible using photographic subjects as image center
Composition frame, and then obtain such as only including the single portrait of photographic subjects.So being needed to promote the shooting quality of photographic subjects
Judge in initial composition frame in addition to photographic subjects, if there is also accompany body or accompany body a part (i.e. initial composition frame with accompany
Body exists overlapping).It may be there is no accompanying body in initial composition frame, or there are one to accompany body, or accompanies body there are multiple.
Step S400 when in the initial composition frame there is no accompany body when, using the initial composition frame as target pattern frame
Output.
Specifically, showing that the initial composition frame currently formed only includes photographic subjects there is no body is accompanied in initial composition frame.
Since current composition frame has been more satisfactory composition frame, can obtain only include such as single people photo, so can should
Initial composition frame is exported as target pattern frame.
Step S500 judges whether there is one and accompanies body must be also as bat when in the initial composition frame in the presence of body is accompanied
Take the photograph target.
Specifically, the influence for considering to accompany body is needed, for example, accompanying physical efficiency no from structure when in initial composition frame in the presence of body is accompanied
It is removed in picture frame, still must also be used as photographic subjects.If can remove from composition frame, photographic subjects can be further promoted
Shooting effect.In initial composition frame there may be one accompany body or it is multiple accompany body, whether judgement each accompanies body that must respectively
As photographic subjects, obtaining further according to each judging result for accompanying body must also accompanying as photographic subjects with the presence or absence of one
Body.Each accompany the judging means of body can be with are as follows: the overlapping area for accompanying body Yu initial composition frame to be calculated, if the overlapping area is greater than
Preset value, then this accompanies body that must also be used as photographic subjects.Preferably, the overlapping area for each accompanying body Yu initial composition frame is calculated,
And calculate the ratio that the area accounts for the entire area for accompanying body.When the ratio is greater than or equal to preset value, then this accompanies body necessary
Also photographic subjects are used as;Otherwise, this accompanies body not as photographic subjects.As shown in fig. 7, there are one in initial composition frame to accompany body,
Wherein big frame indicates that initial composition frame, the expression of small frame accompany body, left side figure be accompany body must also as an example of photographic subjects,
The right figure is an example for accompanying body not as photographic subjects;Left side figure, which reflects, accompanies the most of in initial composition frame of body,
Illustrate that body is accompanied to be closer with photographic subjects, even if body can will be accompanied to remove by mobile initial composition frame, but such photographic subjects
Also it can be in the edge of initial composition frame, do not meet default composition rule, so such case needs will accompany body also as shooting
A part of target.
Step S600, which exists in the initial composition frame, accompanies body, and all when accompanying body all not as photographic subjects, again
Generation accompanies body disturbance degree no more than current composition frame, and exports as target pattern frame.
Body is accompanied specifically, existing in the initial composition frame, if all when accompanying body all not as photographic subjects, illustrate own
Accompany influence all very little of the body to initial composition frame.Such case can accompany body disturbance degree smaller than current composition frame by regenerating
Composition frame further promote shooting quality.Body disturbance degree is accompanied to reflect the influence for accompanying body to composition frame, for example, by accompanying body
Accounting for the overlapping area of composition frame or the overlapping area accompanies the ratio of body to judge.
For example, exist in the composition frame as shown in figure 8, the left side is initial composition frame and accompany body, the overlapping of body and composition frame is accompanied
Area, which accounts for, accompanies the ratio of the entire area of body small, belongs to and accompanies the case where body is not as photographic subjects;By moving to left composition frame, the right side is obtained
The composition frame on side has been not present in the composition frame and has accompanied body, and accompanying the overlapping area of body and composition frame is 0, and body disturbance degree is accompanied to reduce,
It can be exported as target pattern frame.
For another example, as shown in figure 9, the left side is initial composition frame, exist in the composition frame and accompany body, moving to left composition frame to keep away
When accompanying body on the right of exempting from, the left side occurs newly accompanying body again, it is apparent that the left side newly accompanies the overlapping area of body and composition frame than initial structure
Picture frame it is smaller, so can obtain one accompanies the smaller composition frame of body disturbance degree, can be exported as target pattern frame.
In other instances, relatively initial composition frame possibly can not retrieve and accompany the smaller composition frame of body disturbance degree, but
It is smaller due to accompanying body to influence, practical photograph is avoided even exporting initial composition frame and can also cut by the photo after such as photographing
Exist in piece and accompanies body.Further, when there are it is a variety of accompany body disturbance degree smaller composition frame when, therefrom selection accompanies body disturbance degree most
Small composition frame is exported as target pattern frame.
Step S700, which works as to exist in the initial composition frame, accompanies body, and at least accompanies body that must also be used as in the presence of one and shoot mesh
When mark, also body and the photographic subjects will must be accompanied to constitute new photographic subjects as photographic subjects, and replaced with new photographic subjects
For photographic subjects, step S100 is jumped to.
Specifically, accompany body there are one in the initial composition frame, and when this is accompanied body also and must be incorporated into photographic subjects, this is accompanied
Body and photographic subjects combination, obtain new photographic subjects, replace photographic subjects with new photographic subjects, restart new round target structure
The generation of picture frame, output process.When accompanying body there are multiple in initial composition frame, and some or all accompany body must be as shooting mesh
When mark, also body and photographic subjects must be accompanied to combine as photographic subjects by all, new photographic subjects be obtained, with new photographic subjects
Instead of photographic subjects, restart generation, the output process of new round target pattern frame.
Usual photographic process is: discovery photographic subjects, adjustment photographic unit (such as camera) are directed at photographic subjects, are taking the photograph at this time
There is the image comprising photographic subjects in the visual field of shadow component, composition frame then is set to the photographic subjects in present image
(preview pane in similar digital camera);If satisfied to the image in composition frame, photography is executed.So in setting composition frame
Before, has the image comprising photographic subjects in the visual field of photographic unit, if it is the intensive scene of more people, which can
The profile information of all persons in the image can be obtained at this time comprising accompanying body.Optionally, disposable before photography composition
The profile information (or exporting by the prime module of photography composition) of all persons in image is identified and calculated, and is stored.
It in this way can be when photographic subjects adjust, for example, newly-increased one is accompanied body, it is not necessary to re-recognize again and calculate the wheel for accompanying body
Wide information, and the profile information of body can be accompanied to obtain new photographic subjects with this according to the profile information of stored photographic subjects
Then profile information further obtains the initial composition frame of new photographic subjects.Can certainly, it is first obtained in photography composition
The profile information of photographic subjects goes to identify and calculate the related profile information for accompanying body when needed again;The present embodiment uses
The former mode.
The present embodiment adjusts photographic subjects by dynamic in the scene that personage is intensive, to adaptively realize that number is not true
Fixed, the uncertain composition of movement.The patterning process of the present embodiment be although be described with photographic subjects for personage, it is apparent that
Also being suitble to photographic subjects is that animal, plant or building etc. have the object of clear profile, method be it is general, no longer repeat.
In another embodiment of the present invention, as shown in Fig. 2, a kind of automatic photography patterning process, comprising:
The profile information of step S100 acquisition photographic subjects.
Step S210 establishes the external envelope frame of photographic subjects according to the profile information.
The profile information is human body profile information, and the human body contour outline information includes that the head frame of the photographic subjects is sat
Mark, body frame coordinate and each body joint point coordinate.According to the external envelope frame that the profile information establishes photographic subjects include: take it is described
The minimum value of the head frame coordinates of photographic subjects, body frame coordinate and the x coordinate value in each body joint point coordinate is as left side x coordinate
Value;Take the maximum value of the x coordinate value in head frame coordinate, body frame coordinate and each body joint point coordinate of the photographic subjects as right
Side x coordinate value;Take the head frame coordinate of the photographic subjects, the minimum of body frame coordinate and the y-coordinate value in each body joint point coordinate
Value is used as following y-coordinate value;Take the y-coordinate in head frame coordinate, body frame coordinate and each body joint point coordinate of the photographic subjects
The maximum value of value is as top y-coordinate value;According to the left side x coordinate value, the right x coordinate value, the following y-coordinate value
Top left co-ordinate and bottom right angular coordinate are obtained with the top y-coordinate value, it is true according to the top left co-ordinate and bottom right angular coordinate
The external envelope frame of the fixed photographic subjects;Or, according to the left side x coordinate value, the right x coordinate value, the following y-coordinate
Value and the top y-coordinate value obtain lower-left angular coordinate and upper right angular coordinate, according to the lower-left angular coordinate and upper right angular coordinate
Determine the external envelope frame of the photographic subjects.
Step S220 generates initial composition frame according to the external envelope frame, and the initial composition frame includes the external envelope
Frame, and concentrically with the external envelope frame.
Specifically, obtain the profile information of photographic subjects before starting composition, for example, the upper left point coordinate of head frame and
Lower-right most point coordinate, Body frame upper left point coordinate and lower-right most point coordinate, each artis coordinate;According to the seat of the above each point
Mark obtains the external envelope frame of photographic subjects (using rectangle frame, abbreviation figure frame).Specifically, taking all each point x coordinates most
Small value is used as left side x coordinate value xmin, the maximum value of all each point x coordinates is taken to be used as the right x coordinate value xmax, take all each point y
The minimum value of coordinate is as following y-coordinate value ymin, take the maximum value of all each point y-coordinates as top y-coordinate value ymax, thus
The top left co-ordinate for obtaining figure frame is (xmin, ymax), bottom right angular coordinate is (xmax, ymin), lower-left angular coordinate is (xmin,
ymin), upper right angular coordinate is (xmax, ymax), figure frame can be determined according to top left co-ordinate and bottom right angular coordinate, it can also be with
Figure frame is determined according to lower-left angular coordinate and upper right angular coordinate.As an example, as shown in fig. 6, the figure frame 2 has been
It is whole surround the head of personage, body, artis minimum rectangle frame.Optionally, it is required according to photography, for example, need to only shoot people
The upper part of the body of object can intercept the upper half from the external envelope frame if the external envelope frame of an overall profile information has been established
It is allocated as the external envelope frame for needs.
Take the center of external envelope frame as the center of initial composition frame, then obtains a complete packet by preset photography the ratio of width to height
Rectangle frame (i.e. initial composition frame) containing the external envelope frame.
Specifically, for example, with constant (height of the height of i.e. initial composition frame equal to external envelope frame of the height of external envelope frame
Degree), according to preset photography the ratio of width to height, the width of initial composition frame is calculated, if the width of the initial composition frame is more than or equal to
The width of external envelope frame obtains just then by the symmetrical outreach of the corresponding side length of the width of external envelope frame to the width of initial composition frame
Beginning composition frame;Otherwise, the width according to external envelope frame is constant (width that the width of i.e. initial composition frame is equal to external envelope frame), presses
According to preset photography the ratio of width to height, the height of initial composition frame is calculated, the symmetrical outreach of the corresponding side length of the height of external envelope frame is arrived
The height of initial composition frame, obtains initial composition frame.
Preferably, according to the width of external envelope frame and height and preset photography the ratio of width to height, width accounting is calculated separately
With height accounting;Compare the size of width accounting and height accounting;When height accounting is greater than width accounting, according to external envelope frame
Height and described photography the ratio of width to height calculate the width of initial composition frame, and keep external envelope frame height it is constant, by external envelope frame
The symmetrical outreach of width arrive the width of initial composition frame, obtained rectangle frame is initial composition frame;When the height accounting is little
When the width accounting, the height of initial composition frame is calculated according to the width of external envelope frame and described photography the ratio of width to height, and protect
The width for holding external envelope frame is constant, and by the height of the symmetrical outreach of the height of external envelope frame to initial composition frame, obtained rectangle frame is
Initial composition frame.Example is highly 0.8, preset photography the ratio of width to height is 3:2 if the width of an external envelope frame is 0.4
(showing that camera is imaged according to 3:2), calculating width accounting (the ratio between corresponding width) is 0.1333 (=0.4/3), is highly accounted for
It is 0.4 (=0.8/2) than (the ratio between corresponding height), wherein height accounting is greater than width accounting, to guarantee in external envelope frame
Content is not cut out, thus selection external envelope frame height remain unchanged, calculate initial composition frame width be equal to 1.2 (=
0.8/2*3), the width for obtaining initial composition frame is 1.2, is highly 0.8;By the symmetrical outreach of the width of external envelope frame to initial composition
The width of frame, obtained rectangle frame are initial composition frame.
Step S300, which judges to whether there is in the initial composition frame, accompanies body, described to accompany body photographic subjects for other.
Step S400 when in the initial composition frame there is no accompany body when, using the initial composition frame as target pattern frame
Output.
Whether step S510 accompanies body must be also as bat when accompanying body there are one in the initial composition frame described in judgement
Take the photograph target;
For step S520 when accompanying body there are at least two in the initial composition frame, whether judgement each accompanies body necessary respectively
Also photographic subjects are used as;
Each accompany body whether must be also as follows as the judgment step of photographic subjects:
The overlapping area of body Yu the initial composition frame is accompanied described in calculating, and is calculated the overlapping area and accounted for and described accompany body
The ratio of entire area;
Judge whether the ratio is greater than or equal to preset value;It is described to accompany when the ratio is greater than or equal to preset value
Body must also be used as photographic subjects;It is described to accompany body not as photographic subjects when the ratio is less than preset value.
Step S530 judges whether there is one and accompanies body that must also be used as photographic subjects.
Specifically, when in initial composition frame there are it is multiple accompany body when, accompany body to judge respectively to each, which accompany body not as
Photographic subjects, which must also be used as photographic subjects.According to each judging result for accompanying body, judges whether there is one and accompany body must
Photographic subjects must be also used as.
Each accompany body judgment method be it is identical, are as follows: calculate and accompany the overlapping area of body Yu initial composition frame, and calculate this
Area accounts for the ratio for accompanying the entire area of body.When the ratio is greater than or equal to preset value, then this accompanies body must be also as shooting
Target;Otherwise, this accompanies body not as photographic subjects.As shown in fig. 7, the figure on the left side be accompany body must also as photographic subjects one
A example, the figure on the right are an examples for accompanying body not as photographic subjects.
Step S610, which exists in the initial composition frame, accompanies body, and all when accompanying body all not as photographic subjects, mobile
The initial composition frame accompanies the smallest composition frame of body disturbance degree as target pattern frame to obtain, and exports the target pattern
Frame.
Accompany body specifically, existing in the initial composition frame, and all when accompanying body all not as photographic subjects, it is mobile primary or
Repeatedly initial composition frame regenerates several new composition frames, and selection accompanies body to influence from obtained new composition frame and initial composition frame
The smallest effective composition frame is spent to export as target pattern frame.Effective composition frame is the composition of the external envelope frame comprising photographic subjects
Frame.
One or more combination can be selected to attempt to translate initial composition frame from up, down, left and right four directions.Further
Ground can be moved up or down when the height of initial composition frame is greater than the height of external envelope frame.When initial composition frame
Width be greater than external envelope frame width when, can be moved to the left or right.Further, according to accompanying body and photographic subjects
Relative positional relationship select suitable moving direction, it is preferable that accompany the direction of body to move initial composition frame along this is removed, than
Such as, as shown in figure 8, accompanying body on the right of initial composition frame, towards left direction movement.
Optionally, when only one accompanies body in initial composition frame, body is accompanied to be set as with reference to accompanying body this.When initial composition frame
Inside have multiple when accompanying body, selects one body is accompanied to be set as with reference to accompanying body.The direction of body is accompanied to move one by default stepping along reference is removed
Secondary initial composition frame obtains a new composition frame.Judge that the whether effective composition frame of new composition frame (completely includes photographic subjects
The composition frame of external envelope frame).If not effective composition frame, then exported initial composition frame as target pattern frame.If it is
Effective composition frame, then further calculate the new composition frame accompanies body disturbance degree, and accompanies body disturbance degree to carry out with initial composition frame
Compare.If accompanying body disturbance degree smaller, exported the new composition frame as target pattern frame.
By judging whether new composition frame is effective composition frame, it ensure that the target pattern frame of output must be effective composition
Frame is not in cut hand, cut situations such as foot.
Further, it by multiple continuous translation, obtains certain direction and accompanies the smallest effective composition frame of body disturbance degree, and made
For the output of target pattern frame.Specifically, for example, when only one accompanies body in initial composition frame, body is accompanied to be set as with reference to accompanying this
Body.When have in initial composition frame it is multiple accompany body when, select one body is accompanied to be set as with reference to accompanying body.Along remove with reference to accompany the direction of body by
The default mobile primary initial composition frame of stepping, obtains first new composition frame.When first new composition frame be effective composition frame, and
Body disturbance degree more hour is accompanied, then continues to move along former direction, obtains second new composition frame, judge accompanying for second new composition frame
Body disturbance degree and validity, are so repeated continuously, until the obtained new composition frame of n-th accompanies body disturbance degree greater than previous
Or the new composition frame of n-th be not effective composition frame.It is exported using N-1 new composition frames as target pattern frame.By above-mentioned
Mode accompanies the smallest effective composition frame of body disturbance degree on some available direction, further reduced the shadow for accompanying body disturbance degree
It rings, improves patterning quality.
Further, when in initial composition frame there are it is multiple accompany body when, select one to accompany body as with reference to accompanying body, along removing ginseng
It examines and the direction of body is accompanied persistently to move initial composition frame, accompany the smallest effective structure of body disturbance degree in this direction according to preceding method acquisition
Picture frame is denoted as a candidate composition frame;It selects another to accompany body as with reference to body is accompanied, repeats the above method, it is right to obtain another
The candidate composition frame answered;In this way, obtaining each candidate composition frame for accompanying body to remove direction, then therefrom selection accompanies body disturbance degree minimum
Candidate composition frame as target pattern frame export.For example two accompanied body (to accompany and body 1 and accompany body 2, accompany body 1 on the right side of photographic subjects
Side accompanies body 2 on the left side of photographic subjects), according to the above method, accompany direction (i.e. to the left side) continuous translation of body 1 initial along removing
Composition frame, acquisition accompany the smallest effective composition frame of body disturbance degree in this direction, are denoted as candidate composition frame 1.Again according to the above method, edge
The initial composition frame of direction (i.e. to the right) continuous translation for accompanying body 2 is removed, acquisition accompanies body disturbance degree the smallest effectively in this direction
Composition frame, as candidate composition frame 2.That compares candidate composition frame 1 and candidate composition frame 2 accompanies body disturbance degree, and therefrom body is accompanied in selection
The smallest composition frame of disturbance degree is exported as target pattern frame, in this way, further reduced the influence for accompanying body disturbance degree, is improved
Patterning quality.
Assessment accompanies the factor of body disturbance degree to include composition frame and accompany the overlapping area of body, and/or have with composition frame overlapping
Accompany body quantity.For example, accompanying body disturbance degree with the overlapping area assessment of body is accompanied according to composition frame, then overlapping area is smaller, accompanies body shadow
Loudness is lower;Overlapping area is 0, and accompanying body disturbance degree is 0, so selecting composition frame and accompanying the smallest composition of the overlapping area of body
Frame.For another example, overlapping body quantity and composition frame are accompanied and accompanies the overlapping area of body to assess body is accompanied to influence according to having with composition frame
Degree, further, can preferentially accompany body quantity few, accompany under body quantity preferential composition frame identical and accompany the overlapping area of body the smallest
Composition frame.
Step S700, which works as to exist in the initial composition frame, accompanies body, and at least accompanies body that must also be used as in the presence of one and shoot mesh
When mark, also body and the photographic subjects will must be accompanied to constitute new photographic subjects as photographic subjects, and replaced with new photographic subjects
For photographic subjects, step S100 is jumped to.
In one embodiment of the invention, as shown in figure 3, a kind of automatic photography patterning apparatus 100, including profile information
It obtains module 110, composition frame generation module 120, accompany body judgment module 130, composition frame output module 140.
The profile information obtains module 110, for obtaining the profile information of photographic subjects.
Specifically, as needed, photographic subjects can be adult or children, it can be one or more personages.Work as shooting
When target is personage, profile information may include the head of people, body, each artis location information, pass through these location informations
The appearance profile of one people can be described.Due to of the invention further, profile information is for photography composition service, so being not required to
Obtain the precise information of body curve, volume available is slightly larger and the simple closed geometry body of characteristic replaces, and can subtract in this way
The data volume handled less reduces and calculates photography complexity.Profile information can be obtained by human testing, critical point detection technology.
The composition frame generation module 120, for generating initial composition to the photographic subjects according to the profile information
Frame.
Composition frame refers to the closure frame with certain shapes and size, for limiting shape, the size of photographic picture.Generally
For, composition frame is rectangle frame.
Destruction personage's integrality such as limb is cut off or cut in order to avoid occurring photographic subjects in the picture exported of photographing, image
The phenomenon that, it needs to generate composition frame according to the profile information of photographic subjects.Optionally, it is required according to photography, for example, only needing to shoot
The upper part of the body of personage then extracts the upper part of the body information of photographic subjects from profile information, and composition frame only includes the upper of photographic subjects
Half body information;If being required without special photography, usually presses and guarantee that the entire integrality of personage considers that composition frame is needed comprising bat
Take the photograph the entire profile information of target.
In addition, photographic subjects usually require the center for being placed on composition frame in order to protrude photographic subjects, promote shooting quality
Domain position.As a preferred embodiment, optionally it is also possible to consider photographies to require according to profile information, shooting mesh is obtained
Target external envelope frame;Using the center of the external envelope frame as the center of composition frame, then by preset photography the ratio of width to height obtain one it is complete
The rectangle frame of the whole external envelope frame comprising photographic subjects so obtains a more satisfactory composition frame, at least meets default
The composition frame of position composition rule and pre-set dimension composition rule.
The above-mentioned composition frame obtained according to the profile information of photographic subjects, referred to as initial composition frame.
It is described to accompany body judgment module 130, body is accompanied for judging to whether there is in the initial composition frame, it is described to accompany body for it
He can photographic subjects.
Body is accompanied to refer to that other similar with photographic subjects can photographic subjects.In order to promote the shooting quality of photographic subjects, need
Judge in initial composition frame in addition to photographic subjects, if there is also accompany body or accompany body a part (i.e. initial composition frame with accompany
Body exists overlapping).It may be there is no accompanying body in initial composition frame, or there are one to accompany body, or accompanies body there are multiple.
The composition frame output module 140, for when in the initial composition frame there is no accompany body when, by the initial structure
Picture frame is exported as target pattern frame.
It is described to accompany body judgment module 130, it is further used for judging whether to deposit when in the initial composition frame in the presence of body is accompanied
Accompany body that must also be used as photographic subjects at one.
Specifically, needing the influence for considering to accompany body when in initial composition frame in the presence of body is accompanied.It may be deposited in initial composition frame
Accompanied at one body or it is multiple accompany body, judgement each accompanies whether body must also be used as photographic subjects respectively, further according to each body of accompanying
Judging result, which is obtained, also must accompany body as photographic subjects with the presence or absence of one.Each accompany the judging means of body can be with are as follows: meter
The overlapping area for accompanying body Yu initial composition frame is calculated, if the overlapping area is greater than preset value, this accompanies body must be also as shooting
Target.Preferably, it calculates and each accompanies the overlapping area of body Yu initial composition frame, and calculate the area and account for the entire area for accompanying body
Ratio.When the ratio is greater than or equal to preset value, then this accompanies body that must also be used as photographic subjects;Otherwise, this accompanies body not make
For photographic subjects.
The composition frame generation module 120 is further used for existing in the initial composition frame and accompanies body, and all accompanies body
When all not as photographic subjects, regenerates and accompany body disturbance degree no more than current composition frame, and as target pattern frame
Output.
Body is accompanied specifically, existing in the initial composition frame, if all when accompanying body all not as photographic subjects, illustrate own
Accompany influence all very little of the body to initial composition frame.Such case can accompany body disturbance degree smaller than current composition frame by regenerating
Composition frame further promote shooting quality.Body disturbance degree is accompanied to reflect the influence for accompanying body to composition frame, for example, by accompanying body
Accounting for the overlapping area of composition frame or the overlapping area accompanies the ratio of body to judge.
In other instances, relatively initial composition frame possibly can not retrieve and accompany the smaller composition frame of body disturbance degree, but
It is smaller due to accompanying body to influence, practical photograph is avoided even exporting initial composition frame and can also cut by the photo after such as photographing
Exist in piece and accompanies body.Further, when there are it is a variety of accompany body disturbance degree smaller composition frame when, therefrom selection accompanies body disturbance degree most
Small composition frame is exported as target pattern frame.
It is described to accompany body judgment module 130, it is further used for working as existing in the initial composition frame and accompanies body, and at least has one
It is a accompany body must also as photographic subjects when, also body and the photographic subjects will must be accompanied to constitute new shooting as photographic subjects
Target, and target pattern frame is regenerated with new photographic subjects substitution photographic subjects.
Specifically, accompany body there are one in the initial composition frame, and when this is accompanied body also and must be incorporated into photographic subjects, this is accompanied
Body and photographic subjects combination, obtain new photographic subjects, replace photographic subjects with new photographic subjects, reacquire the wheel of photographic subjects
Wide information opens generation, the output process of new round target pattern frame.When accompanying body, and part there are multiple in initial composition frame
Or it is all when accompanying body must be as photographic subjects, also body and photographic subjects must be accompanied to combine as photographic subjects by all, obtained
To new photographic subjects, photographic subjects are replaced with new photographic subjects, restarts the generation of new round target pattern frame, exported
Journey.
The present embodiment adjusts photographic subjects by dynamic in the scene that personage is intensive, to adaptively realize that number is not true
Fixed, the uncertain composition of movement.Although the present embodiment is to be described with photographic subjects for personage, it is apparent that being also suitble to shooting
Target is that animal, plant or building etc. have the object of clear profile, so no longer repeating.
In another embodiment of the present invention, as shown in figure 3, a kind of automatic photography patterning apparatus 100, comprising:
Profile information obtains module 110, for obtaining the profile information of photographic subjects.
Composition frame generation module 120, for establishing the external envelope frame of photographic subjects according to the profile information;And root
Generate initial composition frame according to the external envelope frame, the initial composition frame includes the external envelope frame, and with the external envelope frame
Concentrically.
The profile information is human body profile information, and the human body contour outline information includes that the head frame of the photographic subjects is sat
Mark, body frame coordinate and each body joint point coordinate.The external envelope frame that photographic subjects are established according to the profile information includes: to take
The minimum value of the head frame coordinates of the photographic subjects, body frame coordinate and the x coordinate value in each body joint point coordinate is sat as left side x
Scale value;Take the maximum value conduct of the x coordinate value in head frame coordinate, body frame coordinate and each body joint point coordinate of the photographic subjects
The right x coordinate value;Take y-coordinate value in head frame coordinate, body frame coordinate and each body joint point coordinate of the photographic subjects most
Small value is used as following y-coordinate value;The y in head frame coordinate, body frame coordinate and each body joint point coordinate of the photographic subjects is taken to sit
The maximum value of scale value is as top y-coordinate value;According to the left side x coordinate value, the right x coordinate value, the following y-coordinate
Value and the top y-coordinate value obtain top left co-ordinate and bottom right angular coordinate, according to the top left co-ordinate and bottom right angular coordinate
Determine the external envelope frame of the photographic subjects;Or, being sat according to the left side x coordinate value, the right x coordinate value, the following y
Scale value and the top y-coordinate value obtain lower-left angular coordinate and upper right angular coordinate, are sat according to the lower-left angular coordinate and the upper right corner
Mark determines the external envelope frame of the photographic subjects.
Take the center of external envelope frame as the center of initial composition frame, then obtains a complete packet by preset photography the ratio of width to height
Rectangle frame (i.e. initial composition frame) containing the external envelope frame.
Preferably, according to the width of external envelope frame and height and preset photography the ratio of width to height, width accounting is calculated separately
With height accounting;Compare the size of width accounting and height accounting;When height accounting is greater than width accounting, according to external envelope frame
Height and described photography the ratio of width to height calculate the width of initial composition frame, and keep external envelope frame height it is constant, by external envelope frame
The symmetrical outreach of width arrive the width of initial composition frame, obtained rectangle frame is initial composition frame;When the height accounting is little
When the width accounting, the height of initial composition frame is calculated according to the width of external envelope frame and described photography the ratio of width to height, and protect
The width for holding external envelope frame is constant, and by the height of the symmetrical outreach of the height of external envelope frame to initial composition frame, obtained rectangle frame is
Initial composition frame.
Body judgment module 130 is accompanied, accompanies body for judging to whether there is in the initial composition frame, it is described to accompany body for other
Photographic subjects.
Composition frame output module 140, for when in the initial composition frame there is no accompany body when, by the initial composition frame
It is exported as target pattern frame.
It is described to accompany body judgment module 130, it is further used for judging institute when accompanying body there are one in the initial composition frame
It states and accompanies whether body must also be used as photographic subjects;When accompanying body there are at least two in the initial composition frame, judgement is every respectively
It is a to accompany whether body also be used as photographic subjects;Judging whether there is one accompanies body that must also be used as photographic subjects.
It each accompanies body whether must be also as follows as the judgment step of photographic subjects: being accompanied when existing in the initial composition frame
The overlapping area of body Yu the initial composition frame is accompanied when body, described in calculating, and is calculated the overlapping area and accounted for and described accompany the whole of body
The ratio of bulk area;Judge whether the ratio is greater than or equal to preset value;When the ratio is greater than or equal to preset value, institute
It states and accompanies body that must also be used as photographic subjects;It is described to accompany body not as photographic subjects when the ratio is less than preset value.
Specifically, when in initial composition frame there are it is multiple accompany body when, accompany body to judge respectively to each, which accompany body not as
Photographic subjects, which must also be used as photographic subjects.According to each judging result for accompanying body, judges whether there is one and accompany body must
Photographic subjects must be also used as.
Each accompany body judgment method be it is identical, are as follows: calculate and accompany the overlapping area of body Yu initial composition frame, and calculate this
Area accounts for the ratio for accompanying the entire area of body.When the ratio is greater than or equal to preset value, then this accompanies body must be also as shooting
Target;Otherwise, this accompanies body not as photographic subjects.
The composition frame generation module 120 is further used for existing in the initial composition frame and accompanies body, and all accompanies body
When all not as photographic subjects, the mobile initial composition frame accompanies the smallest composition frame of body disturbance degree as target pattern to obtain
Frame, and export the target pattern frame.
Accompany body specifically, existing in the initial composition frame, and all when accompanying body all not as photographic subjects, it is mobile primary or
Repeatedly initial composition frame regenerates several new composition frames, and selection accompanies body to influence from obtained new composition frame and initial composition frame
The smallest effective composition frame is spent to export as target pattern frame.Effective composition frame is the composition of the external envelope frame comprising photographic subjects
Frame.
One or more combination can be selected to attempt to translate initial composition frame from up, down, left and right four directions.Further
Ground can be moved up or down when the height of initial composition frame is greater than the height of external envelope frame.When initial composition frame
Width be greater than external envelope frame width when, can be moved to the left or right.Further, according to accompanying body and photographic subjects
Relative positional relationship select suitable moving direction, it is preferable that accompany the direction of body to move initial composition frame along this is removed.
Optionally, when only one accompanies body in initial composition frame, body is accompanied to be set as with reference to accompanying body this.When initial composition frame
Inside have multiple when accompanying body, selects one body is accompanied to be set as with reference to accompanying body.The direction of body is accompanied to move one by default stepping along reference is removed
Secondary initial composition frame obtains a new composition frame.Judge that the whether effective composition frame of new composition frame (completely includes photographic subjects
The composition frame of external envelope frame).If not effective composition frame, then exported initial composition frame as target pattern frame.If it is
Effective composition frame, then further calculate the new composition frame accompanies body disturbance degree, and accompanies body disturbance degree to carry out with initial composition frame
Compare.If accompanying body disturbance degree smaller, exported the new composition frame as target pattern frame.
By judging whether new composition frame is effective composition frame, it ensure that the target pattern frame of output must be effective composition
Frame is not in cut hand, cut situations such as foot.
Further, it by multiple continuous translation, obtains certain direction and accompanies the smallest effective composition frame of body disturbance degree, and made
For the output of target pattern frame.Specifically, for example, when only one accompanies body in initial composition frame, body is accompanied to be set as with reference to accompanying this
Body.When have in initial composition frame it is multiple accompany body when, select one body is accompanied to be set as with reference to accompanying body.Along remove with reference to accompany the direction of body by
The default mobile primary initial composition frame of stepping, obtains first new composition frame.When first new composition frame be effective composition frame, and
Body disturbance degree more hour is accompanied, then continues to move along former direction, obtains second new composition frame, judge accompanying for second new composition frame
Body disturbance degree and validity, are so repeated continuously, until the obtained new composition frame of n-th accompanies body disturbance degree greater than previous
Or the new composition frame of n-th be not effective composition frame.It is exported using N-1 new composition frames as target pattern frame.By above-mentioned
Mode accompanies the smallest effective composition frame of body disturbance degree on some available direction, further reduced the shadow for accompanying body disturbance degree
It rings, improves patterning quality.
Further, when in initial composition frame there are it is multiple accompany body when, select one to accompany body as with reference to accompanying body, along removing ginseng
It examines and the direction of body is accompanied persistently to move initial composition frame, accompany the smallest effective structure of body disturbance degree in this direction according to preceding method acquisition
Picture frame is denoted as a candidate composition frame;It selects another to accompany body as with reference to body is accompanied, repeats the above method, it is right to obtain another
The candidate composition frame answered;In this way, obtaining each candidate composition frame for accompanying body to remove direction, then therefrom selection accompanies body disturbance degree minimum
Candidate composition frame as target pattern frame export.
Assessment accompanies the factor of body disturbance degree to include composition frame and accompany the overlapping area of body, and/or have with composition frame overlapping
Accompany body quantity.
It is described to accompany body judgment module 130, it is further used for working as existing in the initial composition frame and accompanies body, and at least has one
It is a accompany body must also as photographic subjects when, also body and the photographic subjects will must be accompanied to constitute new shooting as photographic subjects
Target, and target pattern frame is regenerated with new photographic subjects substitution photographic subjects.
It should be noted that the automatic photography of the embodiment of automatic photography patterning apparatus provided by the invention and aforementioned offer
The embodiment of patterning process is based on same inventive concept, can obtain identical technical effect.Thus, the automatic photography structure
Other particular contents of the embodiment of map device are referred to the record of the embodiment content of aforementioned automatic photography patterning process.
In one embodiment of the invention, as shown in figure 4, a kind of electronic device 400, including memory 410 and processing
Device 420.The memory 410 is for storing computer program 430.The processor is realized such as when running the computer program
The automatic photography patterning process of foregoing description.
As an example, the step S100 according to foregoing description is realized when the processor 420 executes computer program
To S700.Additionally, the automatic photography patterning apparatus 100 of foregoing description is realized when the processor 420 executes computer program
In each module, the function of unit.As another example, the processor 420 realizes profile letter when executing computer program
Breath obtains module 110, composition frame generation module 120, the function of accompanying body judgment module 130 and composition frame output module 140.
Optionally, according to specific needs of the invention are completed, the computer program can be divided into one or more
Module/unit.Each module/unit can be the series of computation machine program instruction section that can complete specific function.The calculating
Machine program instruction section is for describing implementation procedure of the computer program in automatic photography patterning apparatus 100.As an example,
The computer program can be divided into modules/unit in virtual bench, and for example profile information obtains module, composition
Frame generation module accompanies body judgment module and composition frame output module.
The processor is used for by executing the computer program to realize automatic photography composition.As needed, institute
Stating processor can be central processing unit (CPU), graphics processing unit (GPU), digital signal processor (DSP), dedicated collection
At circuit (ASIC), field programmable gate array (FPGA), general processor or other logical devices etc..
The memory can be the internal storage unit and/or external storage that arbitrarily can be realized data, program storage
Equipment, for example, the memory can be plug-in type hard disk, intelligent memory card (SMC), secure digital (SD) card or flash card
Deng.The memory is used to store other programs and data of computer program, automatic photography patterning apparatus 100.
The electronic device 400 can be any computer equipment, such as desktop PC (desktop), portable
Computer (laptop), palm PC (PDA) or server (server) etc..As needed, the electronic device 400 can be with
Including input-output equipment, display equipment, network access equipment and bus 440 etc..The electronic device 400 can also be monolithic
Machine, or it is integrated with the calculating equipment of central processing unit (CPU) and graphics processing unit (GPU).
It for realizing the unit of corresponding function, the division of module is it will be appreciated by persons skilled in the art that above-mentioned
Said units, module are further divided or combined, i.e., according to application demand in convenient explanation, the purpose of narration
Device/equipment internal structure is re-started into division, combination, with the function of the above-mentioned record of realization.In above-described embodiment
Individual physical unit can be respectively adopted in each unit, module, two or more units, module can also be integrated
In a physical unit.Each unit, module in above-described embodiment can be using the realizations of hardware and/or SFU software functional unit
Corresponding function.Between multiple units, component, module in above-described embodiment can with direct-coupling, INDIRECT COUPLING or communication
Connection can be realized by bus or interface;Coupling, connection between multiple units or device can be electrical, mechanical
Or similar mode.Correspondingly, each unit in above-described embodiment, the specific name of module also only to facilitate narration and
It distinguishes, and does not have to the protection scope of limitation the application.
In one embodiment of the invention, a kind of computer readable storage medium is stored thereon with computer program, institute
The automatic photography patterning process recorded such as previous embodiment can be realized by stating when computer program is executed by processor.It that is to say, when
Some or all of technical solution that the aforementioned embodiment of the present invention contributes to the prior art passes through computer software product
When mode emerges from, aforementioned computer software product is stored in a computer readable storage medium.The computer can
Read storage medium can be any portable computers program code entity apparatus or equipment, such as USB flash disk, mobile disk, magnetic disk,
CD, computer storage, read-only memory, RAM etc..
In one embodiment of the invention, as shown in figure 5, a kind of Automatic Photographic Equipment 500, comprising:
Automatic photography patterning apparatus 100 described in aforementioned any embodiment, for exporting target pattern frame.
Photographic unit 502, for executing photographing actions when receiving the target pattern frame.The photographic unit 502
For optical imagery shooting to be fixed on corresponding storage medium.Optionally, the photographic unit 502 can be digital phase
Machine is stored so as to which optical imagery is converted to data.The shooting units such as the photographic unit 502 can be this field skill
Art personnel can be known technology.
It should be noted that above-described embodiment can be freely combined as needed.The above is only of the invention preferred
Embodiment, it is noted that for those skilled in the art, in the premise for not departing from the principle of the invention
Under, several improvements and modifications can also be made, these modifications and embellishments should also be considered as the scope of protection of the present invention.