Annealing algorithm for non-rectangular shaped stained glass collages

Information

  • Patent Application
  • 20080075390
  • Publication Number
    20080075390
  • Date Filed
    September 22, 2006
    17 years ago
  • Date Published
    March 27, 2008
    16 years ago
Abstract
The present invention relates to a method to make effective use of non rectangular display space for displaying a collage. In an embodiment of the invention, a heterogeneous set of images can be arranged to display the region of interest of the images to avoid overlapping regions of interest. The background gaps between the regions of interest can be filled by extending the regions of interest using a Voronoi technique. This produces a stained glass effect for the collage. In an embodiment of the present invention, the technique can be applied to irregular shapes including circular shapes with a hole in the middle. In an embodiment of the present invention, the technique can be used to print labels for disks.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred embodiments of the present invention will be described in detail based on the following figures, wherein:



FIG. 1 shows a StainedGlass collage created from the images in FIG. 2;



FIG. 2 shows a set of images and their germs;



FIG. 3 shows an example of irregular shaped areas;



FIG. 4 shows Labelflash® sample;



FIG. 5 shows flowchart for basic algorithm;



FIG. 6 shows variation with timeline.



FIG. 7 shows final result with 4 germs;



FIG. 8 shows (A) early state and (B) final result with 12 elliptical germs;



FIG. 9 shows final result with 20 elliptic germs kept in a row-wise order indicated by the numbers (4 rows with 5 germs each).





DETAILED DESCRIPTION

Previously, StainedGlass was used only with rectangular shaped collages. However, sometimes it is desirable to have irregular shaped StainedGlass collages. This allows users to be more expressive. There are also specific applications where it is desirable to create a collage to fit a region that is not rectangular.


Once the input (images) and output (irregular shaped area) have been specified, a StainedGlass collage can be calculated using an annealing approach. In various embodiment of the present invention, a germ can be the central object in an image. A germ can be closely related to the ROI detected in the image. In an embodiment of the present invention, the germ can be the dominant ROI. In an embodiment, the germ can also be the largest ROI. After the germs are laid out, the empty areas can be filled using a Voronoi algorithm. The basic algorithm is illustrated in FIG. 5. The images are first input at step 510. Next the germ and support are computed for each image (steps 520 and 530 respectively). The germs can be placed on the irregular (or otherwise) shaped area (step 540). The germs can be moved according to the annealing algorithm (step 550). Based on the new positions of the germs, it can be determined if the stopping conditions have been met (step 560). If the stopping conditions have not been met, then the algorithm returns to step 550 and another germ can be moved accordingly. If the stopping condition is met, then the germs can be scaled (step 570). Finally, the empty spaces between the germs can be filled in using the Voronoi algorithm (step 580).



FIG. 7 and FIG. 8 illustrate results of the algorithm applied to the ring of a DVD using circular germs. While the illustrations use circular or elliptic germs and areas, other shapes can be used. In embodiments of the present invention, the distance computations have to be adapted to the different shapes.


Input Images

