Abstract: Disclosed is a system and method for identifying a hairstyle of a person. The system and method may enable determining and identifying hairstyles in a collection of colored face images. The system and method may enable utilizing agglomerative clustering for the determination and the identification of the hairstyles. The system and method may enable determining of hair, background and face-skin probability-masks for each hairstyle. The system and method may further enable identifying the hairstyle using probability-masks based density estimates.
DESC:FORM 2
THE PATENTS ACT, 1970
(39 of 1970)
&
THE PATENT RULES, 2003
COMPLETE SPECIFICATION
(See Section 10 and Rule 13)
Title of invention:
SYSTEM AND METHOD FOR IDENTIFYING A HAIRSTYLE OF A PERSON
APPLICANT:
Tata Consultancy Services Limited
A company Incorporated in India under the Companies Act, 1956
Having address:
Nirmal Building, 9th floor,
Nariman point, Mumbai 400021,
Maharashtra, India
The following specification describes the invention and the manner in which it is to be performed.
PRIORITY INFORMATION
[001] This patent application claims priority to Indian Provisional Patent Application No. 3955/MUM/2013, filed on December 18, 2013, the entirety of which is hereby incorporated by reference.
TECHNICAL FIELD
[002] The present disclosure described herein, in general, relates to image processing and more particularly to a system and method for identifying a hairstyle of a person.
BACKGROUND
[003] Hairstyle is an important characteristic of an individual in the fashion domain. Classification of people based on hairstyles may be useful for recommendation of apparel and accessories. There have been efforts made in the past in order to detect hair and thereby perform analysis on the detected hair. In one of the methods proposed in research paper titled “Automatic hair detection in the wild.” by P. Julian et al., hair-region in an image is detected using statistical hair shape-model representing the upper hair-part. Further, Yacoob and Davis have proposed a hair color model for detection of the hair. Additionally, Lee et al. have used learnt probability maps from the manually created hair templates for a few predefined hairstyle classes for identifying the hair-location in Markov Random Field framework. It is observed that hair shape models have been used as an important cue for the hair detection in most of the existing methods. However, these methods tend to assume manually created predefined hairstyle classes for the identification of a hairstyle of the person.
SUMMARY
[004] Before the present systems and methods, are described, it is to be understood that this disclosure is not limited to the particular systems, and methodologies described, as there can be multiple possible embodiments which are not expressly illustrated in the present disclosure. It is also to be understood that the terminology used in the description is for the purpose of describing the particular versions or embodiments only, and is not intended to limit the scope of the present application. This summary is provided to introduce concepts related to systems and methods for identifying a hairstyle of a person, and the concepts are further described below in the detailed description. This summary is not intended to identify essential features of the disclosure nor is it intended for use in determining or limiting the scope of the disclosure.
[005] In one implementation, a method for identifying a hairstyle of a person is disclosed. In one aspect, the method may comprise receiving a plurality of images. The method may further comprise detecting eyes co-ordinates associated with each image. The eyes co-ordinates may be detected based upon eyes and a face region associated with each image. Further, the method may comprise identifying hair region in each image by converting each image into a binary image. The binary image comprises zero-intensity pixels and non-zero intensity pixels. The zero-intensity pixels may represent the hair region. The method may further comprise clustering each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image. The method may further comprise assigning a probability to each pixel corresponding to each binary image present in a cluster. In an embodiment, the probability may be assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster. Further, the method may comprise generating a probability mask, indicating a hairstyle-template, corresponding to each cluster. The probability mask may be generated based upon the probability assigned to each pixel. Furthermore, the method may comprise receiving an input image corresponding to a person. The method may comprise comparing the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image. In one embodiment, a hairstyle belonging to the probability mask matched indicates the hairstyle of the person. In this implementation, the aforementioned method may be performed by a processor using a set of instructions stored in a memory.
[006] In another implementation, a system for identifying a hairstyle of a person is disclosed. In one aspect, the system may comprise a processor and a memory coupled to the processor for executing instructions stored in the memory. The instructions may comprise an instruction to receive a plurality of images. The instructions may further comprise an instruction to detect eyes co-ordinates associated with each image. The eyes co-ordinates may be detected based upon eyes and a face region associated with each image. Further, the instructions may comprise an instruction to identify hair region in each image by converting each image into a binary image. The binary image comprises zero-intensity pixels and non-zero intensity pixels. The zero-intensity pixels may represent the hair region. The instructions may further comprise an instruction to cluster each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image. The instructions may further comprise an instruction to assign a probability to each pixel corresponding to each binary image present in a cluster. In an embodiment, the probability may be assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster. Further, the instructions may comprise an instruction to generate a probability mask, indicating a hairstyle-template, corresponding to each cluster. The probability mask may be generated based upon the probability assigned to each pixel. Furthermore, the instructions may comprise an instruction to receive an input image corresponding to a person. The instructions may further comprise an instruction to compare the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image. In one embodiment, a hairstyle belonging to the probability mask matched indicates the hairstyle of the person.
[007] In yet another implementation, a non-transitory computer readable medium embodying a program executable in a computing device for identifying a hairstyle of a person is disclosed. In one aspect, the program may comprise a program code for receiving a plurality of images. The program may further comprise a program code for detecting eyes co-ordinates associated with each image. The eyes co-ordinates may be detected based upon eyes and a face region associated with each image. The program may further comprise a program code for identifying hair region in each image by converting each image into a binary image. The binary image comprises zero-intensity pixels and non-zero intensity pixels. The zero-intensity pixels may represent the hair region. The program may further comprise a program code for clustering each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image. The program may further comprise a program code for assigning a probability to each pixel corresponding to each binary image present in a cluster. In an embodiment, the probability may be assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster. Further, the program may comprise a program code for generating a probability mask, indicating a hairstyle-template, corresponding to each cluster. The probability mask may be generated based upon the probability assigned to each pixel. Furthermore, the program may comprise a program code for receiving an input image corresponding to a person. The program may further comprise a program code for comparing the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image. In one embodiment, a hairstyle belonging to the probability mask matched indicates the hairstyle of the person.
BRIEF DESCRIPTION OF THE DRAWINGS
[008] The foregoing detailed description of embodiments is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the disclosure, there is shown in the present document example constructions of the disclosure; however, the disclosure is not limited to the specific methods and systems disclosed in the document and the drawings.
[009] The detailed description is described with reference to the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The same numbers are used throughout the drawings to refer like features and components.
[0010] Figure 1 illustrates a network implementation of a system for identifying a hairstyle of a person, in accordance with an embodiment of the present disclosure.
[0011] Figure 2 illustrates the system, in accordance with an embodiment of the present disclosure.
[0012] Figures 3-6 illustrate a method for identifying a hairstyle of a person, in accordance with an embodiment of the present disclosure.
DETAILED DESCRIPTION
[0013] Some embodiments of this disclosure, illustrating all its features, will now be discussed in detail. The words "comprising," "having," "containing," and "including," and other forms thereof, are intended to be equivalent in meaning and be open ended in that an item or items following any one of these words is not meant to be an exhaustive listing of such item or items, or meant to be limited to only the listed item or items. It must also be noted that the singular forms "a," "an," and "the" include plural references unless the context clearly dictates otherwise. Although any systems and methods similar or equivalent to those described herein can be used in the practice or testing of embodiments of the present disclosure, the exemplary, systems and methods are now described. The disclosed embodiments are merely exemplary of the disclosure, which may be embodied in various forms.
[0014] Various modifications to the embodiment will be readily apparent to those skilled in the art and the generic principles herein may be applied to other embodiments. However, one of ordinary skill in the art will readily recognize that the present disclosure is not intended to be limited to the embodiments illustrated, but is to be accorded the widest scope consistent with the principles and features described herein.
[0015] The present disclosure describes method(s) and system(s) for identifying a hairstyle of a person. The present disclosure may enable the method(s) and system(s) to determine distinct hairstyles from a large number of frontal face images. The method(s) and system(s) may utilize an uncontrolled dataset of face images with challenging background conditions and varying frontal-profile viewpoints in order to simulate a real application scenario. The method(s) and system(s) may facilitate agglomerative clustering of hair regions, wherein assumption of any pre-determined number of clusters is not required. For each hair-style cluster, the method(s) and system(s) may determine a hairstyle-template (also referred hereinafter as a probability mask or probability map) indicating the probability of hair at a certain position of a facial image. The distinct hairstyles may be determined without requiring any prior knowledge or assumptions. The hairstyle-template may be subsequently utilized in order to identify the hairstyle of the person. Specifically, the hair distribution of the person may be compared with the hairstyle-template to identify his/her hairstyle. The method(s) and system(s) may align the face images prior to the clustering in order to correct against perspective changes. The aligning of the face images enable to produce a frontal view which improves the identification and determining hair region. Further, the probability mask helps in overcoming the effect of background clutter while recognizing the hairstyle of the person. While aspects of described system and method for identifying a hairstyle of the person may be implemented in any number of different computing systems, environments, and/or configurations, the embodiments are described in the context of the following exemplary system.
[0016] Although the present subject matter is explained considering that the system 102 is implemented on a server, it may be understood that the system 102 may also be implemented in a variety of computing systems, such as a laptop computer, a desktop computer, a notebook, a workstation, a mainframe computer, a cloud-based computing environment and the like. It will be understood that the system 102 may be accessed by multiple users through one or more user devices 104-1, 104-2…104-N, collectively referred to as user devices 104 hereinafter, or applications residing on the user devices 104. In one implementation, the system 102 may comprise the cloud-based computing environment in which a user may operate individual computing systems configured to execute remotely located applications. Examples of the user devices 104 may include, but are not limited to, a portable computer, a personal digital assistant, a handheld device, a workstation and the like. The user devices 104 are communicatively coupled to the system102 through a network 106.
[0017] In one implementation, the network 106 may be a wireless network, a wired network or a combination thereof. The network 106 can be implemented as one of the different types of networks, such as intranet, local area network (LAN), wide area network (WAN), the internet, and the like. The network 106 may either be a dedicated network or a shared network. The shared network represents an association of the different types of networks that use a variety of protocols, for example, Hypertext Transfer Protocol (HTTP), Transmission Control Protocol/Internet Protocol (TCP/IP), Wireless Application Protocol (WAP), and the like, to communicate with one another. Further the network 106 may include a variety of network devices, including routers, bridges, servers, computing devices, storage devices, and the like.
[0018] Referring now to Figure 2, the system 102 is illustrated in accordance with an embodiment of the present disclosure. In one embodiment, the system 102 may include a processor 202, an input/output (I/O) interface 204, and a memory 206. The processor 202 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuitries, and/or any devices that manipulate signals based on operational instructions. Among other capabilities, the processor 202 is configured to fetch and execute computer-readable instructions stored in the memory 206.
[0019] The I/O interface 204 may include a variety of software and hardware interfaces, for example, a web interface, a graphical user interface, and the like. The I/O interface 204 may allow the system 102 to interact with the user directly or through the user devices 104. Further, the I/O interface 204 may enable the system 102 to communicate with other computing devices, such as web servers and external data servers (not shown). The I/O interface 204 can facilitate multiple communications within a wide variety of networks and protocol types, including wired networks, for example, LAN, cable, etc., and wireless networks, such as WLAN, cellular, or satellite. The I/O interface 204 may include one or more ports for connecting a number of devices to one another or to another server.
[0020] The memory 206 may include any computer-readable medium and computer program product known in the art including, for example, volatile memory, such as static random access memory (SRAM) and dynamic random access memory (DRAM), and/or non-volatile memory, such as read only memory (ROM), erasable programmable ROM, flash memories, hard disks, optical disks, and magnetic tapes. The memory 206 may include modules 208 and data 210.
[0021] The modules 208 include routines, programs, objects, components, data structures, etc., which perform particular tasks or implement particular abstract data types. The modules 208 may comprise an eyes-coordinates detection module 212, a hair region identification module 214, an image aligning module 216, a clustering module 218, a template generation module 220, a hair recognition module 222 and other module 224. The other module 224 may include programs or coded instructions that supplement applications and functions of the system 102. The module 208 described herein may be implemented as software modules that may be executed in the cloud-based computing environment of the system 102.
[0022] The data 210, amongst other things, serves as a repository for storing data processed, received, and generated by one or more of the modules 208. The data 210 may also include a database 226 and other data 228. The other data 228 may include data generated as a result of the execution of one or more modules in the other module 224. The detail working of the system 102 along with the modules and/or components of the system 102 is further described as below.
[0023] In one embodiment, a number of frontal male and female face-images may be received from external sources, such as Internet and the like. The system 102 may filter only those images in which both eyes may be detected and hair-region may be reliably identified. It is to be noted that hair is more probable to be detected around face-region as compared to other regions in the image. Therefore, in a given image the system 102 may detect eyes-coordinates and face region of the person in order to capture the region of interest (ROI). In an embodiment, the system 102 may detect hair-region based on binarization technique. Subsequently, the system 102 may determine distinct hairstyles in a collection of face-images using the agglomerative clustering. Since, images may be of different sizes and the face location, shape, size and position in each of them may be different, the system 102 may align all the images about eyes-coordinates before clustering. In case of alignment before hair-identification, there may be probability of getting distorted images of different shapes thereby resulting in erroneous hair-region identification. Hence, the system 102 may alter the sequence and used alignment after identification of hair. The detection of hairstyle may be followed by probability mask-generations for hair, face-skin and background. The probability masks may be utilized for removing background-cluttering. The proposed methodology of determining the hairstyle using different modules is further described in detail by referring Figure 2 as below.
[0024] Referring now to Figure 2, in order to detect the eyes-coordinates, the eyes-coordinates detection module 212 may receive a plurality of images. The plurality of images may be received from one or more sources like internet, external databases or from a user of the system 102. The plurality of images may be stored in the database 226. In one implementation, the eyes-coordinates detection module 212 may further detect eyes co-ordinates corresponding to each image stored in the database 226. Further, the detection of the eye co-ordinates is explained as below.
[0025] In order detect the eyes co-ordinates, the eyes-coordinates detection module 212 may initially detect eyes and face region associated with each of the plurality of images. In one embodiment, the eyes may be detected using Haarcascade technique as described in “OpenCV, Eyes detection using haarcascade.” Further, the eyes-coordinates detection module 212 may detect face region in each of the plurality of images using Adaboost detection technique as described in “Face detection in color images using Adaboost algorithm based on skin color information.” By Y. Wu and X. Ai.
[0026] In one embodiment, after the detection of the eyes and the face region in each of the plurality of images, the eyes-coordinates detection module 212 may extend the face region by ?xdimension pixels from all the sides in order to obtain an extended face region. The face region is extended by ?xdimension pixels in order to cover a hair region along with the face region. In one embodiment, ‘?’ herein indicates an arbitrary fraction that covers the hair regions along with the face. Subsequently, the eyes-coordinates detection module 212 may detect eyes and nose only in the extended face region for quicker computation. The eyes may be located within the Region of Interest (ROI), which is located at ‘ß’ height from the top, inside the face ROI, where there is a maximum probability of detecting of the eyes. In one embodiment, values of ‘?’ and ‘ß’ may be empirically determined to be 1/3 and 2/11, respectively.
[0027] In one embodiment, the eyes co-ordinates detection module 212 may consider eyes and nose coordinates as the centre of rectangles bounding the eyes and nose respectively. In certain scenarios, multiple eye-points may be detected within close proximity of each other by the eyes co-ordinates detection module 212. In such scenarios, the eyes co-ordinates detection module 212 may utilize the nose coordinates in order to remove the redundant eye coordinates. More particularly, the eye-coordinates which lie symmetrically on both sides of the nose and which are equidistant from the nose-coordinates may be selected by the eyes co-ordinates detection module 212. Finally, the eyes co-ordinates detection module 212 may retain only those face images in which both eyes are successfully detected. In one exemplary embodiment, the steps implemented by the eyes co-ordinates detection module 212 in order to detect the eyes co-ordinates are as below:
1. If #eyesDetected <2, reject image
2. If #eyesDetected == 2, check distanceBetweenEyes
If distanceBetweenEyes <20 pixels, reject image
3. If #eyesDetected >2, find eyes which are equidistant from the nose. Further, after the identification of the eyes co-ordinates, the hair region identification module 214 may identify hair region in each of the images selected. The identification of the hair region is explained in detail as below.
[0028] Referring to Figure 2, in order to identify the hair region, the hair region identification module 214 may convert the images (RGB) selected into a grayscale format. Further, the hair region identification module 214 may apply basic image processing techniques on each of the grayscale images in order to generate binary images. In order to generate a binary image, the hair region identification module 214 may implement Gaussian smoothing and histogram equalization on each of the grayscale images in order to reduce noise and maximize image-contrast. Further, the hair region identification module 214 may apply thresholding on each of the grayscale images using Otsu’s method as described in “Image segmentation based on 2d Otsu method with histogram analysis.” by J. Zhang and J. Hu.” Otsu’s method is based on average of pixel values within the image. Finally, the hair region identification module 214 may simultaneously apply morphological operations like dilation and erosion with rectangular 3x3 structuring-elements to fill any holes in the image.
[0029] In one embodiment, zero-intensity (Black) pixels in the binary image may represent the hair-region. The complementary pixel intensity 255 or non-zero intensity (White) pixels represents the Face region and the Background. So, the hair region identification module 214 may label the pixels in these brighter regions as: Face-skin and Background. Since the face-skin has reddish to orange hue, i.e. 0 < HUE (skin) < 15 and 175 < HUE (skin) < 179, only those bright-pixels may be labeled, by the hair region identification module 214, as face-skin whose hue-value falls within the aforementioned range. The remaining brighter pixels may be labeled as Background by the hair region identification module 214. The hair region identification module 214 may select only those images in which zero-intensity (Black) pixels in the binary image correspond to hair in the actual colored image. In the remaining discarded images, the hair region identification module 214 may assume failure of the identification of hair, as the hair region may not be correctly identified in such discarded images. After the identification of the hair region, the images may be aligned about eyes using similarity transformation technique implemented by the image aligning module 216 as explained in detail as below.
[0030] Referring to Figure 2, the image aligning module 216 may align the images because the images selected may be of different sizes and from multiple perspectives. As a result, the eyes location and distance between the eyes may be different for every image. In order to remove these variations in images, the image aligning module 216 may utilize scale normalization and image alignment techniques. Further, the image aligning module 216 may align the images with respect to standard eye-positions. The normalization may enable to compare different face images, since the distances may always be measured in a normalized frame. For alignment, the image aligning module 216 may implement the Similarity transformation technique which includes 2D rotation, translation and scaling. This is because, under weak perspective projection due to different camera or face angles, the images that differ by image rotation or translation may be obtained from the same object and hence may be considered the same image. The image aligning module 216 may fix the position of eyes coordinates in the reference image such that the reference eye width is ‘d’ pixels in w x h pixels white template. The image may be appropriately scaled to align with the reference image. The image aligning module 216 may consider eyes as points of alignment with left eye as the centre of rotation. The images may be rotated about the left eye such that line joining the eyes is horizontal. Further, after the aligning of the images about the eyes, each binary image may be classified into a cluster of a plurality of clusters using the clustering module 218 as explained in detail as below.
[0031] In order to cluster the images, the clustering module 218 may utilize agglomerative clustering with complete linkage criteria which determines the distance between sets of observations as max {d (a, b): a ? A, b ? B} where, A and B are two sets of observations to cluster the selected binary images. The clustering module 218 may utilize agglomerative clustering since the number of clusters may not be known apriori. The complete linkage criteria may be utilized in order to avoid long chains. For clustering of images, the clustering module 218 may need feature-vector for each image and a distance-measure. For obtaining the feature-vector, an image of size w x h pixels may be divided into a certain number blocks of size l x l, where ‘l’ may be empirically determined as 12 pixels. Selection of ‘l’ may be governed by trade-off between discriminative powers of feature with respect to feature size. If ‘l’ is very large, then representation would become sparse and noisy, and if ‘l’ is small, then feature representation may become less discriminative. For each of these blocks, the clustering module 218 may calculate density of hair pixels using below formulation:
Density (D)ik = nik/Ni ………………………. (1)
Where, nik is number of hair-pixels in kth block of ith image. Ni is total number of hair-pixels in ith image. Thus, the feature-vector of the ith image is given as the concatenation of density of all the blocks of the ith image which is obtained using following formula:
Fi = [Di1,Di2,Di3,Di4......Dim]………………… (2)
Where ‘m’ is the total number of blocks in the ith image. The distance metric used between the data points is Manhattan distance, wherein the Manhattan distance may be calculated using below formula:
Mi,j = ||Fi – Fj||1……………………………………………….. (3)
Where Mi,j indicates the Manhattan distance between ith and jth image. The Manhattan distance indicates sum of the absolute difference of components of the feature-vectors. In one example, assume there are two vectors, a = (x1, y1) b = (x2, y2), then the Manhattan distance (Ma,b) between ‘a’ and ‘b’ is obtained as: ?a-b?1= |x1 – x2| + |y1 – y2|.
[0032] In an embodiment, dendrogram obtained, as a result of the clustering, may be cut at a level where difference between consecutive cluster merging distances is greater than a certain threshold, which may be determined empirically. The clustering of the plurality of binary images may be explained in detail as below:
[0033] In an exemplary embodiment, consider there are six different images a, b, c, d, e and f which may be initially clustered in six different clusters by the clustering module 218. In this embodiment, each cluster is represented by centroid (cluster-center) of the images present in the cluster. The centroid will therefore be indicated as a feature vector (F) of each image present in the cluster. Further, the clustering module 218 may calculate distance (or the Manhattan distance) between each cluster-center and merge the images having the Manhattan distance less than a predefined threshold value (determined empirically). Assume that, based upon the Manhattan distance, images b and c are merged to obtain a cluster ‘bc’ while images d and e are merged to obtain cluster ‘de’. In this scenario, the centroid of the cluster ‘bc’ is average of the feature vectors of the image b and image c respectively. Similarly, the centroid of the cluster ‘de’ is average of the feature vectors of the image d and image e respectively. Therefore, the clusters formed may be ‘a’, ‘bc’, ‘de’ and ‘f’. Again the clustering module 218 may calculate distance between each cluster-center of these four clusters and merge the clusters having minimal distance. The process is iteratively performed until the distance between each cluster-center in a specific iteration does not exceed the predefined value. Finally, the clusters may be obtained, each containing the images of the plurality of images. The clusters obtained may be utilized to generate probability-masks using the template generation module 220. The hair-probability templates may be representative of each hairstyle-category and hence, may be used for the identification of the hairstyle. The generation of probability masks or hairstyle- templates is explained as below.
[0034] Referring Figure 2, as shown, the template generation module 220 may generate probability masks or hairstyle-templates corresponding to each cluster of the plurality of clusters. In one embodiment, the probability masks may be generated in order to filter out background-cluttering. For each of the clusters obtained, the template generation module 220 may generate three probability maps based on intensity, one each for three types of region: Hair, Face-skin and Background. In one example, in order to generate probability masks for cluster ‘c’, the template generation module 220 may assign probabilities to each of the pixel (x,y) in each of the images present in the cluster ‘c’ as given below:
Pr (Pixel (x, y) = Hair)c = nch¬/nc ……………………………………………….. (4)
Where ‘nch’ is number of images in the cluster c for which intensity at pixel(x,y)=0 and ‘nc’ is the total number of images in the cluster c.
[0035] Imask,c(x, y) = Pr(x, y)c * 255……………………………….. (5)
Where ‘Imask, c’ is the probability-mask for the cluster c. Similarly, the probability-mask or hairstyle-template associated with each of the clusters may be generated by the template generation module 220. The probability masks or the hairstyle-templates generated may be stored in the database 226. After the generation of the probability masks or the hairstyle- templates, a hairstyle may be identified for any new test image using the hair recognition module 222 as explained in detail as below.
[0036] In one embodiment, the system 102 may utilize the probability masks or hairstyle-templates of each cluster/class in order to identify hairstyle of a person. The hairstyle is identified by the hair recognition module 222. In order to identify the hairstyle, hair recognition module 222 may classify the new test image in one of the hairstyle determined. The new test image may be assigned to one of the classes of hairstyle based on minimum distance of the new test image from the hair probability templates of each of the classes. In one embodiment, the hair recognition module 222 may invert the new test image (in binary form) into intensity values such that higher intensity regions belong to hair region. This is done because in the hair probability map, the brighter regions represent higher probability of being hair. Further, the hair recognition module 222 may calculate distance between a pixel (x, y) in the new test image and corresponding pixel in each of the hairstyle templates or the probability masks. The hair recognition module 222 may compare intensity values of all pixels and the hair template at close proximity from the new test image may be determined. The class/cluster of hairstyle to which that template belonged may be chosen as the hairstyle class for the new test image.
[0037] Referring now to Figure 3, the method for identifying a hairstyle of a person is shown, in accordance with an embodiment of the present subject matter. The method 300 may be described in the general context of computer executable instructions. Generally, computer executable instructions can include routines, programs, objects, components, data structures, procedures, modules, functions, etc., that perform particular functions or implement particular abstract data types. The method 300 may also be practiced in a distributed computing environment where functions are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, computer executable instructions may be located in both local and remote computer storage media, including memory storage devices.
[0038] The order in which the method 300 is described is not intended to be construed as a limitation, and any number of the described method blocks can be combined in any order to implement the method 300 or alternate methods. Additionally, individual blocks may be deleted from the method 300 without departing from the spirit and scope of the disclosure described herein. Furthermore, the method can be implemented in any suitable hardware, software, firmware, or combination thereof. However, for ease of explanation, in the embodiments described below, the method 300 may be considered to be implemented in the above described system 102.
[0039] At block 302, a plurality of images may be received. In one implementation, the plurality of images may be received from one or more sources by the eyes-coordinates detection module 212. The plurality of images may be stored in the database 226.
[0040] At block 304, eyes co-ordinates of each image may be detected. In one implementation, the eyes co-ordinates may be detected by the eyes-coordinates detection module 212. Further, the block 304 may be explained in greater detail in Figure 4.
[0041] At block 306, hair region in each image may be identified. The hair region may be identified by converting each image into a binary image comprising zero-intensity pixels and complementary intensity (non-zero intensity) pixels. The zero-intensity pixels represent the hair region in each image. In one implementation, the hair region may be identified by the hair region identification module 214.
[0042] At block 308, each of the binary images may be aligned about eyes with respect to reference image. In one implementation, each of the binary images may be aligned by the image aligning module 216 using similarity transformation technique.
[0043] At block 310, each of the binary images may be clustered/classified into a cluster/class of a plurality of clusters/classes. In one implementation, each of the binary images may be clustered/classified by the clustering module 218. Further, the block 310 may be explained in greater detail in Figure 5.
[0044] At block 312, probability mask/hairstyle-template associated with each cluster/class may be generated. In one implementation, the probability mask/hairstyle- template may be generated by the template generation module 220. The probability masks/hairstyle-templates may be stored in the database 226.
[0045] At block 314, hairstyle of a new test image corresponding to a person may be identified. In one implementation, the hairstyle of the new test image may be identified by the hair recognition module 222. Further, the block 314 may be explained in greater detail in Figure 6.
[0046] Referring now to Figure 4, a method 304 for detecting the eyes co-ordinates in each image is shown, in accordance with an embodiment of the present disclosure.
[0047] At block 402, eyes and a face region may be detected. In one implementation, the eyes may be detected using haarcascade technique. Further, the face region may be detected using Adaboost detection technique.
[0048] At block 404, the face region may be extended in order to obtain an extended face region. In one implementation, the face region may be extended by ? x dimension pixels from all sides of the face region. In an exemplary embodiment, the value of ‘?’ = 1/3.
[0049] At block 406, the eyes may be located within the extended face region. In one implementation, the eyes may be located at ß x height from top of the extended face region. In an exemplary embodiment, the value of ‘ß’ = 2/11.
[0050] At block 408, the eyes co-ordinates and nose co-ordinates may be identified. In one implementation, the eyes co-ordinates and nose co-ordinates may be identified as the centers of rectangles bounding the eyes and the nose respectively.
[0051] At block 410, the eyes co-ordinates lying symmetrically on both sides of the nose and located equidistant from the nose co-ordinates may be selected. Other redundant eyes co-ordinates/points may be removed.
[0052] Referring now to Figure 5, a method 310 for clustering the binary images into a plurality of clusters is shown, in accordance with an embodiment of the present disclosure.
[0053] At block 502, each binary image may be divided into a plurality of blocks of a predefined size. In one implementation, each binary image is of size wxh pixels. Further, the predefined size associated with each block is lxl, wherein ‘l’=12 pixels.
[0054] At block 504, density of hair pixels in each block of the plurality of blocks may be computed. In one implementation, the density of hair pixels in a block is computed based upon division of number of pixels in the block and total number of pixels in the image. In an exemplary embodiment, the density of hair pixels in kth block of ith image is computed by using formula, Density (D)ik = nik/Ni, where, nik is number of hair-pixels in kth block of ith image. Ni is total number of hair-pixels in ith image.
[0055] At block 506, a feature vector associated with each binary image may be determined. In one implementation, the feature vector of a binary image may be determined based on density of hair pixels in each block corresponding to the binary image. In an exemplary embodiment, the feature vector of ith image is the concatenation of density of hair pixels of each block corresponding to the ith image given by, Fi = [Di1, Di2, Di3…. Dim], where Fi is the feature vector and m is the number of blocks in the ith image.
[0056] At block 508, distance (also referred as Manhattan distance) between each binary image may be calculated. In one implementation, the Manhattan distance between two binary images is calculated based upon the feature vectors of the two binary images. In an exemplary embodiment, the Manhattan distance between ith and jth image is given by, Mi,j = ?Fi - Fj?1, where Fi and Fj represents the feature vectors of ith and jth image respectively.
[0057] Referring now to Figure 6, a method 314 for identifying hairstyle of the new test image using probability mask/template is shown, in accordance with an embodiment of the present disclosure.
[0058] At block 602, a new test image may be received. In one implementation the new test image received is in binary format.
[0059] At block 604, the new test image is inverted in intensity values. It should be noted that in the hair probability map/hair probability mask/hairstyle-template corresponding to each cluster/class, the brighter regions represent higher probability of being hair. Therefore, the new test image is inverted in the intensity values such that higher intensity regions belong to the hair region.
[0060] At block 606, intensity-distance indicating sum of the absolute differences between an intensity value of each pixel (x,y) in the new test image and an intensity value of corresponding pixel in each hair probability map/hair probability mask/hairstyle-template may be calculated. Intensity-distance is calculated as follows: Consider R is the test-image and P is the probability template, then ?I = Sx,y |R (x, y) – P (x, y)|, where ?I is the intensity-distance between test-image and the probability template.
[0061] At block 608, a template, from the plurality of templates, may be identified which is at close proximity from the new test image based upon the intensity-distance calculated at block 606.
[0062] At block 610, a cluster/class may be selected. The cluster/class selected corresponds to the template identified at block 608.
[0063] At block 612, hairstyle of the new test image is identified as the hairstyle belonging to the cluster/class selected at block 610.
[0064] Although implementations for methods and systems for identifying a hairstyle of a person have been described in language specific to structural features and/or methods, it is to be understood that the implementations and/or embodiments are not necessarily limited to the specific features or methods described. Rather, the specific features and methods are disclosed as examples of implementations for identifying a hairstyle of a person.
[0065] For example, in an alternative embodiment, the aforementioned methods(s) and system(s) may also be implemented in order to identify a beard style of a person. The plurality of images received may be processed in order to detect eye-coordinates and nose co-ordinates associated with each image. The eye-coordinates and nose co-ordinates may be detected based upon eyes and face region associated with each image, as explained above. Further, hair regions(s) associated with each image may be identified by converting each image into a binary image. The zero-intensity pixels in each binary image may represent the hair region(s). The hair region(s) may represent at least one of hair and beard of the personality associated with each image. Therefore, hair region located at a predefined distance from the eyes co-ordinates and the nose co-ordinates, in each binary image, may be selected to be identified as the beard of the personality in each image. In this embodiment, the other images containing the hair region identified as hair may be discarded for further processing.
[0066] Once the hair region is identified as the beard, each of the binary images is clustered into a plurality of clusters based upon a distance of each binary image with each other binary image. Thereafter, a probability may be assigned to each pixel corresponding to each binary image present in a cluster. In an embodiment, the probability may be assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster. Further, a probability mask, indicating a beard-template, may be generated corresponding to each cluster. The probability mask may be generated based upon the probability assigned to each pixel. Furthermore, an input image may be compared with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image. In this embodiment, a beard-style belonging to the probability mask matched indicates the beard-style of the person. ,CLAIMS:WE CLAIM:
1. A method for identifying a hairstyle of a person, the method comprising:
receiving, by a processor, a plurality of images;
detecting, by the processor, eyes co-ordinates associated with each image, wherein the eye co-ordinates are detected based upon eyes and a face region associated with each image;
identifying, by the processor, hair region in each image by converting each image into a binary image, wherein the binary image comprises zero-intensity pixels and non-zero intensity pixels, and wherein the zero-intensity pixels represent the hair region;
clustering, by the processor, each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image;
assigning, by the processor, a probability to each pixel corresponding to each binary image present in a cluster, wherein the probability is assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster;
generating, by the processor, a probability mask, indicating a hairstyle-template, corresponding to each cluster, wherein the probability mask is generated based upon the probability assigned to each pixel;
receiving, by the processor, an input image corresponding to a person; and
comparing, by the processor, the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image, wherein a hairstyle belonging to the probability mask matched indicates the hairstyle of the person.
2. The method of claim 1, wherein the eyes are detected using haarcascade technique, and wherein the face region is detected using Adaboost detection technique.
3. The method of claim 1, wherein the detection of the eye co-ordinates comprises
extending the face region in order to obtain an extended face region, wherein the face region is extended in order to cover a hair region along with the face region,
locating the eyes within the extended face region and
detecting centers of rectangles bounding the eyes and a nose respectively, wherein a center of rectangle bounding the eyes represent the eyes co-ordinates.
4. The method of claim 3, wherein the face region is extended by ? x dimension pixels from all sides of the face region, wherein ‘?’ = 1/3.
5. The method of claim 3, wherein the eyes are located at ß x height from top of the extended face region, wherein ‘ß’ = 2/11.
6. The method of claim 3 further comprising removing redundant eye points, in the extended face region, by selecting the eye-coordinates lying symmetrically on both side of the nose and located equidistant from nose co-ordinates, wherein the nose co-ordinates are detected based upon a center of rectangle bounding the nose.
7. The method of claim 1, wherein, before clustering, each binary image is aligned with respect to a reference image, and wherein each binary image is aligned using similarity transformation technique, and wherein the alignment comprises rotation, translation and scaling of each binary image.
8. The method of claim 1, wherein the distance of each binary image with each other binary image is computed by
dividing each binary image into a plurality of blocks of a predefined size,
computing density of hair pixels in each of the plurality of blocks, wherein the density of hair pixels in a block is computed based upon division of number of pixels in the block and total number of pixels in the image,
determining a feature vector of each binary image based on the density of each block and
calculating the distance of each binary image with each other binary image based upon the feature vector associated with each binary image.
9. The method of claim 8, wherein each binary image is of size wxh pixels, and wherein the predefined size associated with each block is lxl, wherein ‘l’=12 pixels
10. The method of claim 8, wherein the distance calculated indicates a Manhattan distance (Mi,j), wherein Mi,j = || Fi – Fj ||1, wherein Fi and Fj indicates the feature vector corresponding to ‘ith’ and ‘jth’ image respectively.
11. The method of claim 1, wherein probability Pr(x,y)c of a pixel (x,y) corresponding to a binary image of a cluster ‘c’ is assigned as, Pr(x,y)c = nch/nc, wherein ‘nch’ indicates a number of images in the cluster ‘c’ having zero-intensity pixels, and wherein ‘nc’ indicates total number of images in the cluster ‘c’.
12. The method of claim 11, wherein a probability mask (Imask,c(x,y)) of the cluster ‘c’ is generated based upon a formula, Imask,c(x,y) = Pr(x,y)c*255.
13. The method of claim 1, wherein the probability mask matched with the input image is identified by
inverting the input image in intensity values such that higher intensity region in the input image belongs to a hair region in the input image,
calculating an intensity-distance indicating sum of the absolute differences between a pixel intensity of each pixel in the input image and a pixel intensity of a corresponding pixel in a plurality of probability masks corresponding to the plurality of clusters and
identifying the probability mask with close proximity from the input image based upon the intensity-distance.
14. A system for identifying a hairstyle of a person, the system comprising:
a processor; and
a memory coupled to the processor, wherein the processor executes a plurality of instructions stored in the memory in order to:
receive a plurality of images;
detect eyes co-ordinates associated with each image, wherein the eye co-ordinates are detected based upon eyes and a face region associated with each image;
identify hair region in each image by converting each image into a binary image, wherein the binary image comprises zero-intensity pixels and non-zero intensity pixels, and wherein the zero-intensity pixels represent the hair region;
cluster each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image;
assign probability to each pixel corresponding to each binary image present in a cluster, wherein the probability is assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster;
generate a probability mask, indicating a hairstyle-template, corresponding to each cluster, wherein the probability mask is generated based upon the probability assigned to each pixel;
receive an input image corresponding to a person; and
compare the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image, wherein a hairstyle belonging to the probability mask matched indicates the hairstyle of the person.
15. The system of claim 14, wherein the detection of the eye co-ordinates further comprises:
extending the face region in order to obtain an extended face region, wherein the face region is extended in order to cover a hair region along with the face region,
locating the eyes within the extended face region and
detecting centers of rectangles bounding the eyes and a nose respectively, wherein a center of rectangle bounding the eyes represent the eyes co-ordinates.
16. The system of claim 14, wherein the distance of each binary image with each other binary image is computed by
dividing each binary image into a plurality of blocks of a predefined size,
computing density of hair pixels in each of the plurality of blocks, wherein the density of hair pixels in a block is computed based upon division of number of pixels in the block and total number of pixels in the image,
determining a feature vector of each binary image based on the density of each block and
calculating the distance of each binary image with each other binary image based upon the feature vector associated with each binary image.
17. The system of claim 14, wherein the probability mask matched with the input image is identified by
inverting the input image in intensity values such that higher intensity region in the input image belongs to a hair region in the input image,
calculating an intensity-distance indicating sum of the absolute differences between a pixel intensity of each pixel in the input image and a pixel intensity of a corresponding pixel in a plurality of probability masks corresponding to the plurality of clusters and
identifying the probability mask with close proximity from the input image based upon the intensity-distance.
18. A non-transitory computer readable medium embodying a program executable in a computing device for identifying a hairstyle of a person, the program comprising:
a program code for receiving a plurality of images;
a program code for detecting eyes co-ordinates associated with each image, wherein the eye co-ordinates are detected based upon eyes and a face region associated with each image;
a program code for identifying hair region in each image by converting each image into a binary image, wherein the binary image comprises zero-intensity pixels and non-zero intensity pixels, and wherein the zero-intensity pixels represent the hair region;
a program code for clustering each binary image into a cluster of a plurality of clusters based upon a distance of each binary image with each other binary image;
a program code for assigning a probability to each pixel corresponding to each binary image present in a cluster, wherein the probability is assigned based upon division of number of images in the cluster having zero-intensity pixels and the total number of images in the cluster;
a program code for generating a probability mask, indicating a hairstyle- template, corresponding to each cluster, wherein the probability mask is generated based upon the probability assigned to each pixel;
a program code for receiving an input image corresponding to a person; and
a program code for comparing the input image with the probability mask corresponding to each cluster in order to identify a probability mask matching with the input image, wherein a hairstyle belonging to the probability mask matched indicates the hairstyle of the person.
| Section | Controller | Decision Date |
|---|---|---|
| # | Name | Date |
|---|---|---|
| 1 | 3955-MUM-2013-IntimationOfGrant13-03-2024.pdf | 2024-03-13 |
| 1 | Form-2(Online).pdf | 2018-08-11 |
| 2 | Form 2.pdf | 2018-08-11 |
| 2 | 3955-MUM-2013-PatentCertificate13-03-2024.pdf | 2024-03-13 |
| 3 | Figure for Abstract.jpg | 2018-08-11 |
| 3 | 3955-MUM-2013-PETITION UNDER RULE 137 [06-01-2024(online)].pdf | 2024-01-06 |
| 4 | ABSTRACT1.jpg | 2018-08-11 |
| 4 | 3955-MUM-2013-RELEVANT DOCUMENTS [06-01-2024(online)].pdf | 2024-01-06 |
| 5 | 3955-MUM-2013-Written submissions and relevant documents [29-12-2023(online)].pdf | 2023-12-29 |
| 5 | 3955-MUM-2013-FORM 26(6-3-2014).pdf | 2018-08-11 |
| 6 | 3955-MUM-2013-FORM 1(3-2-2014).pdf | 2018-08-11 |
| 6 | 3955-MUM-2013-Correspondence to notify the Controller [14-12-2023(online)].pdf | 2023-12-14 |
| 7 | 3955-MUM-2013-FORM-26 [14-12-2023(online)]-1.pdf | 2023-12-14 |
| 7 | 3955-MUM-2013-CORRESPONDENCE(6-3-2014).pdf | 2018-08-11 |
| 8 | 3955-MUM-2013-FORM-26 [14-12-2023(online)].pdf | 2023-12-14 |
| 8 | 3955-MUM-2013-CORRESPONDENCE(3-2-2014).pdf | 2018-08-11 |
| 9 | 3955-MUM-2013-US(14)-HearingNotice-(HearingDate-19-12-2023).pdf | 2023-11-29 |
| 9 | 3955-MUM-2013-FER.pdf | 2019-07-05 |
| 10 | 3955-MUM-2013-CLAIMS [04-01-2020(online)].pdf | 2020-01-04 |
| 10 | 3955-MUM-2013-OTHERS [04-01-2020(online)].pdf | 2020-01-04 |
| 11 | 3955-MUM-2013-COMPLETE SPECIFICATION [04-01-2020(online)].pdf | 2020-01-04 |
| 11 | 3955-MUM-2013-FER_SER_REPLY [04-01-2020(online)].pdf | 2020-01-04 |
| 12 | 3955-MUM-2013-COMPLETE SPECIFICATION [04-01-2020(online)].pdf | 2020-01-04 |
| 12 | 3955-MUM-2013-FER_SER_REPLY [04-01-2020(online)].pdf | 2020-01-04 |
| 13 | 3955-MUM-2013-CLAIMS [04-01-2020(online)].pdf | 2020-01-04 |
| 13 | 3955-MUM-2013-OTHERS [04-01-2020(online)].pdf | 2020-01-04 |
| 14 | 3955-MUM-2013-FER.pdf | 2019-07-05 |
| 14 | 3955-MUM-2013-US(14)-HearingNotice-(HearingDate-19-12-2023).pdf | 2023-11-29 |
| 15 | 3955-MUM-2013-CORRESPONDENCE(3-2-2014).pdf | 2018-08-11 |
| 15 | 3955-MUM-2013-FORM-26 [14-12-2023(online)].pdf | 2023-12-14 |
| 16 | 3955-MUM-2013-CORRESPONDENCE(6-3-2014).pdf | 2018-08-11 |
| 16 | 3955-MUM-2013-FORM-26 [14-12-2023(online)]-1.pdf | 2023-12-14 |
| 17 | 3955-MUM-2013-Correspondence to notify the Controller [14-12-2023(online)].pdf | 2023-12-14 |
| 17 | 3955-MUM-2013-FORM 1(3-2-2014).pdf | 2018-08-11 |
| 18 | 3955-MUM-2013-FORM 26(6-3-2014).pdf | 2018-08-11 |
| 18 | 3955-MUM-2013-Written submissions and relevant documents [29-12-2023(online)].pdf | 2023-12-29 |
| 19 | ABSTRACT1.jpg | 2018-08-11 |
| 19 | 3955-MUM-2013-RELEVANT DOCUMENTS [06-01-2024(online)].pdf | 2024-01-06 |
| 20 | Figure for Abstract.jpg | 2018-08-11 |
| 20 | 3955-MUM-2013-PETITION UNDER RULE 137 [06-01-2024(online)].pdf | 2024-01-06 |
| 21 | Form 2.pdf | 2018-08-11 |
| 21 | 3955-MUM-2013-PatentCertificate13-03-2024.pdf | 2024-03-13 |
| 22 | Form-2(Online).pdf | 2018-08-11 |
| 22 | 3955-MUM-2013-IntimationOfGrant13-03-2024.pdf | 2024-03-13 |
| 1 | 3955mum2013search_03-07-2019.pdf |