1. Field of the Invention
The present invention relates to image processing device, method and program and, more particularly, relates to image processing device, method and program allowing to obtain a photo-mosaic image of higher quality.
2. Description of the Related Art
Nowadays, the number of users who take many photographs is being more and more increased owing to spreading use of digital still cameras. In addition, a method of effectively exhibiting a large number of photographs taken is now being sought for.
As a method of effectively exhibiting a photograph taken, a method of exhibiting a photograph in the form of a photo-mosaic image is proposed. The photo-mosaic image is an image which is obtained by dividing one target image (hereinafter referred to as one production target image (one target image to be produced)) into a plurality of rectangular blocks and replacing the respective blocks by other different images (hereinafter, referred to as replacement images) whose colors are similar to those of the blocks.
Thus, if the photo-mosaic image is observed at a distance, a subject (a photographic subject) which is the same as that on the production target image will be observed with the eyes of an observer. However, if the photo-mosaic image is observed close at hand, the subject will be observed in the form of a plurality of different replacement images which are arrayed.
As a technique for generating a photo-mosaic image as described above, a technique for selecting each image to be arranged in each block by obtaining a distance between a representative value of a color of each block of a production target image and a representative value of a color of each image as a candidate for a replacement image by a calculation with weighting is proposed (see, for example, Japanese Unexamined Patent Application Publication No. 2000-298722). In addition, a technique for partitioning a production target image into partition regions constituted of a plurality of blocks in accordance with color approximation and classifying candidates for a replacement images so as to belong to respective classes corresponding to the partition regions, thereby generating a photo-mosaic image using the candidate which belongs to the corresponding class per partition region is proposed (see, for example, Japanese Unexamined Patent Application Publication No. 2005-100120).
Further, a method of more finely dividing blocks of a production target image into pieces and collating the more finely divided piece with an image to be used as a candidate for a replacement image, thereby generating a photo-mosaic image while maintaining the color distribution of the original production target image is proposed (see, for example, Japanese Unexamined Patent Application Publication No. 11-341266).
Still further, a method of clipping a previously determined region of an image after a template which is prepared in advance and using a clipped image obtained by clipping the region as a candidate for a replacement image to be allocated to each block, thereby generating a photo-mosaic image is proposed (see, for example, Japanese Unexamined Patent Application Publication No. 11-345311). In the above mentioned method, in the case that an image which has been so inappropriately clipped as to degrade the quality of the photo-mosaic image, that is, the appearance of the photo-mosaic image, for example, in the case that only a half of the region of the face of a person on an image has been clipped, the inappropriately clipped image is manually or automatically excluded from the candidates for the replacement image.