The input can be a set of images. For photos, these can be a small subset of favorite pictures from a collection or a selected subset of pictures to illustrate an event. For videos, the images can be keyframes extracted from the video, and a small subset can be selected manually by the user or automatically via content analysis algorithms (e.g. U.S. Pat. No. 6,819,795; Chiu, P., Girgensohn, A., Polak, W., Rieffel, E., Wilcox, L., Bennett, F. (2000). A genetic segmentation algorithm for image data streams and video. Proceedings of GECCO '00, pp. 666-673).


Compute Germ and Support for Each Image

For each image, the germ and support are computed using a previously described algorithm. U.S. patent application Ser. No. 10/815,389; U.S. patent application Ser. No. 10/815,354; U.S. patent application Ser. No. 10/948,730; U.S. patent application Ser. No. 10/948,823; Chiu, P., Girgensohn, A., and Liu, Q. (2004). Stained-Glass Visualization for Highly Condensed Video Summaries. Proc. IEEE Intl. Conf. on Multimedia and Expo (ICME '04). A germ can be closely related to the regions of interest (ROI) detected in the image. In an embodiment of the present invention, the germ can be the dominant ROI. In an embodiment, the germ can also be the largest ROI. See FIG. 2. A support can be the image pixels outside the germ. In theory the support can extend beyond the image, e.g. using panorama construction techniques to fuse adjacent photos or keyframes that overlap.


Let {gi|0≦i≦N} denote the set of N germs, and {ci|0≦i≦N} denote their centroids


Initialize Placement of Germs in Target Area

In an embodiment of the present invention, the initial germ positions {ri} can be randomly chosen. To improve the positions so that they are more spread out, an estimate of the expected distance can be calculated using E=√(target area/N), where N is the number of images. After the ri has been assigned, ri+1 can be determined by selecting random points until a point is greater in distance than E/2 to any other point, or until a condition of M selections is met (e.g. M=100).


The germs can be assigned arbitrarily to the positions. To improve the fit between large germs and the sparser points, the largest germ can be assigned to the point farthest from any other point, the next largest germ to the next point farthest from any other point, and so on.


In an embodiment of the present invention, if the images are in a sequence and it is desirable to reward keeping adjacent images nearby, the germs can be assigned to the positions {ri} in an orderly manner. For example, this can be done inductively: put germ g0 at the position with minimum y-coordinate; after germ gn has been placed, take all the positions with y-coordinates above the bottom of gn, then from these take the position with minimum x-coordinate for placing gn+1.


Alternatively, the germs can be placed in order initially by dividing the rectangular bounding box of the irregular area into a number of rows (e.g., equal to the square root of the number of germs), allowing the starting positions of the germs to be outside the irregular area. Roughly the same number of germs are placed in each row such that the distances between germs can be maximized. When a germ is outside the irregular area, the distance measure to the border returns negative values for those germs, indicating that those germs need to be moved larger distances. Our experiments show that this works well for the donut shaped area. FIG. 9 shows the results of keeping 20 elliptic germs in their original order.


Germs are scaled uniformly such that their total area can be a large fraction of the irregular area (e.g., 70%). Especially with a few germs, the uniform scale factor may need to be selected such that the largest germ can fit inside the irregular area (see FIG. 7). Germs can be scaled again at the end of the annealing algorithm, so approximate scaling is sufficient at the initial scaling point. In the annealing algorithm, the size of the germs contributes to distance computations but germ overlaps are not considered in the annealing algorithm.


Move Germs According to Annealing Algorithm

In an embodiment of the present invention, at each stage tε{0, 1, 2, . . . } a move for one or more germs can be computed. A germ to be moved can be selected randomly or alternatively as the germ that needs to be moved the largest distance. The random function for selecting a germ can also take the distance that the germ needs to be moved into consideration, so that germs close to other germs are more likely to be selected


The moves are done one germ at a time. The alternative of computing all the moves simultaneously does not offer any significant advantages.


The movement of germ gi can be computed as a translation vector vi=(xi, yi) in the following way. First, for a germ gi find the nearest point p1 to the boundary of gi, such that p1 can be either on a germ boundary (excluding the i-th germ) or on the boundary of the irregular area.


To simplify the computation of p1, we can constrain a candidate point s so that s can be on a line segment between ci and either another centroid, or between ci and a boundary point of the irregular area. Constraining candidate points to the line segment between two centroids can result in an overlap because the distance between shapes can be overestimated.


Next, find a point p2 such that it is the intersection of the line from ci to p1 and a boundary of gi. The idea is to move away from the nearest point to some fraction of the estimated expected distance, plus a perturbation by a random vector that diminishes as the annealing progresses. More precisely, we can take vi as defined in equation 1.










v
i

=



τ


(
t
)




(

E
-

(






c
i



p
1


_



-





c
i



p
2


_




)


)






c
i



p
1


_






c
i



p
1


_





+


δ


(
t
)



D
*

w
i







equation






(
1
)








This determines the unity vector pointing from ci towards p1 and moves gi such that the distance between ci and p1 would be E. The germ can be moved by more than the distance E if it overlaps another germ or is partially outside the irregular area. The move can be dampened by τ(t), a dampening function such as 1/(1+t/10). The move can be perturbed by a random vector, where D is the longest dimension of the bounding box of the irregular area and δ(t) is the annealing cooling schedule function given by equation 2, in which α is the annealing parameter that can be tuned for the specific application, and where wi is a random vector whose x and y components are drawn from the interval [−1.0, 1.0].





δ(t)=exp(−αt)   equation (2)


The proper selection of E can be important for the algorithm. If E is chosen too small, part of the irregular area might remain uncovered. In contrast, a large E does not have a lasting negative effect, but might delay convergence until the move is sufficiently dampened. Different values of E for other germs and for boundaries of the irregular area can improve performance. The vector vi indicates the desired position for a germ at the next iteration. If this vector is very long, the system might get into an undesirable state. Thus, in practice it can be better to set a maximum move distance and to potentially move the same germ several times in a row.


For each i, vi can be repeatedly constructed as necessary until it satisfies the criteria that the new center (ci+vi) is in the interior of the irregular shape. A stopping condition limits the number of times vi is computed (e.g. i=100); if none of the vi is satisfactory, the germ is not moved.


Stopping Condition Criteria

The criteria or stopping condition that ends this repeated process can be when the maximum length attainable by the vi is sufficiently small (e.g. less than a pixel), or after the maximum number of stages (e.g. t=100).


Scale Germs and Images

Once the positions of the germs have been determined, the scale factor for the images can be computed by taking the largest scale factor without the germs intersecting themselves or the irregular shaped boundary. Better collages can result if a small amount of intersection is allowed (e.g. 20%).


Fill in Empty Spaces with Supports using Voronoi Algorithm

The empty spaces consist of the pixels in the irregular area outside of the germs. The Voronoi algorithm assigns to a pixel the value from its nearest germ's support. If the pixel is in the irregular area but outside the germ supports, it is assigned the background color. The resulting collage will consist of non-rectangular images. The boundaries between images will look similar to FIG. 1.


Variation: Multiple Iterations

Depending on the application domain and the irregularity of the areas, the algorithm can be run several times, and then the best result can be chosen. The best result may be characterized by the smallest total empty area after the scaling and/or after the scaling and filling operations.


Variation: Maintaining Proximity

For video keyframes, images can be ordered by time and it can be desirable to maintain proximity of adjacent keyframes. This can also be the case for photos when several shots are taken in sequence of some incident that happened at an event.


To reduce the chance that germs would drift too far, an iteration can first be performed using the annealing algorithm on the initial random locations {ri}, with the distance function defined by the point distance between each pair of locations. This will move the initial locations to more stable places. Then germ centroids can be assigned to {ri} and the algorithm can proceed as before, but limiting the movement of germs at each step.


Variation: Radial Timeline Layout for Disks

A radial layout can be produced that reflects the time position of a keyframe in a video. A timeline ring can be placed around the rim of the disk. See FIG. 6. In an embodiment of the present invention, the ring can be placed along an outer ring or an inner ring. In an alternative embodiment of the present invention, the timeline ring can spiral around the disk.


Initially, the random locations are computed and stabilized by performing the annealing algorithm on the random locations as above. Each random location can be calculated in polar coordinates, where the location can be associated with a time based on its angular coordinate. Starting with the first keyframe and progressing in temporal order, each keyframe germ centroid can be assigned to the random location nearest to the keyframe's time.


Variation: User Specified Parameters

To make the StainedGlass more customizable, the user interface may provide a widget for the user to enter the parameters. For example, the user can specify the scales of the images for selected photos. The user can also affect how much proximity can be maintained by specifying the amount of initial energy that determines the length of the random vectors used in the annealing process. For advanced users, it can be desirable to expose all the parameters in the user interface to give the user more control.


StainedGlass differs from SureThing CD/DVD Labeler Deluxe. In SureThing, the rectangular grid is cropped when a donut shaped disk label is printed. Aesthetically, this can be less pleasing as a collage. Also, SureThing is liable to cut out important parts of images. StainedGlass is also significantly different from Photo Montage where the seams between images are minimized, whereas with StainedGlass the seams are highly visible to frame and delineate the individual images that make up the collage. Xerox's (Veneble) program differs from this invention in a number of respects including that it lays out whole images (not germs), all the objects are rectangles, and overlaps are not allowed. ‘Kandinsky’ is solving a different problem than the present invention. Kadinsky is more about template matching than laying out images in an empty target area. Picasa has no feature for making collages on irregular shapes (e.g., disk labels).


The foregoing description of preferred embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.


Various embodiments of the invention may be implemented using a processor(s) programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art. The invention may also be implemented by the preparation of integrated circuits and/or by interconnecting an appropriate network of component circuits, as will be readily apparent to those skilled in the art.


Various embodiments include a computer program product which can be a storage medium (media) having instructions and/or information stored thereon/in which can be used to program a general purpose or specialized computing processor(s)/device(s) to perform any of the features presented herein. The storage medium can include, but is not limited to, one or more of the following: any type of physical media including floppy disks, optical discs, DVDs, CD-ROMs, micro drives, magneto-optical disks, holographic storage devices, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, PRAMS, VRAMs, flash memory devices, magnetic or optical cards, nano-systems (including molecular memory ICs); paper or paper-based media; and any type of media or device suitable for storing instructions and/or information. Various embodiments include a computer program product that can be transmitted in whole or in parts and over one or more public and/or private networks wherein the transmission includes instructions and/or information, which can be used by one or more processors to perform any of the features, presented herein. In various embodiments, the transmission may include a plurality of separate transmissions.


Stored on one or more computer readable media, the present disclosure includes software for controlling the hardware of the processor(s), and for enabling the computer(s) and/or processor(s) to interact with a human user or other device utilizing the results of the present invention. Such software may include, but is not limited to, device drivers, interface drivers, operating systems, execution environments/containers, user interfaces and applications.


The execution of code can be direct or indirect. The code can include compiled, interpreted and other types of languages. Unless otherwise limited by claim language, the execution and/or transmission of code and/or code segments for a function can include invocations or calls to other software or devices, local or remote, to do the function. The invocations or calls can include invocations or calls to library modules, device drivers, interface drivers and remote software to do the function. The invocations or calls can include invocations or calls in distributed and client/server systems.

Claims
  • 1. A method of displaying a plurality of N images on a non rectangular target area comprising: (a) determining a germ for each of the plurality of images;(b) assigning an initial position for the plurality of germs;(c) calculating a translation vector for one or more of the plurality of germs;(d) moving one or more of the plurality of germs according to the translation vector; and(e) repeating steps (c) and (d) until a stopping condition criteria is met.
  • 2. The method of claim 1, wherein the images are selected from a set of photos.
  • 3. The method of claim 1, wherein the images are selected from a set of video keyframes.
  • 4. The method of claim 1, wherein the target area is an irregular shape.
  • 5. The method of claim 1, wherein the target area is circular.
  • 6. The method of claim 5, further comprising a radial time line.
  • 7. The method of claim 5, wherein the target area has a hole in the middle.
  • 8. The method of claim 7, further comprising printing the plurality of images as a disk label.
  • 9. The method of claim 7, further comprising placing a central germ in the hole.
  • 10. The method of claim 1, where in step (b) the initial position of the germs is randomly assigned further comprising: (f) selecting a random N+1 point to represent the position of one of the plurality of germs; and(g) repeating step (f) until an initial criteria is met.
  • 11. The method of claim 10, where in step (g) the initial criteria is met after a set number of selections.
  • 12. The method of claim 10, where in step (g) the initial criteria is met when a point representing the centroid of a germ is greater in distance than E/2 to any other point representing the centroids of the plurality of germs, where E is the expected distance between points on the target area.
  • 13. The method of claim 1, wherein the initial position of the germs in step (b) is assigned based on the size of the germs, wherein the largest germ is assigned to the point farthest from any other point and the next largest germ to the next point farthest from any other.
  • 14. The method of claim 1, wherein the initial position of the germs in step (b) is assigned based on a sequence associated with the images.
  • 15. The method of claim 1, wherein prior to step (c) the germs are scaled uniformly.
  • 16. The method of claim 1, wherein the one or more germ to be moved can be randomly selected.
  • 17. The method of claim 1, where in the one or more germ to be moved can be selected based on the distance each germ needs to be moved, wherein the germ with the greatest distance to be moved is selected.
  • 18. The method of claim 1, where in step (c) the translation vector is defined by an annealing algorithm.
  • 19. The method of claim 18, wherein the annealing algorithm includes one or both of a dampening factor and a perturbation factor.
  • 20. The method of claim 1, where in step (a) a support is selected for each of the plurality of images, the method further comprising: assigning pixels to empty space based on the support for each of the plurality of images.
  • 21. The method of claim 20, wherein the plurality of germs are scaled prior to filling the empty space.
  • 22. The method of claim 20, wherein the empty space is defined by a Voronoi algorithm.
  • 22. A system of displaying a plurality of N images on a target area, wherein the system comprises: (a) means for determining a germ and a support for each of the plurality of images;(b) means for assigning an initial position for the plurality of germs;(c) means for calculating a translation vector for one or more of the plurality of germs;(d) means for moving one or more of the plurality of germs according to the translation vector;(e) repeating steps (c) and (d) until a stopping condition criteria is met;(f) means for scaling the plurality of germs; and(g) means for assigning pixels to empty space based on the plurality of supports.
CROSS REFERENCES TO RELATED APPLICATION

This application is related to the following applications: (1) application Ser. No. 10/815,389 entitled “Extracting Video Regions of Interest” by Patrick Chiu, et al., Attorney Docket No. FXPL-01093US0 MCF, filed Mar. 31, 2004; (2) application Ser. No. 10/815,354 entitled “Generating a highly Condensed Visual Summary” by Patrick Chiu, et al., Attorney Docket No. FXPL-01094US0 MCF filed Mar. 31, 2004; (3) application Ser. No. 10/948,730 entitled “Determining Regions of Interest in Photographs and Images” by Patrick Chiu, et al., Attorney Docket No. FXPL-01104US0 MCF filed Sep. 23, 2004; (4) application Ser. No. 10/948,823 entitled “Determining Regions of Interest in Photographs and Images” by Patrick Chiu, et al., Attorney Docket No. FXPL-01107US0 MCF filed Sep. 23, 2004; and (5) application Ser. No. 11/405,311 entitled “Cascading Cluster Collages: Visualization of Image Search Results on Small Displays” by Patrick Chiu et al., Attorney Docket No. FXPL-01117US0 MCF/AGC, filed Apr. 17, 2006, which are all expressly incorporated in their entireties herein by reference.