WO2017157261A1 - Image search method, and virtual character image acquisition method and device - Google Patents

Image search method, and virtual character image acquisition method and device Download PDF

Info

Publication number
WO2017157261A1
WO2017157261A1 PCT/CN2017/076466 CN2017076466W WO2017157261A1 WO 2017157261 A1 WO2017157261 A1 WO 2017157261A1 CN 2017076466 W CN2017076466 W CN 2017076466W WO 2017157261 A1 WO2017157261 A1 WO 2017157261A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
image
clothing
character image
character
Prior art date
Application number
PCT/CN2017/076466
Other languages
French (fr)
Chinese (zh)
Inventor
林清客
白博
陈茂林
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017157261A1 publication Critical patent/WO2017157261A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an image search method, a virtual person image acquisition method, and an apparatus.
  • Searching by image means submitting a picture of a person who matches the submitted picture by submitting the actual picture of the person or submitting a picture that can describe the global and local features of the character.
  • the actual character picture cannot be obtained, it is necessary to make a virtual character picture and use the virtual character picture to search.
  • the generation of the virtual character is an abstract description of the character by selecting the character feature template and the clothing template.
  • Character characteristics include height, face shape, facial features, hair style, skin color, body shape, etc.
  • clothing features include: tops, pants, skirts, shoes, and the like.
  • this requires storing a large number of clothing templates to cover as many situations as possible, wasting storage resources.
  • a large number of templates stored may not necessarily meet the requirements.
  • the RGB value of each pixel of the selected virtual character can only be the color in the basic color library, but the actual scene will be due to illumination, shadow, visual chromatic aberration, etc. The situation is biased towards the color, which results in a large deviation of the search results.
  • An embodiment of the present invention provides an image search method, a virtual person image acquisition method, and a device, which are used to solve the problem that the clothing template existing in the prior art cannot cover all the cases and the color due to illumination, shadow, visual chromatic aberration, and the like.
  • the problem caused by the deviation of the search results is large.
  • an embodiment of the present invention provides an image search method, including:
  • the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to a color family,
  • One color family corresponds to one basic color, and one color family includes a plurality of colors; an image matching the virtual human figure image is searched in the target image database using a plurality of colors included in the color family of the respective pixels.
  • all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and
  • the influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
  • obtaining the color family library can be implemented as follows:
  • the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
  • the clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
  • Each of these categories includes a number of colors that make up a color family.
  • the clustering algorithm in the embodiment of the present invention may be a K-means algorithm, a K-Medoids algorithm, or the like.
  • the color family library is obtained from the actual character image, and the accuracy of using the color in the color family library to match the image is added.
  • the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • Clothing features include: jackets, shirts, pants, shoes, skirts, etc.
  • the color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on.
  • the padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like.
  • obtaining the generated virtual character image can be achieved as follows:
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
  • the avatar image may be locked, that is, when the avatar image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the avatar image, the The area included in the clothing corresponding to the position information to be adjusted is subjected to filling processing to obtain a generated virtual character image.
  • the indication information for the clothing feature adjustment in the virtual character image if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
  • an embodiment of the present invention provides a method for acquiring a virtual character image, including:
  • the indication information includes position information and direction information to be adjusted
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
  • the avatar image obtained by filling the area included in the clothing corresponding to the location information to be adjusted according to the filling algorithm to obtain the generated virtual character image can be implemented as follows:
  • the location information to be adjusted is based on a filling algorithm
  • the area included in the clothing corresponding to the content is subjected to padding processing to obtain a generated virtual character image.
  • it also includes:
  • the virtual character image may be locked, that is, when the virtual character image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the virtual character image, the filling algorithm is based on the filling algorithm. Filling the area included in the clothing corresponding to the position information to be adjusted to obtain a generated virtual character image.
  • the adjustment of the clothing feature in the virtual character image is prohibited. It is possible to avoid an erroneous operation that occurs when there is no need to adjust the clothing in the avatar image.
  • an embodiment of the present invention provides an image search apparatus, where the apparatus includes:
  • a receiver configured to acquire a generated virtual character image
  • a processor configured to determine a color of each pixel of the virtual character image received by the receiver; and obtain, from the acquired color family library, a color family corresponding to a color of each pixel; wherein the color family library For pre-characterizing the corresponding colors of each pixel in a plurality of actual character images, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors; using each pixel A plurality of colors included in the color family search for an image matching the virtual character image in the target image database.
  • the receiver is further configured to acquire a plurality of actual character images
  • the processor is further configured to obtain the color family library by:
  • the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
  • the clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
  • Each of these categories includes a number of colors that make up a color family.
  • the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the processor is further configured to separately acquire color blocks describing character features included in each actual character image and color blocks describing the clothing features, including:
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • the receiver is further configured to:
  • the processor After the processor initially determines the avatar image based on the clothing feature template and the character feature template, receiving indication information of the clothing adjustment of the avatar image, where the indication information includes location information and direction information to be adjusted;
  • the processor is further configured to:
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the embodiment of the present invention further provides a virtual character image acquiring apparatus, including:
  • a processor configured to initially determine a virtual character image based on the clothing feature template and the character feature template
  • a receiver configured to receive, by the user, indication information about a clothing feature adjustment in the virtual character image that is initially determined by the processor, where the indication information includes location information to be adjusted and direction information;
  • the processor is further configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted received by the receiver based on the filling algorithm to obtain the generated virtual character image.
  • the processor performs a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm to obtain the generated virtual character image, specifically for:
  • the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the processor when the receiver receives the indication information of the clothing feature adjustment in the avatar image, the processor is further configured to determine that the avatar image is in a locked state, Adjustment of the clothing features in the virtual character image is prohibited.
  • an embodiment of the present invention provides an image search apparatus, including:
  • An image obtaining unit configured to acquire the generated virtual character image
  • a determining unit configured to determine a color of each pixel of the virtual character image acquired by the image acquiring unit
  • a color obtaining unit configured to respectively obtain a color family corresponding to a color of each pixel from a color family library, wherein the color family library is obtained by clustering corresponding colors of respective pixels in a plurality of actual character images in advance, and each The class corresponds to a color family, one color family corresponds to one basic color, and one color family includes multiple colors;
  • a matching unit configured to search the target image database for an image matching the virtual character image using a plurality of colors included in a color family of each pixel.
  • the acquiring unit is further configured to acquire a plurality of actual character images
  • the device also includes:
  • a color block obtaining unit configured to respectively acquire a color block describing a character feature included in each actual character image and a color block describing a clothing feature;
  • the character feature is a physiological feature of the character, and the clothing feature is related to the clothing of the character information;
  • a color family generating unit configured to cluster, by using a clustering algorithm, a color block including a character feature included in each actual character image and a color information included in a color block describing the clothing feature to obtain a plurality of classes, and determine each class included The basic color corresponding to several colors;
  • Each of these categories includes a number of colors that make up a color family.
  • the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the color block acquiring unit is specifically configured to:
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • the device further includes an image generating unit, configured to receive indication information of the clothing adjustment of the virtual character image after the virtual character image is initially determined based on the clothing feature template and the character feature template,
  • the indication information includes location information to be adjusted and direction information;
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • an embodiment of the present invention provides a virtual person image acquiring device, where the device includes:
  • a preliminary determining unit configured to initially determine a virtual character image based on the clothing feature template and the character feature template
  • a receiving unit configured to receive, by the user, indication information about a clothing feature adjustment in the virtual person image determined by the preliminary determining unit, where the indication information includes location information to be adjusted and direction information;
  • a generating unit configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
  • the generating unit is specifically configured to:
  • the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the generating unit is further configured to: when the receiving unit receives the indication information about the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in a locked state, Adjustment of the clothing features in the virtual character image is prohibited.
  • all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and
  • the influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
  • FIG. 1 is a flowchart of an image search method according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a color family library according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a method for acquiring a color family library according to an embodiment of the present invention.
  • 4A-4B are schematic diagrams of a human-machine interaction interface for initially determining a virtual character image according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for acquiring a virtual character image according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of an image search apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another image search apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a virtual character image acquiring apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of another virtual character image acquiring apparatus according to an embodiment of the present invention.
  • An embodiment of the present invention provides an image search method, a virtual person image acquisition method, and a device, which are used to solve the problem that the clothing template existing in the prior art cannot cover all the cases and the color due to illumination, shadow, visual chromatic aberration, and the like.
  • the problem caused by the deviation of the search results is large.
  • the method and device are based on the same inventive concept, Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description will not be repeated.
  • the solution provided by the embodiment of the present invention can be implemented by using one terminal device.
  • the terminal device can be a device such as a computer.
  • the image search method is provided in the embodiment of the present invention.
  • the image search method is provided in the embodiment of the present invention.
  • the image search method is as shown in FIG. 1 , and the image is searched for, as shown in FIG. 1 , the image of the virtual character is different from the difference between the light, the shadow, the visual color difference and the like.
  • Methods include:
  • the generated virtual character image is obtained, and the virtual character image can be generated through the human-computer interaction interface.
  • the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes more A color, for example, a color family library as shown in FIG.
  • all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and
  • the influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
  • obtaining the color family library can be implemented as follows, as shown in FIG. 3:
  • A1 obtain some images of actual characters.
  • A2 respectively acquiring color blocks describing the character features included in each actual character image and color patches describing the clothing features; the character features are physiological characteristics of the characters, and the clothing features are related information of the clothing on the characters.
  • the background area of each actual character image is separately removed to obtain a mask MASK image including the foreground image of each actual character image.
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • A3 using a clustering algorithm to cluster the color blocks of the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine the basic colors corresponding to each color included in each class. colour.
  • Each of these categories includes a number of colors that make up a color family.
  • the clustering algorithm in the embodiment of the present invention may be a K-means algorithm, a K-Medoids algorithm, or the like.
  • the color block describing the character feature and the color information included in the color block describing the clothing feature include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the garment of the initially determined virtual character image may be fine-tuned according to the difference between the virtual character image and the actual character's clothing.
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • Clothing features include: jackets, shirts, pants, shoes, skirts, etc.
  • the color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on.
  • the padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like. This embodiment of the present invention does not specifically limit this.
  • the indication information for receiving the clothing adjustment of the virtual character image may be implemented as follows:
  • the location information that the garment needs to adjust includes the location of the garment and the size of the adjustment. For example, width adjustment, length adjustment, and so on.
  • the area included in the garment to be adjusted is determined according to the position indicated by the mouse, and then the area is processed based on the filling algorithm to obtain the generated virtual character image.
  • the user initially determines the virtual character image through the human-computer interaction interface and the clothing feature template displayed by the interface and the character feature template.
  • the user selects a jacket, a T-shirt, a pants, a shoe, a gender, etc. on the interface, and the pants can be pants or skirts.
  • the user uses the mouse to drag the garment to be adjusted, such as the left and right spacing of the jacket, the length of the sleeve, and the length of the pants.
  • the terminal device monitors the event that the user mouse drags the clothing, obtains the position information and the direction information that the clothing needs to be adjusted, and then fills the area included in the clothing corresponding to the position information to be adjusted according to the flooding filling algorithm to generate the generated result.
  • Virtual character image
  • the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
  • the avatar image may be locked, that is, when the avatar image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the avatar image, the The area included in the clothing corresponding to the position information to be adjusted is subjected to filling processing to obtain a generated virtual character image.
  • the indication information for the clothing feature adjustment in the virtual character image if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
  • An embodiment of the present invention further provides a method for acquiring a virtual character image. As shown in FIG. 5, the method includes:
  • S501 After initially determining the virtual person image based on the clothing feature template and the character feature template, receiving, by the user, indication information for adjusting the clothing feature in the virtual character image, where the indication information includes location information to be adjusted and direction information.
  • Clothing features include: jackets, shirts, pants, shoes, skirts, etc.
  • the color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on.
  • the padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like. This invention The embodiment does not specifically limit this.
  • the indication information for receiving the clothing adjustment of the virtual character image may be implemented as follows:
  • the location information that the garment needs to adjust includes the location of the garment and the size of the adjustment. For example, width adjustment, length adjustment, and so on.
  • the area included in the garment to be adjusted is determined according to the position indicated by the mouse, and then the area is processed based on the filling algorithm to obtain the generated virtual character image.
  • the user initially determines the virtual character image through the human-computer interaction interface and the clothing feature template displayed by the interface and the character feature template.
  • the user selects a jacket, T-shirt, pants, shoes, gender, etc. on the interface.
  • the user uses the mouse to drag the garment to be adjusted, such as the left and right spacing of the jacket, the length of the sleeve, and the length of the pants. Therefore, the terminal device monitors the event that the user mouse drags the clothing, obtains the position information and the direction information that the clothing needs to be adjusted, and then fills the area included in the clothing corresponding to the position information to be adjusted according to the flooding filling algorithm to generate the generated result.
  • Virtual character image the virtual character image.
  • the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
  • the avatar image obtained by performing the filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm may be implemented as follows:
  • the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the method may further include:
  • the virtual character image may be locked, that is, when the virtual character image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the virtual character image, the filling algorithm is based on the filling algorithm. Filling the area included in the clothing corresponding to the position information to be adjusted to obtain a generated virtual character image.
  • the adjustment of the clothing feature in the virtual character image is prohibited. It is possible to avoid an erroneous operation that occurs when there is no need to adjust the clothing in the avatar image.
  • an embodiment of the present invention provides an image search apparatus, as shown in FIG. 6, including:
  • a determining unit 602 configured to determine a color of each pixel of the virtual character image acquired by the image acquiring unit 601;
  • the color obtaining unit 603 is configured to separately obtain a color family corresponding to the color of each pixel from the color family library, where the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each One class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors;
  • the matching unit 604 is configured to search for an image matching the virtual character image in the target image database by using a plurality of colors included in a color family of each pixel.
  • the image obtaining unit 601 is further configured to acquire a plurality of actual character images
  • the device also includes:
  • a color block obtaining unit 605 configured to respectively acquire a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is a clothing of the character Related Information;
  • a color family generating unit 606 configured to cluster, by using a clustering algorithm, a color block including a character feature included in each actual character image and color information included in a color block describing the clothing feature to obtain a plurality of classes, and determine each class to include The basic color corresponding to several colors;
  • Each of these categories includes a number of colors that make up a color family.
  • the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the color block obtaining unit 605 is specifically configured to:
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • the device further includes an image generating unit 607, configured to receive indication information about the clothing adjustment of the virtual character image after the virtual character image is initially determined based on the clothing feature template and the character feature template.
  • the indication information includes location information to be adjusted and direction information;
  • the generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • each functional unit in each embodiment of the present application may be integrated into one processing. In the device, it may be physically present alone, or two or more units may be integrated in one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • an image search device as shown in FIG. 7 includes a receiver 701 and a processor 702.
  • the processor 702 can be a central processing unit (English: central processing unit, CPU for short), or a digital processing unit or the like.
  • the image search device further includes a memory 703 for storing a program executed by the processor 702, and a processor 702 for executing a program stored by the memory 703.
  • the memory 703 is also used to store information such as a color family library, a target image database, a clothing feature template, and a character feature template.
  • the memory 703 may be disposed inside the image search device or may be disposed outside the image search device.
  • the image search device may further include an input/output interface 704 for writing a program and configuration information into the memory 703 through the input/output interface 704 to output the matched image.
  • the receiver 701, the memory 703, the processor 702, and the input/output interface 704 can be connected through a bus 705.
  • the manner of connection between other components is merely illustrative and not limited.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
  • the memory 703 may be a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory 703 may also be a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD), or memory 703 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 703 may be a combination of the above memories.
  • a receiver 701 configured to acquire a generated virtual character image
  • a processor 702 configured to determine a color of each pixel of the virtual character image received by the receiver 701; and obtain, from the acquired color family library, a color family corresponding to a color of each pixel; wherein the color
  • the family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors;
  • the plurality of colors included in the color family of the pixels search for an image matching the virtual character image in the target image database.
  • the receiver 701 is further configured to acquire a plurality of actual character images
  • the processor 702 is further configured to obtain the color family library by:
  • the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
  • the clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
  • Each of these categories includes a number of colors that make up a color family.
  • the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
  • the processor 702 is further configured to separately acquire, by using the following, a color block describing a character feature included in each actual character image and a color block describing the clothing feature, including:
  • the color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  • the receiver 701 is further configured to:
  • the processor 702 After the processor 702 initially determines the avatar image based on the clothing feature template and the character feature template, receiving the indication information of the clothing adjustment of the avatar image, where the indication information includes location information and direction information to be adjusted;
  • the processor 702 is further configured to: perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
  • an embodiment of the present invention provides a virtual person image acquiring device.
  • the device includes:
  • a preliminary determining unit 801 configured to initially determine a virtual character image based on the clothing feature template and the character feature template
  • the receiving unit 802 is configured to receive indication information about a clothing feature adjustment in the virtual character image determined by the preliminary determining unit 801, where the indication information includes location information to be adjusted and direction information;
  • the generating unit 803 is configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
  • the generating unit 803 is specifically configured to:
  • the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the generating unit 803 is further configured to: when the receiving unit 802 receives the indication information about the clothing feature adjustment in the virtual character image, if the virtual character image is determined to be locked The state prohibits adjustment of the clothing features in the avatar image.
  • all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and
  • the influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
  • each functional unit in each embodiment of the present application may be integrated into one processing. In the device, it may be physically present alone, or two or more units may be integrated in one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • a virtual person image acquiring device as shown in FIG. 8 includes a receiver 901 and a processor 902.
  • the processor 902 can be a central processing unit (English: central processing unit, CPU for short), or a digital processing unit or the like.
  • the virtual character image acquiring apparatus further includes a memory 903 for storing a program executed by the processor 902, and the processor 902 is configured to execute a program stored by the memory 903.
  • the memory 903 is also used to store information such as a clothing feature template and a character feature template.
  • the memory 903 may be disposed inside the avatar image acquisition device or may be disposed outside the avatar image acquisition device.
  • the virtual character image obtaining means may further include an input/output interface 904 for writing a program and configuration information into the memory 903 through the input/output interface 904, and outputting the matched image.
  • the receiver 901, the memory 903, the processor 902, and the input/output interface 904 can be connected by a bus 905.
  • the manner of connection between other components is merely illustrative and not limited.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
  • the memory 903 can be a volatile memory, such as a RAM; the memory 903 can also be a non-volatile memory, such as a ROM, flash memory, HDD or SSD, or the memory 903 can be used to carry or store an instruction or data structure.
  • the memory 903 may be a combination of the above memories.
  • the processor 902 is configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
  • the receiver 901 is configured to receive indication information about a clothing feature adjustment in the virtual character image that is initially determined by the processor 902, where the indication information includes location information to be adjusted and direction information.
  • the processor 902 is further configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted received by the receiver 901 based on the filling algorithm to obtain the generated virtual character image.
  • the processor 902 when performing the filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm to obtain the generated virtual character image, is specifically used to:
  • the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  • the processor 902 when the receiver 901 receives the indication information about the adjustment of the clothing feature in the avatar image, the processor 902 is further configured to determine that the avatar image is in a locked state. When the clothing features in the virtual character image are prohibited from being adjusted.
  • the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Library & Information Science (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Graphics (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Processing Or Creating Images (AREA)
  • Image Analysis (AREA)

Abstract

Provided are an image search method, and a virtual character image acquisition method and device, used for solving the problem in the prior art of large search result deviations caused by colour deviations due to illumination, shadow, visual colour difference etc. The image search method comprises: acquiring a generated virtual character image; determining the colours of various pixels of the virtual character image; respectively acquiring colour groups corresponding to the colours of the various pixels from within a colour group library, the colour group library being acquired by performing clustering on colours corresponding to various pixels within several actual character images in advance, each type corresponding to one colour group, one colour group corresponding to one basic colour, one colour group comprising a plurality of colours; using the pluralities of colours included within the colour groups of the various pixels to search within a target image database for an image matching the virtual character image.

Description

一种图像搜索方法、虚拟人物图像获取方法及装置Image search method, virtual character image acquisition method and device 技术领域Technical field
本发明涉及图像处理技术领域,尤其涉及一种图像搜索方法、虚拟人物图像获取方法及装置。The present invention relates to the field of image processing technologies, and in particular, to an image search method, a virtual person image acquisition method, and an apparatus.
背景技术Background technique
以图搜图是指通过提交实际的人物图片或者提交可以描述人物全局以及局部特征的图片,在相应的数据库中进行搜索,找出与提交图片相匹配的人物的图片。但是当无法获取实际人物图片时,就需要先生成虚拟人物图片,使用虚拟人物图片来进行搜索。Searching by image means submitting a picture of a person who matches the submitted picture by submitting the actual picture of the person or submitting a picture that can describe the global and local features of the character. However, when the actual character picture cannot be obtained, it is necessary to make a virtual character picture and use the virtual character picture to search.
但是虚拟人物的生成,是通过该选择人物特征模板、服装模板对人物进行抽象的描述。人物特征包括身高、脸型、五官特征、发型、肤色、体型等等,服装特征包括:上衣、裤子、裙子、鞋子等等。但是这种需要存储大量的服装模板来尽可能多的囊括多种情况,浪费存储资源。另外存储的大量模板有时候也不一定能够满足需求。另外,使用虚拟人物图片在数据库中搜索匹配的图片时,所选择地虚拟人物的各个像素的RGB值只能是基本颜色库中的颜色,但是实际场景中会因为光照、阴影、视觉色差等等情况对颜色产生偏差,因此造成了搜索结果偏差较大。However, the generation of the virtual character is an abstract description of the character by selecting the character feature template and the clothing template. Character characteristics include height, face shape, facial features, hair style, skin color, body shape, etc., and clothing features include: tops, pants, skirts, shoes, and the like. But this requires storing a large number of clothing templates to cover as many situations as possible, wasting storage resources. In addition, a large number of templates stored may not necessarily meet the requirements. In addition, when searching for a matching picture in the database using the virtual character picture, the RGB value of each pixel of the selected virtual character can only be the color in the basic color library, but the actual scene will be due to illumination, shadow, visual chromatic aberration, etc. The situation is biased towards the color, which results in a large deviation of the search results.
发明内容Summary of the invention
本发明实施例提供一种图像搜索方法、虚拟人物图像获取方法及装置,用以解决现有技术中存在的服装模板无法囊括所有的情况以及因为光照、阴影、视觉色差等等情况对颜色产生偏差,造成的搜索结果偏差较大的问题。An embodiment of the present invention provides an image search method, a virtual person image acquisition method, and a device, which are used to solve the problem that the clothing template existing in the prior art cannot cover all the cases and the color due to illumination, shadow, visual chromatic aberration, and the like. The problem caused by the deviation of the search results is large.
第一方面,本发明实施例提供了一种图像搜索方法,该方法包括:In a first aspect, an embodiment of the present invention provides an image search method, including:
获取生成的虚拟人物图像;确定所述虚拟人物图像的各个像素的颜色;Obtaining a generated virtual character image; determining a color of each pixel of the virtual character image;
从颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。Obtaining a color family corresponding to the color of each pixel from the color family library; wherein the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to a color family, One color family corresponds to one basic color, and one color family includes a plurality of colors; an image matching the virtual human figure image is searched in the target image database using a plurality of colors included in the color family of the respective pixels.
利用本发明实施例提供的方式,使用颜色族中所有的颜色参与图像匹配,并且颜色族中包括的颜色是对若干实际人物图像包括的颜色聚类得到的,降低了真实人物因为光照、阴影以及视觉色差等对虚拟人物图像的影响,提高了数据的可靠性,也使得提高了在目标图像数据库中搜索到与所述虚拟人物图像匹配的图像的准确率。With the manner provided by the embodiment of the present invention, all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and The influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
在一种可能的设计中,获取所述颜色族库,可以通过如下方式实现:In a possible design, obtaining the color family library can be implemented as follows:
获取若干实际人物图像;Obtaining images of several actual characters;
分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;Obtaining, respectively, a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色; The clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
本发明实施例中的聚类算法可以是K-means算法、K-Medoids算法等等。The clustering algorithm in the embodiment of the present invention may be a K-means algorithm, a K-Medoids algorithm, or the like.
上述设计中,从实际人物图像中获取颜色族库,增加了使用颜色族库中的颜色来匹配图像的准确性。In the above design, the color family library is obtained from the actual character image, and the accuracy of using the color in the color family library to match the image is added.
在一种可能的设计中,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。In one possible design, the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
在一种可能的设计中,分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块,可以通过如下方式实现:In a possible design, respectively obtaining the color blocks describing the character features included in each actual character image and the color blocks describing the clothing features can be realized as follows:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
服装特征包括:外套、衬衣、裤子、鞋子、裙子等等,服装的颜色可以变化。人物特征中包括人物的性别、身高、脸型、五官特征、发型、肤色、表情、体型等等。填充算法可以是洪泛填充(Flooding Fill)算法,还可以是边界填充算法等等。Clothing features include: jackets, shirts, pants, shoes, skirts, etc. The color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on. The padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like.
在一种可能的设计中,获取生成的虚拟人物图像,可以通过如下方式实现:In one possible design, obtaining the generated virtual character image can be achieved as follows:
基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;Receiving, by the clothing feature template and the character feature template, the indication information of the clothing adjustment of the virtual character image, where the indication information includes position information and direction information to be adjusted;
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
通过上述方式可以实现服装在多维度上的调整,在提供的服装模板无法满足需求时,可以对服装进行自适应调整。Through the above manner, the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
本发明实施例中还可以对虚拟人物图像进行锁定,也就是说所述虚拟人物图像为自适应调整状态时,接收对所述虚拟人物图像的服装调整的指示信息后,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。In the embodiment of the present invention, the avatar image may be locked, that is, when the avatar image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the avatar image, the The area included in the clothing corresponding to the position information to be adjusted is subjected to filling processing to obtain a generated virtual character image. Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
通过上述方式能够避免在不需要对虚拟人物图像中的服装进行调整时,产生的误操作。In the above manner, it is possible to avoid an erroneous operation that occurs when the clothing in the virtual character image is not required to be adjusted.
第二方面,本发明实施例提供了一种虚拟人物图像获取方法,包括:In a second aspect, an embodiment of the present invention provides a method for acquiring a virtual character image, including:
基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收用户对所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;Receiving, by the user, the indication information of the clothing feature adjustment in the virtual character image after the avatar image and the character feature template are initially determined, the indication information includes position information and direction information to be adjusted;
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
通过上述方式可以实现服装在多维度上的调整,在提供的服装模板无法满足需求时,可以对服装进行自适应调整。Through the above manner, the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
在一种可能的设计中,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像,可以通过如下方式实现:In a possible design, the avatar image obtained by filling the area included in the clothing corresponding to the location information to be adjusted according to the filling algorithm to obtain the generated virtual character image can be implemented as follows:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信 息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the location information to be adjusted is based on a filling algorithm The area included in the clothing corresponding to the content is subjected to padding processing to obtain a generated virtual character image.
在一种可能的设计中,还包括:In one possible design, it also includes:
在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
通过本发明实施例提供的方案,可以对虚拟人物图像进行锁定,也就是说所述虚拟人物图像为自适应调整状态时,接收对所述虚拟人物图像的服装调整的指示信息后,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。能够避免在不需要对虚拟人物图像中的服装进行调整时,产生的误操作。According to the solution provided by the embodiment of the present invention, the virtual character image may be locked, that is, when the virtual character image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the virtual character image, the filling algorithm is based on the filling algorithm. Filling the area included in the clothing corresponding to the position information to be adjusted to obtain a generated virtual character image. Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited. It is possible to avoid an erroneous operation that occurs when there is no need to adjust the clothing in the avatar image.
第三方面,本发明实施例提供了一种图像搜索装置,该装置包括:In a third aspect, an embodiment of the present invention provides an image search apparatus, where the apparatus includes:
接收器,用于获取生成的虚拟人物图像;a receiver, configured to acquire a generated virtual character image;
处理器,用于确定所述接收器接收到的所述虚拟人物图像的各个像素的颜色;从获取到的颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。a processor, configured to determine a color of each pixel of the virtual character image received by the receiver; and obtain, from the acquired color family library, a color family corresponding to a color of each pixel; wherein the color family library For pre-characterizing the corresponding colors of each pixel in a plurality of actual character images, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors; using each pixel A plurality of colors included in the color family search for an image matching the virtual character image in the target image database.
在一种可能的设计中,所述接收器,还用于获取若干实际人物图像;In a possible design, the receiver is further configured to acquire a plurality of actual character images;
所述处理器,还用于通过如下方式获取所述颜色族库,包括:The processor is further configured to obtain the color family library by:
分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;Obtaining, respectively, a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;The clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
在一种可能的设计中,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。In one possible design, the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
在一种可能的设计中,所述处理器,还用于通过如下方式分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块,包括:In a possible design, the processor is further configured to separately acquire color blocks describing character features included in each actual character image and color blocks describing the clothing features, including:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
在一种可能的设计中,所述接收器,还用于:In a possible design, the receiver is further configured to:
在所述处理器基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;After the processor initially determines the avatar image based on the clothing feature template and the character feature template, receiving indication information of the clothing adjustment of the avatar image, where the indication information includes location information and direction information to be adjusted;
所述处理器还用于:The processor is further configured to:
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。 The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
第四方面,本发明实施例还提供了一种虚拟人物图像获取装置,包括:In a fourth aspect, the embodiment of the present invention further provides a virtual character image acquiring apparatus, including:
处理器,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像;a processor, configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
接收器,用于接收用户对所述处理器初步确定的所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;a receiver, configured to receive, by the user, indication information about a clothing feature adjustment in the virtual character image that is initially determined by the processor, where the indication information includes location information to be adjusted and direction information;
所述处理器,还用于基于填充算法对所述接收器接收到的需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The processor is further configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted received by the receiver based on the filling algorithm to obtain the generated virtual character image.
在一种可能的设计中,所述处理器,在基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像,具体用于:In a possible design, the processor performs a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm to obtain the generated virtual character image, specifically for:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
在一种可能的设计中,在所述接收器接收到对所述虚拟人物图像中的服装特征调整的指示信息时,所述处理器,还用于确定所述虚拟人物图像为锁定状态时,禁止对所述虚拟人物图像中的服装特征进行调整。In a possible design, when the receiver receives the indication information of the clothing feature adjustment in the avatar image, the processor is further configured to determine that the avatar image is in a locked state, Adjustment of the clothing features in the virtual character image is prohibited.
第五方面,本发明实施例提供了一种图像搜索装置,包括:In a fifth aspect, an embodiment of the present invention provides an image search apparatus, including:
图像获取单元,用于获取生成的虚拟人物图像;An image obtaining unit, configured to acquire the generated virtual character image;
确定单元,用于确定所述图像获取单元获取到的所述虚拟人物图像的各个像素的颜色;a determining unit, configured to determine a color of each pixel of the virtual character image acquired by the image acquiring unit;
颜色获取单元,用于从颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;a color obtaining unit, configured to respectively obtain a color family corresponding to a color of each pixel from a color family library, wherein the color family library is obtained by clustering corresponding colors of respective pixels in a plurality of actual character images in advance, and each The class corresponds to a color family, one color family corresponds to one basic color, and one color family includes multiple colors;
匹配单元,用于使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。And a matching unit configured to search the target image database for an image matching the virtual character image using a plurality of colors included in a color family of each pixel.
在一种可能的设计中,所述获取单元,还用于获取若干实际人物图像;In a possible design, the acquiring unit is further configured to acquire a plurality of actual character images;
所述装置还包括:The device also includes:
色块获取单元,用于分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;a color block obtaining unit, configured to respectively acquire a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related to the clothing of the character information;
颜色族生成单元,用于使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;a color family generating unit, configured to cluster, by using a clustering algorithm, a color block including a character feature included in each actual character image and a color information included in a color block describing the clothing feature to obtain a plurality of classes, and determine each class included The basic color corresponding to several colors;
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
在一种可能的设计中,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。In one possible design, the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
在一种可能的设计中,所述色块获取单元,具体用于:In a possible design, the color block acquiring unit is specifically configured to:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
在一种可能的设计中,所述装置还包括图像生成单元,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息, 所述指示信息包括需调整的位置信息以及方向信息;In a possible design, the device further includes an image generating unit, configured to receive indication information of the clothing adjustment of the virtual character image after the virtual character image is initially determined based on the clothing feature template and the character feature template, The indication information includes location information to be adjusted and direction information;
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
第六方面,本发明实施例提供了一种虚拟人物图像获取装置,该装置包括:In a sixth aspect, an embodiment of the present invention provides a virtual person image acquiring device, where the device includes:
初步确定单元,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像;a preliminary determining unit, configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
接收单元,用于接收用户对所述初步确定单元确定的所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;a receiving unit, configured to receive, by the user, indication information about a clothing feature adjustment in the virtual person image determined by the preliminary determining unit, where the indication information includes location information to be adjusted and direction information;
生成单元,用于基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。And a generating unit, configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
在一种可能的设计中,所述生成单元,具体用于:In a possible design, the generating unit is specifically configured to:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
在一种可能的设计中,所述生成单元,还用于在所述接收单元接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。In a possible design, the generating unit is further configured to: when the receiving unit receives the indication information about the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in a locked state, Adjustment of the clothing features in the virtual character image is prohibited.
利用本发明实施例提供的方式,使用颜色族中所有的颜色参与图像匹配,并且颜色族中包括的颜色是对若干实际人物图像包括的颜色聚类得到的,降低了真实人物因为光照、阴影以及视觉色差等对虚拟人物图像的影响,提高了数据的可靠性,也使得提高了在目标图像数据库中搜索到与所述虚拟人物图像匹配的图像的准确率。With the manner provided by the embodiment of the present invention, all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and The influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
附图说明DRAWINGS
图1为本发明实施例提供的图像搜索方法流程图;1 is a flowchart of an image search method according to an embodiment of the present invention;
图2为本发明实施例提供的颜色族库示意图;2 is a schematic diagram of a color family library according to an embodiment of the present invention;
图3为本发明实施例提供的获取颜色族库方法示意图;3 is a schematic diagram of a method for acquiring a color family library according to an embodiment of the present invention;
图4A~图4B为本发明实施例提供的用于初步确定虚拟人物图像人机交互界面示意图;4A-4B are schematic diagrams of a human-machine interaction interface for initially determining a virtual character image according to an embodiment of the present invention;
图5为本发明实施例提供的虚拟人物图像获取方法流程图;FIG. 5 is a flowchart of a method for acquiring a virtual character image according to an embodiment of the present invention;
图6为本发明实施例提供的一种图像搜索装置示意图;FIG. 6 is a schematic diagram of an image search apparatus according to an embodiment of the present invention;
图7为本发明实施例提供的另一种图像搜索装置示意图;FIG. 7 is a schematic diagram of another image search apparatus according to an embodiment of the present invention;
图8为本发明实施例提供的一种虚拟人物图像获取装置示意图;FIG. 8 is a schematic diagram of a virtual character image acquiring apparatus according to an embodiment of the present invention;
图9为本发明实施例提供的另一种虚拟人物图像获取装置示意图。FIG. 9 is a schematic diagram of another virtual character image acquiring apparatus according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种图像搜索方法、虚拟人物图像获取方法及装置,用以解决现有技术中存在的服装模板无法囊括所有的情况以及因为光照、阴影、视觉色差等等情况对颜色产生偏差,造成的搜索结果偏差较大的问题。其中,方法和装置是基于同一发明构思的, 由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。An embodiment of the present invention provides an image search method, a virtual person image acquisition method, and a device, which are used to solve the problem that the clothing template existing in the prior art cannot cover all the cases and the color due to illumination, shadow, visual chromatic aberration, and the like. The problem caused by the deviation of the search results is large. Wherein the method and device are based on the same inventive concept, Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description will not be repeated.
本发明实施例提供的方案可以通过一台终端设备来实现。终端设备可以是计算机等设备。The solution provided by the embodiment of the present invention can be implemented by using one terminal device. The terminal device can be a device such as a computer.
针对虚拟人物颜色的选择与真实人物因为光照、阴影、视觉色差等之间的偏差,造成搜索结果偏差较大的问题,本发明实施例提供了一种图像搜索方法,如图1所示,该方法包括:The image search method is provided in the embodiment of the present invention. The image search method is provided in the embodiment of the present invention. The image search method is as shown in FIG. 1 , and the image is searched for, as shown in FIG. 1 , the image of the virtual character is different from the difference between the light, the shadow, the visual color difference and the like. Methods include:
S101,获取生成的虚拟人物图像。S101. Acquire a generated virtual character image.
具体获取生成的虚拟人物图像,可以通过人机交互界面生成虚拟人物图片。Specifically, the generated virtual character image is obtained, and the virtual character image can be generated through the human-computer interaction interface.
S102,确定所述生成的虚拟人物图像的各个像素的颜色。S102. Determine a color of each pixel of the generated virtual character image.
S103,从颜色族库中分别获取各个像素的颜色对应的颜色族。S103. Acquire color families corresponding to colors of respective pixels from the color family library.
其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色,例如,如图2所示的颜色族库。Wherein, the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes more A color, for example, a color family library as shown in FIG.
S104,使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。S104. Search for an image matching the virtual character image in the target image database using a plurality of colors included in a color family of each pixel.
利用本发明实施例提供的方式,使用颜色族中所有的颜色参与图像匹配,并且颜色族中包括的颜色是对若干实际人物图像包括的颜色聚类得到的,降低了真实人物因为光照、阴影以及视觉色差等对虚拟人物图像的影响,提高了数据的可靠性,也使得提高了在目标图像数据库中搜索到与所述虚拟人物图像匹配的图像的准确率。With the manner provided by the embodiment of the present invention, all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and The influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
在一种可能的实现方式中,获取所述颜色族库,可以通过如下方式实现,如图3所示:In a possible implementation manner, obtaining the color family library can be implemented as follows, as shown in FIG. 3:
A1,获取若干实际人物图像。A1, obtain some images of actual characters.
A2,分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息。A2, respectively acquiring color blocks describing the character features included in each actual character image and color patches describing the clothing features; the character features are physiological characteristics of the characters, and the clothing features are related information of the clothing on the characters.
在分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块时,可以通过如下方式实现:When separately obtaining the color block describing the character feature included in each actual character image and the color block describing the clothing feature, the following can be realized:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像。The background area of each actual character image is separately removed to obtain a mask MASK image including the foreground image of each actual character image.
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
A3,使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色。A3, using a clustering algorithm to cluster the color blocks of the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine the basic colors corresponding to each color included in each class. colour.
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
本发明实施例中的聚类算法可以是K-means算法、K-Medoids算法等等。The clustering algorithm in the embodiment of the present invention may be a K-means algorithm, a K-Medoids algorithm, or the like.
可选地,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。Optionally, the color block describing the character feature and the color information included in the color block describing the clothing feature include: red, green, and blue RGB color components or hue, saturation, and lightness components.
可选地,获取生成的虚拟人物图像时,可以在初步确定虚拟人物图像后,根据虚拟人物图像与实际人物的服装上的差别,对初步确定的虚拟人物图像的服装进行微调,可以通 过如下方式实现:Optionally, when the generated virtual character image is obtained, after the initial determination of the virtual character image, the garment of the initially determined virtual character image may be fine-tuned according to the difference between the virtual character image and the actual character's clothing. Implemented as follows:
基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括服装调整的位置信息以及方向信息;Receiving, by the clothing feature template and the character feature template, the indication information of the clothing adjustment of the virtual character image, where the indication information includes the position information and the direction information of the clothing adjustment;
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
服装特征包括:外套、衬衣、裤子、鞋子、裙子等等,服装的颜色可以变化。人物特征中包括人物的性别、身高、脸型、五官特征、发型、肤色、表情、体型等等。Clothing features include: jackets, shirts, pants, shoes, skirts, etc. The color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on.
填充算法可以是洪泛填充(Flooding Fill)算法,还可以是边界填充算法等等。本发明实施例对此不作具体限定。The padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like. This embodiment of the present invention does not specifically limit this.
本发明实施例中,接收对所述虚拟人物图像的服装调整的指示信息,可以通过如下方式实现:In the embodiment of the present invention, the indication information for receiving the clothing adjustment of the virtual character image may be implemented as follows:
监听到用户鼠标拖动服装的事件,获知服装需调整的位置信息以及方向信息。Listen to the event that the user mouse drags the costume, and know the position information and direction information that the garment needs to adjust.
服装需调整的位置信息包括服装所在的位置以及调整的大小。例如宽度调整、长度调整等等。The location information that the garment needs to adjust includes the location of the garment and the size of the adjustment. For example, width adjustment, length adjustment, and so on.
从而根据鼠标所指示的位置确定需要调整的服装包括的区域,然后基于填充算法对该区域进行处理得到生成的虚拟人物图像。Thereby, the area included in the garment to be adjusted is determined according to the position indicated by the mouse, and then the area is processed based on the filling algorithm to obtain the generated virtual character image.
例如,用户通过人机交互界面并界面显示的服装特征模板以及人物特征模板初步确定虚拟人物图像。如图4A和图4B所示界面,用户在界面上选择外套、T恤、外裤、鞋子、性别等等,外裤可以为裤子或者裙子。然后用户使用鼠标拖拉需调整的服装,例如外套的左右间隔、袖子的长短、裤子的长度。从而终端设备监听到用户鼠标拖动服装的事件,获知服装需调整的位置信息以及方向信息,然后基于洪泛填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。For example, the user initially determines the virtual character image through the human-computer interaction interface and the clothing feature template displayed by the interface and the character feature template. As shown in FIG. 4A and FIG. 4B, the user selects a jacket, a T-shirt, a pants, a shoe, a gender, etc. on the interface, and the pants can be pants or skirts. The user then uses the mouse to drag the garment to be adjusted, such as the left and right spacing of the jacket, the length of the sleeve, and the length of the pants. Therefore, the terminal device monitors the event that the user mouse drags the clothing, obtains the position information and the direction information that the clothing needs to be adjusted, and then fills the area included in the clothing corresponding to the position information to be adjusted according to the flooding filling algorithm to generate the generated result. Virtual character image.
通过上述方式可以实现服装在多维度上的调整,在提供的服装模板无法满足需求时,可以对服装进行自适应调整。Through the above manner, the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
本发明实施例中还可以对虚拟人物图像进行锁定,也就是说所述虚拟人物图像为自适应调整状态时,接收对所述虚拟人物图像的服装调整的指示信息后,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。In the embodiment of the present invention, the avatar image may be locked, that is, when the avatar image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the avatar image, the The area included in the clothing corresponding to the position information to be adjusted is subjected to filling processing to obtain a generated virtual character image. Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
通过上述方式能够避免在不需要对虚拟人物图像中的服装进行调整时,产生的误操作。In the above manner, it is possible to avoid an erroneous operation that occurs when the clothing in the virtual character image is not required to be adjusted.
本发明实施例还提供了一种虚拟人物图像获取方法,如图5所示,该方法包括:An embodiment of the present invention further provides a method for acquiring a virtual character image. As shown in FIG. 5, the method includes:
S501,基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收用户对所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息。S501: After initially determining the virtual person image based on the clothing feature template and the character feature template, receiving, by the user, indication information for adjusting the clothing feature in the virtual character image, where the indication information includes location information to be adjusted and direction information.
S502,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。S502. Perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
服装特征包括:外套、衬衣、裤子、鞋子、裙子等等,服装的颜色可以变化。人物特征中包括人物的性别、身高、脸型、五官特征、发型、肤色、表情、体型等等。Clothing features include: jackets, shirts, pants, shoes, skirts, etc. The color of the garment can vary. Characters include the gender, height, face, facial features, hairstyle, skin color, expression, body shape, and so on.
填充算法可以是洪泛填充(Flooding Fill)算法,还可以是边界填充算法等等。本发明 实施例对此不作具体限定。The padding algorithm can be a flooding fill algorithm, a boundary padding algorithm, and the like. this invention The embodiment does not specifically limit this.
本发明实施例中,接收对所述虚拟人物图像的服装调整的指示信息,可以通过如下方式实现:In the embodiment of the present invention, the indication information for receiving the clothing adjustment of the virtual character image may be implemented as follows:
监听到用户鼠标拖动服装的事件,获知服装需调整的位置信息以及方向信息。Listen to the event that the user mouse drags the costume, and know the position information and direction information that the garment needs to adjust.
服装需调整的位置信息包括服装所在的位置以及调整的大小。例如宽度调整、长度调整等等。The location information that the garment needs to adjust includes the location of the garment and the size of the adjustment. For example, width adjustment, length adjustment, and so on.
从而根据鼠标所指示的位置确定需要调整的服装包括的区域,然后基于填充算法对该区域进行处理得到生成的虚拟人物图像。Thereby, the area included in the garment to be adjusted is determined according to the position indicated by the mouse, and then the area is processed based on the filling algorithm to obtain the generated virtual character image.
例如,用户通过人机交互界面并界面显示的服装特征模板以及人物特征模板初步确定虚拟人物图像。如图2所示界面,用户在界面上选择外套、T恤、外裤、鞋子、性别等等。然后用户使用鼠标拖拉需调整的服装,例如外套的左右间隔、袖子的长短、裤子的长度。从而终端设备监听到用户鼠标拖动服装的事件,获知服装需调整的位置信息以及方向信息,然后基于洪泛填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。For example, the user initially determines the virtual character image through the human-computer interaction interface and the clothing feature template displayed by the interface and the character feature template. As shown in Figure 2, the user selects a jacket, T-shirt, pants, shoes, gender, etc. on the interface. The user then uses the mouse to drag the garment to be adjusted, such as the left and right spacing of the jacket, the length of the sleeve, and the length of the pants. Therefore, the terminal device monitors the event that the user mouse drags the clothing, obtains the position information and the direction information that the clothing needs to be adjusted, and then fills the area included in the clothing corresponding to the position information to be adjusted according to the flooding filling algorithm to generate the generated result. Virtual character image.
通过上述方式可以实现服装在多维度上的调整,在提供的服装模板无法满足需求时,可以对服装进行自适应调整。Through the above manner, the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
可选地,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像,可以通过如下方式实现:Optionally, the avatar image obtained by performing the filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm may be implemented as follows:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
可选地,该方法还可以包括:Optionally, the method may further include:
在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
通过本发明实施例提供的方案,可以对虚拟人物图像进行锁定,也就是说所述虚拟人物图像为自适应调整状态时,接收对所述虚拟人物图像的服装调整的指示信息后,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。能够避免在不需要对虚拟人物图像中的服装进行调整时,产生的误操作。According to the solution provided by the embodiment of the present invention, the virtual character image may be locked, that is, when the virtual character image is in an adaptive adjustment state, after receiving the indication information of the clothing adjustment of the virtual character image, the filling algorithm is based on the filling algorithm. Filling the area included in the clothing corresponding to the position information to be adjusted to obtain a generated virtual character image. Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited. It is possible to avoid an erroneous operation that occurs when there is no need to adjust the clothing in the avatar image.
基于与图1所示的方法实施例同样的发明构思,本发明实施例提供了一种图像搜索装置,如图6所示,包括:Based on the same inventive concept as the method embodiment shown in FIG. 1, an embodiment of the present invention provides an image search apparatus, as shown in FIG. 6, including:
图像获取单元601,用于获取生成的虚拟人物图像;An image obtaining unit 601, configured to acquire the generated virtual character image;
确定单元602,用于确定所述图像获取单元601获取到的所述虚拟人物图像的各个像素的颜色;a determining unit 602, configured to determine a color of each pixel of the virtual character image acquired by the image acquiring unit 601;
颜色获取单元603,用于从颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;The color obtaining unit 603 is configured to separately obtain a color family corresponding to the color of each pixel from the color family library, where the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each One class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors;
匹配单元604,用于使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。 The matching unit 604 is configured to search for an image matching the virtual character image in the target image database by using a plurality of colors included in a color family of each pixel.
在一种可能的设计中,所述图像获取单元601,还用于获取若干实际人物图像;In a possible design, the image obtaining unit 601 is further configured to acquire a plurality of actual character images;
所述装置还包括:The device also includes:
色块获取单元605,用于分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;a color block obtaining unit 605, configured to respectively acquire a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is a clothing of the character Related Information;
颜色族生成单元606,用于使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;a color family generating unit 606, configured to cluster, by using a clustering algorithm, a color block including a character feature included in each actual character image and color information included in a color block describing the clothing feature to obtain a plurality of classes, and determine each class to include The basic color corresponding to several colors;
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
在一种可能的设计中,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。In one possible design, the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
在一种可能的设计中,所述色块获取单元605,具体用于:In a possible design, the color block obtaining unit 605 is specifically configured to:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
在一种可能的设计中,所述装置还包括图像生成单元607,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;In a possible design, the device further includes an image generating unit 607, configured to receive indication information about the clothing adjustment of the virtual character image after the virtual character image is initially determined based on the clothing feature template and the character feature template. The indication information includes location information to be adjusted and direction information;
基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
本发明实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能单元可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of the unit in the embodiment of the present invention is schematic, and is only a logical function division. In actual implementation, there may be another division manner. In addition, each functional unit in each embodiment of the present application may be integrated into one processing. In the device, it may be physically present alone, or two or more units may be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
其中,集成的单元既可以采用硬件的形式实现时,如图7所示的一种图像搜索装置包括接收器701以及处理器702。处理器702,可以是一个中央处理单元(英文:central processing unit,简称CPU),或者为数字处理单元等等。其中,图像搜索装置中还包括存储器703,用于存储处理器702执行的程序,处理器702用于执行存储器703存储的程序。存储器703还用于存储颜色族库、目标图像数据库、服装特征模板以及人物特征模板等等信息。Wherein, when the integrated unit can be implemented in the form of hardware, an image search device as shown in FIG. 7 includes a receiver 701 and a processor 702. The processor 702 can be a central processing unit (English: central processing unit, CPU for short), or a digital processing unit or the like. The image search device further includes a memory 703 for storing a program executed by the processor 702, and a processor 702 for executing a program stored by the memory 703. The memory 703 is also used to store information such as a color family library, a target image database, a clothing feature template, and a character feature template.
存储器703可以设置于所述图像搜索装置内部,也可以设置于所述图像搜索装置外部。图像搜索装置还可以包括输入/输出接口704,用于通过输入/输出接口704将程序、以及配置信息写入存储器703中,将匹配得到的图像输出。The memory 703 may be disposed inside the image search device or may be disposed outside the image search device. The image search device may further include an input/output interface 704 for writing a program and configuration information into the memory 703 through the input/output interface 704 to output the matched image.
其中,接收器701、存储器703、处理器702、输入/输出接口704可以通过总线705连接。其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The receiver 701, the memory 703, the processor 702, and the input/output interface 704 can be connected through a bus 705. The manner of connection between other components is merely illustrative and not limited. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
存储器703可以是易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器703也可以是非易失性存储器(英文: non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD)、或者存储器703是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器703可以是上述存储器的组合。The memory 703 may be a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory 703 may also be a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD), or memory 703 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 703 may be a combination of the above memories.
接收器701,用于获取生成的虚拟人物图像;a receiver 701, configured to acquire a generated virtual character image;
处理器702,用于确定所述接收器701接收到的所述虚拟人物图像的各个像素的颜色;从获取到的颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。a processor 702, configured to determine a color of each pixel of the virtual character image received by the receiver 701; and obtain, from the acquired color family library, a color family corresponding to a color of each pixel; wherein the color The family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors; The plurality of colors included in the color family of the pixels search for an image matching the virtual character image in the target image database.
在一种可能的设计中,所述接收器701,还用于获取若干实际人物图像;In a possible design, the receiver 701 is further configured to acquire a plurality of actual character images;
所述处理器702,还用于通过如下方式获取所述颜色族库,包括:The processor 702 is further configured to obtain the color family library by:
分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;Obtaining, respectively, a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;The clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
在一种可能的设计中,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。In one possible design, the color blocks describing the character features and the color information contained in the color patches describing the clothing features include: red, green, and blue RGB color components or hue, saturation, and lightness components.
在一种可能的设计中,所述处理器702,还用于通过如下方式分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块,包括:In a possible design, the processor 702 is further configured to separately acquire, by using the following, a color block describing a character feature included in each actual character image and a color block describing the clothing feature, including:
分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
在一种可能的设计中,所述接收器701,还用于:In a possible design, the receiver 701 is further configured to:
在所述处理器702基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;After the processor 702 initially determines the avatar image based on the clothing feature template and the character feature template, receiving the indication information of the clothing adjustment of the avatar image, where the indication information includes location information and direction information to be adjusted;
所述处理器702还用于:基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The processor 702 is further configured to: perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
基于与图5所示的实施例同样的发明构思,本发明实施例提供了一种虚拟人物图像获取装置,如图8所示,该装置包括:Based on the same inventive concept as the embodiment shown in FIG. 5, an embodiment of the present invention provides a virtual person image acquiring device. As shown in FIG. 8, the device includes:
初步确定单元801,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像;a preliminary determining unit 801, configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
接收单元802,用于接收用户对所述初步确定单元801确定的所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;The receiving unit 802 is configured to receive indication information about a clothing feature adjustment in the virtual character image determined by the preliminary determining unit 801, where the indication information includes location information to be adjusted and direction information;
生成单元803,用于基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。 The generating unit 803 is configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted according to the filling algorithm to obtain the generated virtual character image.
在一种可能的设计中,所述生成单元803,具体用于:In a possible design, the generating unit 803 is specifically configured to:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
在一种可能的设计中,所述生成单元803,还用于在所述接收单元802接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。In a possible design, the generating unit 803 is further configured to: when the receiving unit 802 receives the indication information about the clothing feature adjustment in the virtual character image, if the virtual character image is determined to be locked The state prohibits adjustment of the clothing features in the avatar image.
利用本发明实施例提供的方式,使用颜色族中所有的颜色参与图像匹配,并且颜色族中包括的颜色是对若干实际人物图像包括的颜色聚类得到的,降低了真实人物因为光照、阴影以及视觉色差等对虚拟人物图像的影响,提高了数据的可靠性,也使得提高了在目标图像数据库中搜索到与所述虚拟人物图像匹配的图像的准确率。With the manner provided by the embodiment of the present invention, all colors in the color family are used to participate in image matching, and the colors included in the color family are obtained by clustering colors included in some actual character images, thereby reducing real people due to illumination, shadow, and The influence of visual chromatic aberration or the like on the virtual character image improves the reliability of the data, and also improves the accuracy of searching for the image matching the virtual character image in the target image database.
本发明实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能单元可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。The division of the unit in the embodiment of the present invention is schematic, and is only a logical function division. In actual implementation, there may be another division manner. In addition, each functional unit in each embodiment of the present application may be integrated into one processing. In the device, it may be physically present alone, or two or more units may be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
其中,集成的单元既可以采用硬件的形式实现时,如图8所示的一种虚拟人物图像获取装置包括接收器901以及处理器902。处理器902,可以是一个中央处理单元(英文:central processing unit,简称CPU),或者为数字处理单元等等。其中,虚拟人物图像获取装置中还包括存储器903,用于存储处理器902执行的程序,处理器902用于执行存储器903存储的程序。存储器903还用于存储服装特征模板以及人物特征模板等等信息。When the integrated unit can be implemented in the form of hardware, a virtual person image acquiring device as shown in FIG. 8 includes a receiver 901 and a processor 902. The processor 902 can be a central processing unit (English: central processing unit, CPU for short), or a digital processing unit or the like. The virtual character image acquiring apparatus further includes a memory 903 for storing a program executed by the processor 902, and the processor 902 is configured to execute a program stored by the memory 903. The memory 903 is also used to store information such as a clothing feature template and a character feature template.
存储器903可以设置于所述虚拟人物图像获取装置内部,也可以设置于所述虚拟人物图像获取装置外部。虚拟人物图像获取装置还可以包括输入/输出接口904,用于通过输入/输出接口904将程序、以及配置信息写入存储器903中,将匹配得到的图像输出。The memory 903 may be disposed inside the avatar image acquisition device or may be disposed outside the avatar image acquisition device. The virtual character image obtaining means may further include an input/output interface 904 for writing a program and configuration information into the memory 903 through the input/output interface 904, and outputting the matched image.
其中,接收器901、存储器903、处理器902、输入/输出接口904可以通过总线905连接。其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The receiver 901, the memory 903, the processor 902, and the input/output interface 904 can be connected by a bus 905. The manner of connection between other components is merely illustrative and not limited. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
存储器903可以是易失性存储器,例如RAM;存储器903也可以是非易失性存储器,例如ROM,快闪存储器,HDD或SSD、或者存储器903是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器903可以是上述存储器的组合。The memory 903 can be a volatile memory, such as a RAM; the memory 903 can also be a non-volatile memory, such as a ROM, flash memory, HDD or SSD, or the memory 903 can be used to carry or store an instruction or data structure. The desired program code and any other medium that can be accessed by the computer, but is not limited thereto. The memory 903 may be a combination of the above memories.
处理器902,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像;The processor 902 is configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
接收器901,用于接收用户对所述处理器902初步确定的所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;The receiver 901 is configured to receive indication information about a clothing feature adjustment in the virtual character image that is initially determined by the processor 902, where the indication information includes location information to be adjusted and direction information.
所述处理器902,还用于基于填充算法对所述接收器901接收到的需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The processor 902 is further configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted received by the receiver 901 based on the filling algorithm to obtain the generated virtual character image.
在一种可能的设计中,所述处理器902,在基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像时,具体用于:In a possible design, the processor 902, when performing the filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm to obtain the generated virtual character image, is specifically used to:
若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。 If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
在一种可能的设计中,在所述接收器901接收到对所述虚拟人物图像中的服装特征调整的指示信息时,所述处理器902,还用于确定所述虚拟人物图像为锁定状态时,禁止对所述虚拟人物图像中的服装特征进行调整。In a possible design, when the receiver 901 receives the indication information about the adjustment of the clothing feature in the avatar image, the processor 902 is further configured to determine that the avatar image is in a locked state. When the clothing features in the virtual character image are prohibited from being adjusted.
通过上述方式可以实现服装在多维度上的调整,在提供的服装模板无法满足需求时,可以对服装进行自适应调整。Through the above manner, the adjustment of the garment in multiple dimensions can be realized, and when the provided clothing template cannot meet the demand, the garment can be adaptively adjusted.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While the preferred embodiment of the invention has been described, it will be understood that Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims (16)

  1. 一种图像搜索方法,其特征在于,包括:An image search method, comprising:
    获取生成的虚拟人物图像;Obtain the generated virtual character image;
    确定所述虚拟人物图像的各个像素的颜色;Determining a color of each pixel of the virtual character image;
    从颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;Obtaining a color family corresponding to the color of each pixel from the color family library; wherein the color family library is obtained by clustering corresponding colors of each pixel in a plurality of actual character images in advance, and each class corresponds to a color family, One color family corresponds to one basic color, and one color family includes multiple colors;
    使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。An image matching the virtual character image is searched in the target image database using a plurality of colors included in the color family of the respective pixels.
  2. 如权利要求1所述的方法,其特征在于,获取所述颜色族库,包括:The method of claim 1 wherein the obtaining the color family library comprises:
    获取若干实际人物图像;Obtaining images of several actual characters;
    分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;Obtaining, respectively, a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
    使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;The clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
    其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
  3. 如权利要求2所述的方法,其特征在于,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。The method of claim 2, wherein the color blocks describing the character features and the color information contained in the color patches describing the clothing features comprise: red, green, and blue RGB color components or hue, saturation, and lightness components.
  4. 如权利要求2或3所述的方法,其特征在于,分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块,包括:The method according to claim 2 or 3, wherein respectively acquiring the color blocks describing the character features included in each of the actual person images and the color blocks describing the clothing features, comprising:
    分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
    通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  5. 如权利要求1至4任一项所述的方法,其特征在于,获取生成的虚拟人物图像,包括:The method according to any one of claims 1 to 4, wherein the acquiring the generated virtual character image comprises:
    基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;Receiving, by the clothing feature template and the character feature template, the indication information of the clothing adjustment of the virtual character image, where the indication information includes position information and direction information to be adjusted;
    基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  6. 一种虚拟人物图像获取方法,其特征在于,包括:A method for acquiring a virtual character image, comprising:
    基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收用户对所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;Receiving, by the user, the indication information of the clothing feature adjustment in the virtual character image after the avatar image and the character feature template are initially determined, the indication information includes position information and direction information to be adjusted;
    基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  7. 如权利要求6所述的方法,其特征在于,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像,包括: The method according to claim 6, wherein the avatar image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm, including:
    若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  8. 如权利要求7所述的方法,其特征在于,还包括:The method of claim 7 further comprising:
    在接收到对所述虚拟人物图像中的服装特征调整的指示信息时,若确定所述虚拟人物图像为锁定状态,禁止对所述虚拟人物图像中的服装特征进行调整。Upon receiving the indication information for the clothing feature adjustment in the virtual character image, if it is determined that the virtual character image is in the locked state, the adjustment of the clothing feature in the virtual character image is prohibited.
  9. 一种图像搜索装置,其特征在于,包括:An image search device, comprising:
    接收器,用于获取生成的虚拟人物图像;a receiver, configured to acquire a generated virtual character image;
    处理器,用于确定所述接收器接收到的所述虚拟人物图像的各个像素的颜色;从获取到的颜色族库中分别获取各个像素的颜色对应的颜色族;其中,所述颜色族库为预先对若干实际人物图像中各个像素对应颜色进行聚类得到的,且每一类对应一个颜色族,一个颜色族对应一种基本颜色,且一个颜色族中包括多种颜色;使用各个像素的颜色族中包括的多种颜色在目标图像数据库中搜索与所述虚拟人物图像匹配的图像。a processor, configured to determine a color of each pixel of the virtual character image received by the receiver; and obtain, from the acquired color family library, a color family corresponding to a color of each pixel; wherein the color family library For pre-characterizing the corresponding colors of each pixel in a plurality of actual character images, and each class corresponds to one color family, one color family corresponds to one basic color, and one color family includes multiple colors; using each pixel A plurality of colors included in the color family search for an image matching the virtual character image in the target image database.
  10. 如权利要求9所述的装置,其特征在于,所述接收器,还用于获取若干实际人物图像;The device according to claim 9, wherein the receiver is further configured to acquire a plurality of actual person images;
    所述处理器,还用于通过如下方式获取所述颜色族库,包括:The processor is further configured to obtain the color family library by:
    分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块;所述人物特征为人物的生理特征,所述服装特征为人物身上的服装的相关信息;Obtaining, respectively, a color block describing a character feature included in each actual character image and a color block describing a clothing feature; the character feature is a physiological feature of the character, and the clothing feature is related information of the clothing on the character;
    使用聚类算法对各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块所包含的颜色信息进行聚类得到若干类,并确定每一类包括的若干颜色对应的基本颜色;The clustering algorithm is used to cluster the color blocks including the character features included in each actual character image and the color information included in the color block describing the clothing feature to obtain a plurality of classes, and determine a basic color corresponding to each color included in each class;
    其中每一类包括的若干颜色构成了一个颜色族。Each of these categories includes a number of colors that make up a color family.
  11. 如权利要求10所述的装置,其特征在于,所述描述人物特征的色块以及描述服装特征的色块所包含的颜色信息包括:红绿蓝RGB颜色分量或者色调、饱和度以及明度分量。The apparatus of claim 10, wherein the color blocks describing the character features and the color information contained in the color patches describing the clothing features comprise: red, green, and blue RGB color components or hue, saturation, and lightness components.
  12. 如权利要求10或11所述的装置,其特征在于,所述处理器,还用于通过如下方式分别获取各个实际人物图像包括的描述人物特征的色块以及描述服装特征的色块,包括:The device according to claim 10 or 11, wherein the processor is further configured to respectively acquire color blocks describing the character features included in each actual character image and color blocks describing the clothing features, including:
    分别去除每个实际人物图像的背景区域得到包括每个实际人物图像的前景图像的掩膜MASK图像;Removing the background area of each actual character image separately to obtain a mask MASK image including the foreground image of each actual character image;
    通过边缘检测算法去除所述各个实际人物图像的前景图像的掩膜MASK图像包括的人物装饰物的颜色块得到描述人物特征的颜色块以及描述服装特征的颜色块。The color block of the character ornament included in the mask MASK image of the foreground image of the respective actual character image is removed by an edge detection algorithm to obtain a color block describing the character feature and a color block describing the clothing feature.
  13. 如权利要求9至12任一项所述的装置,其特征在于,所述接收器,还用于:The device according to any one of claims 9 to 12, wherein the receiver is further configured to:
    在所述处理器基于服装特征模板以及人物特征模板初步确定虚拟人物图像后,接收对所述虚拟人物图像的服装调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息;After the processor initially determines the avatar image based on the clothing feature template and the character feature template, receiving indication information of the clothing adjustment of the avatar image, where the indication information includes location information and direction information to be adjusted;
    所述处理器还用于:The processor is further configured to:
    基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The generated virtual character image is obtained by performing a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  14. 一种虚拟人物图像获取装置,其特征在于,包括:A virtual character image acquiring device, comprising:
    处理器,用于基于服装特征模板以及人物特征模板初步确定虚拟人物图像;a processor, configured to initially determine a virtual character image based on the clothing feature template and the character feature template;
    接收器,用于接收用户对所述处理器初步确定的所述虚拟人物图像中的服装特征调整的指示信息,所述指示信息包括需调整的位置信息以及方向信息; a receiver, configured to receive, by the user, indication information about a clothing feature adjustment in the virtual character image that is initially determined by the processor, where the indication information includes location information to be adjusted and direction information;
    所述处理器,还用于基于填充算法对所述接收器接收到的需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。The processor is further configured to perform a filling process on the area included in the clothing corresponding to the position information to be adjusted received by the receiver based on the filling algorithm to obtain the generated virtual character image.
  15. 如权利要求14所述的装置,其特征在于,所述处理器,在基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像,具体用于:The device according to claim 14, wherein the processor performs a filling process on the area included in the clothing corresponding to the position information to be adjusted based on the filling algorithm to obtain the generated virtual character image, specifically for:
    若确定所述虚拟人物图像为自适应调整状态时,基于填充算法对所述需调整的位置信息对应的服装包括的区域进行填充处理得到生成的虚拟人物图像。If it is determined that the avatar image is in an adaptive adjustment state, the generated avatar image is obtained by performing a filling process on the region included in the clothing corresponding to the position information to be adjusted based on the filling algorithm.
  16. 如权利要求15所述的装置,其特征在于,还包括:The device of claim 15 further comprising:
    在所述接收器接收到对所述虚拟人物图像中的服装特征调整的指示信息时,所述处理器,还用于确定所述虚拟人物图像为锁定状态时,禁止对所述虚拟人物图像中的服装特征进行调整。 When the receiver receives the indication information about the adjustment of the clothing feature in the avatar image, the processor is further configured to: when the avatar image is determined to be in a locked state, prohibiting the image in the avatar The clothing features are adjusted.
PCT/CN2017/076466 2016-03-14 2017-03-13 Image search method, and virtual character image acquisition method and device WO2017157261A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610143234.0A CN107193816B (en) 2016-03-14 2016-03-14 Image searching method, virtual character image obtaining method and device
CN201610143234.0 2016-03-14

Publications (1)

Publication Number Publication Date
WO2017157261A1 true WO2017157261A1 (en) 2017-09-21

Family

ID=59850611

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/076466 WO2017157261A1 (en) 2016-03-14 2017-03-13 Image search method, and virtual character image acquisition method and device

Country Status (2)

Country Link
CN (1) CN107193816B (en)
WO (1) WO2017157261A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7792887B1 (en) * 2002-05-31 2010-09-07 Adobe Systems Incorporated Compact color feature vector representation
CN102663391A (en) * 2012-02-27 2012-09-12 安科智慧城市技术(中国)有限公司 Image multifeature extraction and fusion method and system
CN103530903A (en) * 2013-10-28 2014-01-22 智慧城市系统服务(中国)有限公司 Realizing method of virtual fitting room and realizing system thereof
US8891902B2 (en) * 2010-02-16 2014-11-18 Imprezzeo Pty Limited Band weighted colour histograms for image retrieval
CN105069042A (en) * 2015-07-23 2015-11-18 北京航空航天大学 Content-based data retrieval methods for unmanned aerial vehicle spying images
CN105205171A (en) * 2015-10-14 2015-12-30 杭州中威电子股份有限公司 Image retrieval method based on color feature

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5974192A (en) * 1995-11-22 1999-10-26 U S West, Inc. System and method for matching blocks in a sequence of images
US8811734B2 (en) * 2011-08-05 2014-08-19 Rakuten, Inc. Color determination device, color determination system, color determination method, information recording medium, and program
CN102982350B (en) * 2012-11-13 2015-10-28 上海交通大学 A kind of station caption detection method based on color and histogram of gradients
CN104809245A (en) * 2015-05-13 2015-07-29 信阳师范学院 Image retrieval method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7792887B1 (en) * 2002-05-31 2010-09-07 Adobe Systems Incorporated Compact color feature vector representation
US8891902B2 (en) * 2010-02-16 2014-11-18 Imprezzeo Pty Limited Band weighted colour histograms for image retrieval
CN102663391A (en) * 2012-02-27 2012-09-12 安科智慧城市技术(中国)有限公司 Image multifeature extraction and fusion method and system
CN103530903A (en) * 2013-10-28 2014-01-22 智慧城市系统服务(中国)有限公司 Realizing method of virtual fitting room and realizing system thereof
CN105069042A (en) * 2015-07-23 2015-11-18 北京航空航天大学 Content-based data retrieval methods for unmanned aerial vehicle spying images
CN105205171A (en) * 2015-10-14 2015-12-30 杭州中威电子股份有限公司 Image retrieval method based on color feature

Also Published As

Publication number Publication date
CN107193816B (en) 2021-03-30
CN107193816A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
US9396560B2 (en) Image-based color palette generation
US9741137B2 (en) Image-based color palette generation
US9552656B2 (en) Image-based color palette generation
US9478054B1 (en) Image overlay compositing
US9311889B1 (en) Image-based color palette generation
CN110390632B (en) Image processing method and device based on dressing template, storage medium and terminal
WO2018094653A1 (en) User hair model re-establishment method and apparatus, and terminal
CN105321171B (en) Image segmentation for live camera feeds
US20150254501A1 (en) Makeup supporting device, makeup supporting system, makeup supporting method, and non-transitory computer-readable recording medium
AU2016225946A1 (en) Style transfer for headshot portraits
CN111383232B (en) Matting method, matting device, terminal equipment and computer readable storage medium
US9661886B1 (en) System and method for capturing design state of apparel or accessory to enable extrapolation for style and size variants
US20190197343A1 (en) Product image generation system
JP2009124231A (en) Image correction device, and image correction method
CN105405157A (en) Portrait Generating Device And Portrait Generating Method
CN105678714B (en) Image processing method and device
CN110728620A (en) Image processing method and device and electronic equipment
CN107154046A (en) A kind of method of video background processing and secret protection
CN109949207A (en) Virtual objects synthetic method, device, computer equipment and storage medium
CN110084219B (en) Interface interaction method and device
CN113052783A (en) Face image fusion method based on face key points
WO2017157261A1 (en) Image search method, and virtual character image acquisition method and device
KR20180108799A (en) Method and apparatus for editing a facial model
CN112785683B (en) Face image adjusting method and device
JP2016066383A (en) Makeup support device and makeup support method

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17765803

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17765803

Country of ref document: EP

Kind code of ref document: A1