Automatic layout algorithms simplify the composition of image-rich documents, but they still require users to have sufficient artistry to supply well cropped and composed imagery. There is an increasing need to enable users that are not skilled at populating a document to generate a composition in which the content is laid out well and is aesthetically pleasing.
An example of a space to be populated is a page of a newsletter. The content with which the page has to be populated may include textual subject-matter, photographs, and graphics. A user may have a particular layout of the content in mind and can with known systems select a document template that closely matches the intended layout and can allocate the content to the template. A problem with this relatively simple system is that a template imposes constraints on where the content can be placed and what size region in the template is available for the content. Therefore, the user is required to edit the content to fit within the space even though an allocated space is not necessarily an appropriate size to display the subject-matter of the content. This known approach focuses on the final layout of the document with little regard for the subject-matter of the content.
Another approach focuses on the subject-matter of the content and edits or crops the content so as to display the subject-matter in the best way. The edited content is then allocated to a space. The problem with this approach is that the space has a defined size and shape and it may not be possible to arrange the content so that the layout is aesthetically pleasing, for example without leaving unsightly blank regions of the space.
The present invention seeks to provide an improved method and system of populating space.
The present invention provides a method of populating a space with a plurality of child elements at least one of which having variable size or shape, the method comprising: determining for each child element a permissible range of internal layouts dependent on the content of the child element; generating a first set of allocations of the child elements in the space, each first allocation being a layout of child elements which occupies less than the total amount of space to be populated; generating a second set of allocations of the child elements by expanding the child elements allocated in each of the first allocations within the permissible range of internal layouts of the child elements such that at least some of the child elements occupy a greater amount of space in the second allocation than the first allocation.
The present invention also provides a computer usable storage medium having instructions embodied therein that when executed cause a computer system to perform a method of populating a space with a plurality of child elements having variable size or shape, the method comprising: determining for each child element a permissible range of internal layouts dependent on the content of the child element; generating a first set of allocations of the child elements in the space, each first allocation being a layout of child elements which occupies less than the total amount of space to be populated; generating a second set of allocations of the child elements by expanding the child elements allocated in each of the first allocations within the permissible range of internal layouts of the child elements such that the child elements occupy a greater amount of space in the second allocation than the first allocation.
Other preferred and/or optional features of the invention are defined in the accompanying claims.
In order that the present invention may be well understood, an embodiment thereof, which is given by way of example only, will now be described with reference to the accompanying drawings, in which:
Referring to
The illustrated embodiment allocates dimensions and locations to each of the child elements to generate a resulting layout which meets desired design characteristics. An example of such a characteristic is the extent to which the resultant layout fills the space available for population. An alternative characteristic may be an index of composition balance, or other such index.
Four child elements are shown in
In the method, the first child element 14 is retrieved at step 22 from a store 20 of child elements. A region of interest (ROI) is determined at step 24 for the child element 14 and in this example face detection supplies the ROI 16, ignoring background 18. A face detection algorithm is run over the retrieved image to determine the location of all faces in all orientations, and the combination of all the face locations is taken to be the ROI. In other examples as discussed in relation to
Multiple ROIs may be nested such that they indicate progressive degrees of cropping. Similarly in the case of child elements that are themselves layouts of grandchildren, ROIs may encapsulate a progressive reveal operation for an element for example that reveals a blog update at its tightest constraint, and progressively exposes comments on that update as the constraints are relaxed. The term ROI refers to the general concept of a restricted portion of the content of a child regardless of whether the child is an image or other content type. The term crop refers to the selection of a restricted portion of the content of a child element.
If the ROI for an element has already been determined, step 24 may simply involve retrieval of information relating to the predetermined ROI, for example by retrieving ROI metadata associated with the image.
At step 28, a permissible range of internal layouts is determined dependent on the content of the child element 14. In this embodiment, the permissible range extends between the full image and the minimum width and height of the image which contains the ROI 16. The permissible variables for cropping the image are a vertical range extending between the horizontal internal layout lines 28 (shown in broken lines) and the horizontal edges of the image (shown in bold lines) and a horizontal range extending between the vertical internal layout lines 30 (shown in broken lines) and the vertical edges of the image (shown in bold lines). Step 28 provides a plurality of different rectangular crops of varying size and aspect ratio within the permissible values of the internal layout. The permissible values of the internal layout are not restricting to a range of rectangular crops and can be any other shape as required, such as curvilinear, polygonal or irregular. However, rectangular crops are discussed herein for simplicity.
At step 32, it is determined if all child elements required for populating a space have been retrieved from store 20. If NO is returned, the method steps 22, 24 and 28 are repeated.
A second child element 34 is shown in
Third and fourth child elements 42, 43 are shown in
A space 10 is shown in
The columnar layout of the space comprises constraints on the population of the page. The constraints in
At step 62, the external layout variables or constraints are retrieved from a layout engine 61 for the space 10. A first set of allocations 64a, 64b, . . . , 64n of the child elements are generated for allocating the child elements to the space. Each first allocation is a layout of child elements which occupies less than the total amount of space to be populated. One first allocation of child elements is shown in
In the embodiment described, in each of the first allocations 64a, 64b, . . . , 64n the child elements comply with the external layout constraints such as requiring child elements to have a width that spans exactly an integer number of columns, and the child elements occupy a minimum amount of space within the permissible range of internal layouts. Minimizing the space allocated to the child elements maximizes the number of possible first allocations available. With reference to
Whilst maximised cropping is shown in
The child elements 34, 42 and 43 are allocated in the first allocation 64a in the same way as child element 14 is allocated. Therefore, second child element is bound by its internal horizontal lines 38 and spans exactly one column between central line 60 and left margin 56. The third child element 42 spans exactly two columns between left and right margins 56, 58 and is bound by its internal horizontal lines 48, 48. The fourth child element 43 spans the width of the column between the central line 60 and the right margin 58 and is bound by its internal horizontal lines 48, 48.
The first allocation 64a occupies less than the total space available and leaves blank spaces 66 which are not occupied by child elements. It will be appreciated that multiple alternative layouts of the elements is possible in additional first allocations 64b to 64n, for example, the child elements 14, 34 could be arranged side-by-side with element 14 on the left, side-by-side with the element 34 of the left, or one above the other with each spanning two columns.
At the next stage of the process, the system generates a second set of allocations 68a, 68b, 68n of the child elements by expanding the child elements allocated in each of the first allocations within the permissible range of internal layouts of the child elements such that the child elements occupy a greater amount of space in the second allocation than the first allocation. The second allocation 68a corresponding to first allocation 64a is shown in
The purpose of the second allocations is to expand the child elements (to relax the constraints to reveal more of the original image) from their allocations in respective first allocations so that more of the available region of the space is occupied than in the first allocation, In the embodiment, the child elements are constrained in one dimension so that they comply with at least one variable of the external layout. Therefore, in the second allocation, the child elements are expanded in one or more different dimensions so that they comply more closely with one or more other variables of the external layout. In
Each element may be expanded by a different amount with the object of filling the available space. As shown in
In a modification, the external layout may define a space between columns which is to be left blank in a final display. If there are multiple elements overlapping a particular column of the minimised layout, the expansion process should find an appropriate way to share out the adjustments to the aspect ratios of the individual elements. For example if the two images in your first figure where laid out one above the other, one or both could be expanded to fill the available height. One strategy might be to expand the two elements in such a manner as to equalize the percentage of the total original area cropped from each. Another strategy might be to expand them to equalise the total facial area of each image, or even to minimize the facial scale difference between the two images.
At step 74 of
Although it is generally appropriate to return the best ranked layout to the user in the first instance as the best ranked layout has the highest probability of satisfying the user's requirements, the system allows the user to reject a returned layout and to request another layout. In this case, the system will return another layout based on a different second allocation. This arrangement is useful because a user's requirements are to some degree subjective and the mathematically best layout may not meet the user's subjective requirements.
It will be appreciated from the foregoing that the illustrated embodiment comprises a two stage allocation process. A first allocation maximally constrains a child element, for example so that each child takes the least possible area of the space available for population. However, the first allocation will typically not meet the required design criteria, leaving unsightly blank white spaces.
The second stage allocation is a step in which the constraints on the child elements are relaxed within the range defined by its determined internal layout until the external layout requirements are optimally addressed. For example, the child elements may be allowed increasing area to meet coverage requirements, or alternatively the child elements may be sized differently to meet aesthetic balance requirements.
The embodiment is advantageous because a space can be populated in many different ways and child elements can be displayed in many different ways. Determining the location and dimensions of a child element in the space is computationally complex and the embodiment simplifies the computation while the expansion step increases the potential of generating a pleasing display. In the case of a columnar layout, the first allocation of child elements arranges each element so that it completely fills a column. Allowing an element to completely fill a column removes one variable from the calculation in that width is always maximised within the constraints of the layout engine. The first allocation minimises element height allowing a greater number of possible first allocations that are feasible. The second allocation finds optimal crops of the element within the constraints of the layout engine and the available space without having to re-evaluate alternative relative locations for all the child elements.