WO2023078281A1 - 图片处理方法、装置、设备、存储介质和程序产品 - Google Patents
图片处理方法、装置、设备、存储介质和程序产品 Download PDFInfo
- Publication number
- WO2023078281A1 WO2023078281A1 PCT/CN2022/129170 CN2022129170W WO2023078281A1 WO 2023078281 A1 WO2023078281 A1 WO 2023078281A1 CN 2022129170 W CN2022129170 W CN 2022129170W WO 2023078281 A1 WO2023078281 A1 WO 2023078281A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- text
- picture
- rendered
- processed
- template
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/60—Creating or editing images; Combining images with text
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/10—Texturing; Colouring; Generation of textures or colours
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30168—Image quality inspection
Definitions
- the present disclosure relates to the technical field of image processing, and in particular to an image processing method, device, equipment, storage medium and program product.
- video recommendation is performed by displaying recommended pictures to users.
- an embodiment of the present disclosure provides a picture processing method, the method includes: determining N text areas and M text pattern types of the picture to be processed, where N and M are integers greater than or equal to 1, so Said N is greater than or equal to M; For one or more text areas in the N text areas, use one or more text pattern types in the M text pattern types for rendering to obtain one or more first rendered pictures; Inputting the one or more first rendered pictures into a scoring model to obtain scores of the one or more first rendered pictures; and determining a target picture according to the scores of the one or more first rendered pictures.
- an embodiment of the present disclosure provides an image processing device, the device including: a text area and color determination module, configured to determine N text areas and M text pattern types of the image to be processed, wherein N and M is an integer greater than or equal to 1, and the N is greater than or equal to M; the first rendering module is configured to use one or more texts in the M text pattern types for one or more text areas in the N text areas The pattern type is rendered to obtain one or more first rendered pictures; the scoring determination module is configured to input one or more first rendered pictures into the scoring model to obtain the scores of one or more first rendered pictures; and a target picture determining module, configured to determine a target picture according to the scores of one or more first rendered pictures.
- an embodiment of the present disclosure provides an electronic device, and the electronic device includes: one or more processors; and a storage device for storing one or more programs; when the one or more programs are executed The one or more processors are executed, so that the one or more processors implement the picture processing method according to any one of the first aspect above.
- an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the image processing method described in any one of the above-mentioned first aspects is implemented.
- an embodiment of the present disclosure provides a computer program product, the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, the image processing described in any one of the above first aspects is realized method.
- an embodiment of the present disclosure provides a computer program, including: an instruction, which when executed by a processor causes the processor to execute the image processing method according to any one of the above first aspect.
- FIG. 1 is a flow chart of an image processing method in an embodiment of the present disclosure
- Fig. 2 is a schematic diagram of N text areas provided by an embodiment of the present disclosure
- FIG. 3 is a flow chart of an image processing method in an embodiment of the present disclosure
- FIG. 4 is a flow chart of an image processing method in an embodiment of the present disclosure.
- FIG. 5 is a flow chart of an image processing method in an embodiment of the present disclosure.
- Fig. 6 is a schematic diagram of a deduction item in an embodiment of the present disclosure.
- FIG. 7 is a schematic structural diagram of an image processing device in an embodiment of the present disclosure.
- Fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
- the term “comprise” and its variations are open-ended, ie “including but not limited to”.
- the term “based on” is “based at least in part on”.
- the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
- the inventors of the present disclosure found that, in the related art, for the recommended pictures displayed to the user, the post-workers need to manually render the recommended pictures, but the efficiency of manual rendering is low.
- the embodiments of the present disclosure provide a picture processing method, device, equipment, storage medium and program product, which place the given text in the picture harmoniously and beautifully, realizing the fast rendering.
- the embodiment of the present disclosure provides a picture processing method, which can be applied to many different application scenarios. For example, it can be applied to video application programs, such as audio-visual application programs or short video application programs.
- the client receives the video uploaded by the user, selects a frame from the video as the cover background image, and determines the text added on the cover background image, and adds the above text to the cover background through the image processing method provided by the embodiment of the present disclosure image, forming the cover of this video.
- the client receives the product picture and product description text uploaded by the user, and adds the above product description text to the product picture through the image processing method provided by the embodiment of the present disclosure to form a product picture or advertisement design drawing with a text description.
- the picture processing method provided by the embodiment of the present disclosure is not limited to the above-mentioned several application scenarios, and it is only a schematic illustration here.
- FIG. 1 is a flowchart of an image processing method in an embodiment of the present disclosure. This embodiment is applicable to the situation of adding a text effect to any picture, the method can be executed by a picture processing device, the picture processing device can be realized by software and/or hardware, and the picture processing device can be configured in an electronic device middle.
- the electronic equipment may be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile handset, a station, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, Netbook Computers, Tablet Computers, Personal Communication System (PCS) Devices, Personal Navigation Devices, Personal Digital Assistants (PDAs), Audio/Video Players, Digital Still/Video Cameras, Pointing Devices, Television Receivers, Radio Broadcast Receivers, Electronic Books devices, gaming devices, or any combination thereof, including accessories and peripherals for such devices, or any combination thereof.
- PCS Personal Communication System
- PDAs Personal Digital Assistants
- Audio/Video Players Audio/Video Players
- Digital Still/Video Cameras Pointing Devices
- Television Receivers Radio Broadcast Receivers
- Electronic Books devices Electronic Books devices, gaming devices, or any combination thereof, including accessories and peripherals for such devices, or any combination thereof.
- the electronic device may be a server, wherein the server may be a physical server or a cloud server, and the server may be a server or a server cluster.
- the image processing method provided by the embodiment of the present disclosure mainly includes the following steps S101 to S104.
- N text areas and M text pattern types of the image to be processed are determined, wherein N and M are integers greater than or equal to 1, and N is greater than or equal to M.
- the picture to be processed may be any given picture.
- it can be a photo that needs to be added with a text description, or any video frame extracted from the video, or a product image that needs to be designed for advertising, etc.
- the picture to be processed may be a picture directly uploaded by the user, for example, on a shopping website, an advertisement design website, or a photo design website, the user directly uploads a picture to the client.
- the picture to be processed may be a picture to be processed determined from a video uploaded by a user.
- a video frame arbitrarily selected from the above videos, or a video frame specified by the user, or a picture after splicing multiple video frames.
- the picture to be processed may also be a picture selected from a gallery according to the text information uploaded by the user. For example: in a music application program, according to the playlist selected by the user, the singer of a certain song in the playlist is used as the image to be processed.
- the text region can be understood as a connected region in which text is added in the picture to be processed.
- the text area refers to an area that will not cause the subject of the picture to be blocked after text is added to the picture to be processed.
- the text area cannot be a human face area in the picture to be processed.
- N text regions refer to connected regions of N characters, that is, connected regions of N different positions. As shown in Figure 2, text-connected regions placed at N positions.
- the text added in the text area may be the text input by the user received by the client, for example: the user's description of the product in the product picture.
- the text added in the text area can be the name of the video extracted by the client, for example: when the picture to be processed is a video frame, the text can be a movie or TV name.
- the above-mentioned text can be any existing writable text such as Chinese characters, English, Korean, Greek letters, Arabic numerals, etc., or any writable text such as "%", "@", “&”, etc. symbol.
- N connected regions in the picture to be processed are arbitrarily selected as text regions of the picture to be processed.
- the image to be processed is input into a pre-trained image-text matching model, the target template corresponding to the image to be processed is determined, and the positions of N text regions are determined based on the positions of the text regions in the target template.
- the pattern type can be understood as a special effect of text filling or frame.
- the target pattern type may be any one or more of target color, target texture, target effect, and the like.
- the target color may be a color corresponding to one color value, or may be a gradient color corresponding to multiple color values.
- the target texture can be understood as a text filling texture, where the target texture can be a system default texture, or the target texture can be determined in response to a texture selection operation input by a user.
- the target effect may be one or a combination of adding shadows, reflections, adding text borders, lighting, three-dimensional effects, and the like.
- the type of each character pattern in the text area may be the same or different, which is not limited in this embodiment.
- step S102 for one or more text regions in the N text regions, one or more text pattern types in the M text pattern types are used for rendering to obtain one or more first rendered images.
- the term “one or more” also means “at least one”, and the following are similar.
- Fig. 2 is a schematic diagram of N text areas provided by an embodiment of the present disclosure.
- a picture can include text area 1, text area 2, ..., text area n, N text areas, for one or more text areas, use one or more text pattern types for rendering , to obtain one or more first rendered pictures.
- m text pattern types are used for rendering.
- the text area 1 is rendered using m text pattern types respectively, and m first rendered pictures are obtained, wherein m is less than or equal to M.
- the m first rendered pictures obtained in this way are in a text area, and the types of rendered text patterns are different.
- n text regions are rendered by using one text pattern type to obtain n first rendered pictures, wherein n is less than or equal to N.
- the m first rendered pictures obtained in this way are characters of the same text pattern type distributed in different regions of the picture.
- n text areas For example: for n text areas, m text pattern types are used for rendering respectively, and n ⁇ m first rendered pictures are obtained, wherein n is less than or equal to N, and m is less than or equal to M.
- m text pattern types for rendering in text area 1 to obtain m first rendered pictures
- n m text pattern types are respectively used for rendering to obtain m first rendered pictures.
- the n text areas are respectively rendered using m text pattern types to obtain n ⁇ m first rendered pictures.
- step S103 the one or more first rendered pictures are input into the scoring model to obtain the scores of the one or more first rendered pictures.
- a scoring model is used to score each first rendered picture, and a target picture is determined according to the scoring result.
- a target picture is determined according to the scores of the one or more first rendered pictures.
- the target image can be used as a cover image of a video, a cover image of a song list, or a promotional image of a product.
- determining the target picture according to the scores of one or more first rendered pictures includes: inputting the one or more first rendered pictures into a scoring model to obtain the scores of each first rendered picture; Sorting from largest to smallest, displaying several first rendered images that are ranked first on the client side, and determining the target image in response to the user's selection operation on the first rendered image.
- the first rendered pictures with the highest scores are displayed to the user, and the user selects the target picture, which enables the user to select the target picture, which is convenient for the user to choose according to his/her preference.
- the first rendered picture with the highest score is determined as the target picture, which can avoid the problem of manual rendering of the recommended picture by the staff in the later stage, and place the given text in the picture harmoniously and beautifully, so as to realize the rapid rendering of the picture .
- the embodiment of the present disclosure discloses a picture processing method, including: determining N text areas and M text pattern types of the picture to be processed, and using M text pattern types for one or more text areas in the N text areas Render one or more text pattern types to obtain one or more first rendered pictures; input one or more first rendered pictures to the scoring model to obtain the scores of one or more first rendered pictures; A target picture is determined according to the scores of the one or more first rendered pictures.
- the embodiments of the present disclosure use multiple text regions and text pattern types to render the picture, score the rendered picture, obtain the target picture, place the given text in the picture harmoniously and beautifully, and realize the fast rendering of the picture. This avoids the problem of manual rendering of recommended pictures by post-workers.
- the embodiment of the present disclosure optimizes the process of "determining N text regions of the picture to be processed", as shown in FIG. 3 , the optimized process mainly includes the following steps S301 to S303.
- step S301 the category of the picture to be processed is determined.
- the category of the picture to be processed is mainly determined according to the subject in the picture.
- the picture categories can include: people, beach, buildings, cars, cartoons, cats, dogs, flowers, things, co-shots, mountains, indoors, lakes (including the sea), night scenes, selfies, sky, sculptures, street scenes, Sunsets, text, trees, etc.
- the image category is mainly used to classify the images to be processed.
- the category of the picture to be processed can be obtained from the label information of the picture to be processed, or the subject feature in the picture to be processed can be extracted by means of image recognition, and the category of the picture to be processed can be determined based on the subject feature.
- the subject feature extracted from the picture to be processed is a building
- it is determined that the type of the picture to be processed is a building.
- step S302 a target template is determined based on the category of the picture to be processed.
- the target template can be understood as a reference picture when the picture to be processed is rendered, that is, the position of the text region in the picture to be processed can be determined with reference to the target template.
- a template refers to one or more pictures to which text effects are added, and template information describes information about the pictures.
- the template includes template background image and template information.
- the template background image can understand one or more images with text effects added.
- Template information includes template ID (identification), template title, text font size, number of text lines, font name, font size, text pattern type color matching rules or template classification labels, etc.
- the category of the template can be obtained by reading the template classification label in the template information; the template whose category is consistent with the category of the picture to be processed is determined as the target template.
- a template whose template type is a person may be determined as a target template.
- the category of the picture to be processed is the sea, and the template whose template type is the sea can be determined as the target template.
- target template may be one template or multiple templates, which is not specifically limited in this embodiment.
- determining a target template based on the category of the picture to be processed includes: determining a template candidate set based on the category of the picture to be processed and template information; selecting a target template corresponding to the picture to be processed from the template candidate set. target template.
- a template consistent with the category of the image to be processed is searched in the template library and determined as a template candidate set.
- some templates are screened out according to the category of the picture to be processed, and a target template is selected from a limited set, which reduces the scope of template selection and improves template selection efficiency.
- any template in the template candidate set may be selected as the target template.
- selecting the target template corresponding to the picture to be processed from the template candidate set includes: determining the template background image and the picture to be processed for one or more templates in the template candidate set image matching degree between; determine the image-text matching degree between the template information and the picture to be processed; determine the target corresponding to the picture to be processed based on the image matching degree and/or the image-text matching degree template.
- the image matching degree D_ii can be understood as the degree of similarity between the template background image and the image to be processed, wherein a higher image matching degree indicates a higher degree of similarity between the two images.
- the graphic-text matching degree D_it can be understood as the matching degree between the language description and the picture, wherein the higher the graphic-text matching degree D_it, the higher the similarity between the language description and the picture.
- the language description is “elephants and forests”, and the picture is a sea, it means that the matching degree D_it of pictures and texts is low.
- the language description is "elephant and forest”, and the picture is an elephant resting in the woods, which means that the image-text matching degree D_it is high.
- Determining a target template corresponding to the image to be processed based on the image matching degree includes: determining a template with the highest image matching degree as the target template corresponding to the image to be processed.
- Determining a target template corresponding to the image to be processed based on the image-text matching degree includes: determining a template with the highest image-text matching degree as the target template corresponding to the image-to-be-processed image.
- Determining the target template corresponding to the picture to be processed based on the image matching degree and the graphic-text matching degree includes: summing the image matching degree and the graphic-text matching degree, and calculating the template corresponding to the maximum sum value Determined as the target template.
- the target template is determined by the distance between pictures and the distance between pictures and texts, so that the target template is highly similar to the picture to be processed, and the picture rendering effect is improved.
- step S303 N text regions of the picture to be processed are determined based on the target template.
- the embodiment of the present disclosure optimizes the process of "determining N text regions of the picture to be processed based on the target template", as shown in Figure 4, the optimized process mainly includes Steps S401 to S403 are as follows.
- step S401 a text region candidate set is determined based on the text regions in the background image of the target template.
- relevant information of the text area is obtained from the target template information and the background image of the target template.
- the size of the text area is determined according to the word count and font size of the text.
- the font size of the text is the font size of the text in the target template.
- the product of the width of a single font corresponding to the font size of the text and the number of characters of the text is used as the width of the text area, and the height of the single font corresponding to the font size of the text is used as the height of the text area.
- the position of the text area in the target template is determined, and the position of the text area in the target template is adjusted to obtain multiple text area positions, and the multiple text area positions are used as a text area candidate set.
- the text area in the target template is in the center of the background image of the template, and the position of the text area is adjusted to obtain the positions of multiple text areas. For example: move 10 pixels to the left, 10 pixels to the right, 10 pixels up, 10 pixels down, etc.
- the specific adjustment strategy in this embodiment is only described as an example rather than a limitation.
- step S402 one or more text candidate regions in the text region candidate set are rendered to obtain one or more second rendered pictures.
- one or more text candidate regions are respectively rendered into the picture to be processed using the same pattern type to obtain one or more second rendered pictures.
- the above-mentioned same pattern type may be any color or texture, which is not limited in this embodiment.
- the above-mentioned same pattern type is black or white.
- N text regions are determined based on the texture complexity of one or more second rendered pictures.
- the texture complexity of the text region in each second rendered picture is determined to obtain the texture complexity corresponding to each second rendered picture.
- the above texture complexity is sorted in descending order, and the top N text candidate regions with texture complexity are determined as text regions.
- determining N text regions based on the texture complexity of one or more of the second rendered pictures includes: for one or more of the second rendered pictures, determining text candidates in the second rendered pictures The texture complexity of the region; inputting the second rendered image into the scoring model to obtain a first scoring result; determining N text regions based on the texture complexity and the first scoring result.
- determining N text regions based on the texture complexity and the first scoring result includes: for one or more of the second rendered pictures, determining A first weighted value calculated from the scoring result; sort the first weighted values from large to small; determine the text candidate areas corresponding to the top N first weighted values as text areas.
- one or more second rendered pictures are input into the scoring model to obtain the first scoring result corresponding to the second rendered picture; meanwhile, the texture complexity of the text region in the second rendered picture is calculated; A weighted calculation is performed on the first scoring result and the texture complexity to obtain a first weighted value.
- the embodiment of the present disclosure optimizes the process of "determining the M text pattern types of the image to be processed", as shown in FIG. 5 , the optimized process mainly includes the following steps S501 to S504.
- step S501 the image to be processed is converted into HSV color space.
- the HSV color space expresses a color through three parameters of chroma (H), saturation (S), and brightness (V), and the HSV color space is a three-dimensional representation of the RGB color system.
- the chromaticity (H) component is measured by angle, and the value range is 0° to 360°. It is calculated counterclockwise from red, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: 60° for yellow, 180° for cyan, and 300° for violet.
- the chrominance component in the HSV color space of the entire picture to be rendered is extracted from the background color information of the picture to be rendered.
- step S502 for one or more pixels (that is, at least one pixel) in the picture to be processed, the chromaticity value in the HSV color space is acquired.
- the entire image to be rendered is converted into the HSV color space, and the chromaticity values in the HSV color space are obtained.
- the image corresponding to the text area in the picture to be rendered is converted to the HSV color space, and the chromaticity value in the HSV color space is obtained.
- step S503 the text color candidate set is determined based on the chromaticity values of one or more pixel points.
- the text target color is determined based on the average value of the chroma component H_Avg, the average value of the saturation component S_Avg and the average value of the brightness component V_Avg.
- the chromaticity value extracted from the picture to be rendered, or the chromaticity value extracted from the image corresponding to the text area of the picture to be rendered, and the average value of chromaticity corresponding to multiple pixels is calculated to obtain the color degree average H_Avg.
- step S504 M text colors are selected from the text color candidate set.
- M colors can be arbitrarily selected in the color candidate set. It is also possible to select a color whose saturation is greater than a saturation threshold or whose brightness is greater than a brightness threshold in the color candidate set to determine M text pattern types.
- N text areas are determined, and one or more text areas in the N text areas are rendered using one or more text candidate colors in the text color candidate set, and each text area can obtain one or more A plurality of third rendering pictures, based on determining a text color corresponding to the text area in one or more third rendering pictures. Repeat the above operations for N text areas to obtain N text colors. Determine M text colors from N text colors.
- selecting M text colors from the text color candidate set includes: for one or more text regions, using one or more text candidate colors in the text color candidate set to render respectively, to obtain multiple a third rendering picture; M text colors are determined based on the background contrast of the third rendering picture.
- the text area 1 is rendered with multiple candidate colors for the text to obtain multiple third rendered pictures, and the background contrast of the text area in each third rendered picture is determined.
- the text color candidate used in the third rendered picture with the highest background contrast is determined as the text color.
- a text area determines a text color
- N text areas determine N text colors
- M text colors are selected from the N text colors.
- determining M text colors based on the background contrast of the third rendered picture includes: for one or more third rendered pictures, determining the background contrast of the text region in the third rendered picture; The third rendered picture is input to the scoring model to obtain a second scoring result; determine a second weighted value calculated according to the background contrast and the second scoring result; determine the text based on the second weighted value The M text colors corresponding to the region.
- the text area 1 is rendered with multiple candidate colors for the text to obtain multiple third rendered pictures, and the background contrast of the text area in each third rendered picture is determined.
- each third rendered picture is input into the scoring model to obtain a second scoring result corresponding to the third rendered picture; weighted calculation is performed on the second scoring result and the background contrast to obtain a second weighted value.
- the above operations are performed on multiple third rendered images to obtain multiple second weighted values, and the color corresponding to the largest weighted value among the multiple weighted values is used to determine the text color corresponding to the text area. For N text areas, perform the above operations to obtain N text colors.
- N text color values are compared, and only one of the colors with the same color value is retained to filter out the colors with the same color value, and M different text colors are obtained, where M is smaller than N.
- N text pattern type values are compared, and if all text pattern type values are different, M text pattern types are directly determined from the N text pattern types, where M is equal to N.
- the method for training the scoring model includes: performing data labeling on the sample pictures according to the picture quality of the sample pictures; and training the sample pictures after data labeling to obtain the scoring model.
- data labeling is performed first.
- Data labeling is generally a subjective process.
- an objective/subjective data labeling process is constructed to separate the objectively labeled part of the data to improve the accuracy of data labeling.
- After labeling the data it is used to train a 5-category classification model, but the model scoring is obtained by averaging the scores of the 5 categories and mapping them to the corresponding scores to obtain the scoring model.
- the sample picture is scored according to its quality, and if the image of the sample picture is wrongly displayed, the image is particularly blurred, or the image is rotated, the mark is discarded. Among them, a picture with a blurred background is not considered a blurred image.
- the correlation between the text content and the image is not considered, only whether the text area makes the whole image harmonious and beautiful, only the top three texts with the largest font size in the image are considered, and other texts or font sizes that are too small are not considered.
- scoring is based on subjective dimensions. For example: the position of the text area makes the overall composition harmonious and beautiful. Generally, it will be placed in a position opposite to the subject or in a blank position. The score can be increased or decreased appropriately, and it can be preset when marking.
- the deduction items based on the objective dimension for example: the text occludes the salient target in the image (for example: occludes the eyes or more than 1/2 of the overall occlusion, as shown in Figure 6) and deducts the preset points according to the occlusion range ; If the picture includes the main person and the non-main person, that is, the current condition does not need to be considered for occlusion of the non-main person, and the following conditions can be considered. Among them, if the title is too small or there is no title, the preset score will be deducted; or if the text overlaps, the preset score will be deducted according to the text overlap rate.
- the text pattern type is similar to the background color of the area where the text is located, and the preset score is cut out according to the similarity of the color; among them, the main body is in the middle of the image, and the text is offset to the left and right sides, or the text and the main body are in the same image. side, making the overall composition of the image unbalanced, and cutting out the preset score.
- Fig. 7 is a schematic structural diagram of an image processing device in an embodiment of the present disclosure. This embodiment is applicable to the situation of adding a text effect to any picture.
- the picture processing device can be realized by software and/or hardware.
- the image processing device can be configured in electronic equipment.
- the image processing device mainly includes: a text area and color determination module 71 , a first rendering module 72 , a scoring determination module 73 and a target image determination module 74 .
- the text area and color determination module 71 is configured to determine N text areas and M text pattern types of the picture to be processed, wherein N and M are integers greater than or equal to 1, and said N is greater than or equal to M.
- the first rendering module 72 is configured to use one or more text pattern types among the M text pattern types to render one or more text regions among the N text regions, and obtain one or more first rendered images.
- a score determining module 73 configured to input one or more first rendered pictures into a scoring model to obtain scores of the one or more first rendered pictures.
- a target picture determining module 74 configured to determine a target picture according to the scores of one or more first rendered pictures.
- the embodiment of the present disclosure discloses a picture processing device, which is used to perform the following steps: determine N text areas and M text pattern types of the picture to be processed, and use M for one or more text areas in the N text areas
- One or more text pattern types in the text pattern types are rendered to obtain one or more first rendered images; one or more of the first rendered images are input into the scoring model to obtain one or more first rendered images Score of the picture; determining the target picture according to the score of one or more first rendered pictures.
- the embodiments of the present disclosure use multiple text regions and text pattern types to render the picture, score the rendered picture, obtain the target picture, place the given text in the picture harmoniously and beautifully, and realize the fast rendering of the picture. This avoids the problem of manual rendering of recommended pictures by post-workers.
- the text area and color determination module includes a text area determination module and a text pattern type determination module.
- the text area determination module includes: a picture type determination unit, configured to determine the category of the picture to be processed; a target template determination unit, configured to determine a target template based on the category of the picture to be processed; and a text area A determining unit, configured to determine N text regions of the picture to be processed based on the target template.
- the target template determining unit is specifically configured to determine a template candidate set based on the category of the picture to be processed and template information; and select a target template corresponding to the picture to be processed from the template candidate set.
- the template includes a template background image.
- the target template determination unit is specifically configured to determine the image matching degree between the template background image and the image to be processed for one or more templates in the template candidate set; determine the template information and the image to be processed A graphic-text matching degree between pictures; and determining a target template corresponding to the picture to be processed based on the image matching degree and/or the graphic-text matching degree.
- the text region determining unit is specifically configured to determine a text region candidate set based on the text region in the background image of the target template; render one or more text region candidate regions in the text region candidate set to obtain one or a plurality of second rendered pictures; and determining N text regions based on the texture complexity of one or more of the second rendered pictures.
- the text area determining unit is specifically configured to determine N text areas based on the texture complexity of one or more of the second rendered pictures, including: for one or more of the second rendered pictures, determining The texture complexity of the character candidate area in the second rendered picture; input the second rendered picture into the scoring model to obtain a first scoring result; and determine N based on the texture complexity and the first scoring result text area.
- the text area determination unit is specifically configured to determine a first weighted value calculated according to the texture complexity and the first scoring result for one or more of the second rendered pictures; The first weighted values are sorted from large to small; and the text candidate areas corresponding to the top N first weighted values are determined as text areas.
- the character pattern type determination module includes: a picture conversion unit, configured to convert the picture to be processed into an HSV color space; a chroma value extraction unit, used for one or a plurality of pixels, obtaining the chromaticity value in the HSV color space; a text color candidate set determination unit, configured to determine the text color candidate set based on the chromaticity values of one or more pixel points; and a text color determination unit , for selecting M text colors from the text color candidate set.
- the text color determining unit is specifically configured to select M text colors from the text color candidate set, including: using one or more texts in the text color candidate set for one or more text regions
- the candidate colors are rendered respectively to obtain multiple third rendered pictures; and M text colors are determined based on the background contrast of the third rendered pictures.
- the text color determination unit is specifically configured to, for one or more third rendered pictures, determine the background contrast of the text area in the third rendered picture; input the third rendered picture into the scoring A model to obtain a second scoring result; determine a second weighted value calculated according to the background contrast and the second scoring result; and determine M text colors corresponding to the text region based on the second weighted value.
- the device further includes: a scoring model training module, configured to perform data labeling on the sample pictures according to the picture quality of the sample pictures, and train the sample pictures after data labeling to obtain the scoring model .
- a scoring model training module configured to perform data labeling on the sample pictures according to the picture quality of the sample pictures, and train the sample pictures after data labeling to obtain the scoring model .
- the image processing device provided by the embodiment of the present disclosure can execute the steps performed in the image processing method provided by the method embodiment of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.
- FIG. 8 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Referring specifically to FIG. 8 , it shows a schematic structural diagram of an electronic device 800 suitable for implementing an embodiment of the present disclosure.
- the electronic device 800 in the embodiment of the present disclosure may include, but is not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals ( Mobile terminals such as car navigation terminals), wearable terminal devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc.
- the terminal device shown in FIG. 8 is only an example, and should not limit the functions and scope of use of this embodiment of the present disclosure.
- an electronic device 800 may include a processing device (such as a central processing unit, a graphics processing unit, etc.)
- the program in the memory (RAM) 803 executes various appropriate actions and processes to realize the image processing method according to the embodiment of the present disclosure.
- various programs and data necessary for the operation of the terminal device 800 are also stored.
- the processing device 801, ROM 802, and RAM 803 are connected to each other through a bus 804.
- An input/output (I/O) interface 805 is also connected to the bus 804 .
- the following devices can be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration an output device 807 such as a computer; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809.
- the communication means 809 may allow the terminal device 800 to perform wireless or wired communication with other devices to exchange data. While FIG. 8 shows a terminal device 800 having various means, it is to be understood that implementing or possessing all of the illustrated means is not a requirement. More or fewer means may alternatively be implemented or provided.
- the processes described above with reference to the flowcharts can be implemented as computer software programs.
- the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, and the computer program includes program code for executing the method shown in the flow chart, thereby realizing the above The page jump method described above.
- the computer program may be downloaded and installed from a network via communication means 809, or from storage means 808, or from ROM 802.
- the processing device 801 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
- the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
- a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
- Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
- the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
- HTTP HyperText Transfer Protocol
- the communication eg, communication network
- Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
- a computer readable storage medium is a non-transitory computer readable storage medium.
- the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the terminal device, the terminal device: determines N text areas and M text pattern types of the picture to be processed, wherein, N and M are integers greater than or equal to 1, and said N is greater than or equal to M; for one or more text areas in the N text areas, use one or more text pattern types in the M text pattern types for rendering , to obtain one or more first rendered pictures; input one or more first rendered pictures to the scoring model to obtain the scores of one or more first rendered pictures; and according to the score of one or more first rendered pictures Scoring determines the target image.
- the terminal device may also perform other steps described in the foregoing embodiments.
- Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
- the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
- LAN local area network
- WAN wide area network
- Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
- each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
- the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of a unit does not constitute a limitation of the unit itself under certain circumstances.
- FPGAs Field Programmable Gate Arrays
- ASICs Application Specific Integrated Circuits
- ASSPs Application Specific Standard Products
- SOCs System on Chips
- CPLD Complex Programmable Logical device
- a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
- a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
- a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
- machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
- RAM random access memory
- ROM read only memory
- EPROM or flash memory erasable programmable read only memory
- CD-ROM compact disk read only memory
- magnetic storage or any suitable combination of the foregoing.
- the present disclosure provides a picture processing method, the method comprising: determining N text regions and M text pattern types of the picture to be processed, wherein N and M are greater than or an integer equal to 1, and the N is greater than or equal to M; for one or more text areas in the N text areas, use one or more text pattern types in the M text pattern types for rendering to obtain one or more a first rendered picture; inputting one or more first rendered pictures into a scoring model to obtain scores of the one or more first rendered pictures; and determining a target picture according to the scores of the one or more first rendered pictures.
- the present disclosure provides a picture processing method, determining N text areas of the picture to be processed, including: determining the category of the picture to be processed; based on the category of the picture to be processed determining a target template; and determining N text regions of the picture to be processed based on the target template.
- the present disclosure provides a picture processing method, determining a target template based on the category of the picture to be processed, including: determining a template candidate set based on the category of the picture to be processed and template information ; and selecting a target template corresponding to the picture to be processed from the template candidate set.
- the present disclosure provides an image processing method, the template includes a template background image; correspondingly, selecting a target template corresponding to the image to be processed from the template candidate set includes : For one or more templates in the template candidate set, determine the image matching degree between the background image of the template and the picture to be processed; determine the image-text matching between the template information and the picture to be processed degree; and determine a target template corresponding to the picture to be processed based on the image matching degree and/or the graphic-text matching degree.
- the present disclosure provides a method for image processing, determining N text regions of the image to be processed based on the target template, including: determining based on the text region in the background image of the target template A text region candidate set; rendering one or more text candidate regions in the text region candidate set to obtain one or more second rendered pictures; and determining texture complexity based on one or more second rendered pictures N text areas.
- the present disclosure provides an image processing method, determining N text regions based on the texture complexity of one or more second rendered images, including: for one or more of the The second rendered picture, determining the texture complexity of the character candidate region in the second rendered picture; inputting the second rendered picture into the scoring model to obtain a first scoring result; and based on the texture complexity and the The first scoring result determines N text regions.
- the present disclosure provides an image processing method, determining N text regions based on the texture complexity and the first scoring result, including: for one or more of the first scoring results 2. Render the picture, determine the first weighted value calculated according to the texture complexity and the first scoring result; sort the first weighted value from large to small; and rank the top N first The text candidate area corresponding to the weighted value is determined as a text area.
- the present disclosure provides a picture processing method
- the text pattern type includes text color
- determining M text pattern types of the picture to be processed includes: converting the picture to be processed To the HSV color space; for one or more pixels in the picture to be processed, obtain the chromaticity value in the HSV color space; determine the text color candidate set based on the chromaticity value of one or more pixel points ; and selecting M text colors from the text color candidate set.
- the present disclosure provides an image processing method. Selecting M text colors from the text color candidate set includes: using the text color candidates for one or more text regions The one or more text candidate colors in the set are respectively rendered to obtain multiple third rendered pictures; and M text colors are determined based on the background contrast of the third rendered pictures.
- the present disclosure provides an image processing method, determining M text colors based on the background contrast of the third rendered image, including: for one or more third rendered images, determining The background contrast of the text region in the third rendered image; inputting the third rendered image into the scoring model to obtain a second scoring result; determining the second scoring result calculated according to the background contrast and the second scoring result Two weighted values; and determining M text colors corresponding to the text area based on the second weighted value.
- the present disclosure provides a picture processing method
- the scoring model training method includes: performing data labeling on the sample picture according to the picture quality of the sample picture; and after labeling the data The sample pictures are trained to obtain the scoring model.
- the present disclosure provides an image processing device, which includes: wherein, a text area and color determination module is used to determine N text areas and M texts of the image to be processed Pattern type, wherein, N and M are integers greater than or equal to 1, and said N is greater than or equal to M; the first rendering module is configured to use M text patterns for one or more text areas in the N text areas One or more text pattern types in the type are rendered to obtain one or more first rendered pictures; the scoring determination module is used to input one or more of the first rendered pictures into the scoring model to obtain one or more The score of the first rendered picture; and a target picture determining module, configured to determine the target picture according to the scores of the one or more first rendered pictures.
- the present disclosure provides an image processing device, the text area and color determination module includes a text area determination module and a text pattern type determination module; wherein, the text area determination module includes: image type A determination unit configured to determine the category of the picture to be processed; a target template determination unit configured to determine a target template based on the category of the picture to be processed; and a text area determination unit configured to determine the target template based on the target template Process the N text regions of the image.
- the present disclosure provides an image processing apparatus, a target template determination unit, specifically configured to determine a template candidate set based on the category of the image to be processed and template information; and from the template A target template corresponding to the image to be processed is selected from the candidate set.
- the present disclosure provides an image processing apparatus, the template includes a template background image; a target template determining unit, specifically configured to target one or more templates in the template candidate set, Determine the image matching degree between the template background image and the picture to be processed; determine the image-text matching degree between the template information and the picture to be processed; and based on the image matching degree and/or the The image-text matching degree determines the target template corresponding to the image to be processed.
- the present disclosure provides an image processing device, a text region determining unit, specifically configured to determine a text region candidate set based on the text region in the background image of the target template; for the text region candidates Render the one or more text candidate areas in the collection to obtain one or more second rendered pictures; and determine N text areas based on the texture complexity of the one or more second rendered pictures.
- the present disclosure provides an image processing device, a text region determining unit, specifically configured to determine N text regions based on the texture complexity of one or more second rendered pictures, Including: for one or more of the second rendered pictures, determining the texture complexity of the text candidate area in the second rendered pictures; inputting the second rendered pictures into the scoring model to obtain the first scoring result; and based on The texture complexity and the first scoring result determine N text regions.
- the present disclosure provides an image processing device, the text region determination unit is specifically configured to determine, for one or more second rendered images, according to the texture complexity and the the first weighted values calculated from the first scoring results; sort the first weighted values from large to small; and determine the text candidate regions corresponding to the top N first weighted values as text regions.
- the present disclosure provides an image processing device, a character pattern type determination module, including: an image conversion unit, configured to convert the image to be processed into HSV color space; chromaticity value The extracting unit is used to obtain the chromaticity value in the HSV color space for one or more pixels in the picture to be processed; the text color candidate set determination unit is used to obtain the color value based on one or more pixels.
- a degree value determines the text color candidate set; and a text color determination unit is configured to select M text colors from the text color candidate set.
- the present disclosure provides an image processing device, a text color determination unit, specifically configured to select M text colors from the text color candidate set, including: for one or more texts In the area, one or more text candidate colors in the text color candidate set are used for rendering respectively to obtain multiple third rendered pictures; and M text colors are determined based on the background contrast of the third rendered pictures.
- the present disclosure provides an image processing device, a text color determining unit, specifically configured to, for one or more third rendered images, determine the text area in the third rendered image background contrast; input the third rendered image into the scoring model to obtain a second scoring result; determine a second weighted value calculated according to the background contrast and the second scoring result; based on the second weighting The value is determined as the M text colors corresponding to the text area.
- the present disclosure provides a picture processing device, which includes a scoring model training module, configured to mark the sample picture according to the picture quality of the sample picture; and The sample pictures after data labeling are trained to obtain the scoring model.
- the present disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs; when the one or more programs are executed The one or more processors execute, so that the one or more processors implement any one of the image processing methods provided in the present disclosure.
- the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the image processing described in any one provided by the present disclosure is realized. method.
- An embodiment of the present disclosure also provides a computer program product, where the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, the image processing method as described above is implemented.
- An embodiment of the present disclosure further provides a computer program, including: an instruction, which when executed by a processor causes the processor to execute the image processing method as described above.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Processing Or Creating Images (AREA)
Abstract
本公开实施例公开了一种图片处理方法、装置、设备、存储介质和程序产品,所述图片处理方法包括:确定待处理图片的N个文本区域和M个文字图案类型,针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;根据一个或多个第一渲染图片的评分确定目标图片。本公开实施例通过使用多个文本区域和文字图案类型对图片进行渲染后,对渲染后的图片进行评分,确定目标图片,将给定文字和谐美观的放置在图片中,实现图片的快速渲染,避免了后期工作人员手动对推荐图片进行渲染的问题。
Description
相关申请的交叉引用
本申请是以申请号为202111308491.2,申请日为2021年11月5日的中国申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
本公开涉及图像处理技术领域,尤其涉及一种图片处理方法、装置、设备、存储介质和程序产品。
随着科学技术的进步,视频技术发展日趋成熟。在常见的视频网站或应用程序中,通过向用户展示推荐图片的方式进行视频推荐。
发明内容
第一方面,本公开实施例提供一种图片处理方法,所述方法包括:确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和根据一个或多个第一渲染图片的评分确定目标图片。
第二方面,本公开实施例提供一种图片处理装置,所述装置包括:文本区域和颜色确定模块,用于确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;第一渲染模块,用于针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片片;评分确定模块,用于将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和目标图片确定模块,用于根据一个或多个第一渲染图片的评分确定目标图片。
第三方面,本公开实施例提供一种电子设备,所述电子设备包括:一个或多个处理器;和存储装置,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器 执行,使得所述一个或多个处理器实现如上述第一方面中任一项所述的图片处理方法。
第四方面,本公开实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面中任一项所述的图片处理方法。
第五方面,本公开实施例提供一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上述第一方面中任一项所述的图片处理方法。
第六方面,本公开实施例提供一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行如上述第一方面中任一项所述的图片处理方法。
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1是本公开实施例中的一种图片处理方法的流程图;
图2是本公开实施例提供的N个文本区域的示意图;
图3是本公开实施例中的一种图片处理方法的流程图;
图4是本公开实施例中的一种图片处理方法的流程图;
图5是本公开实施例中的一种图片处理方法的流程图;
图6是本公开实施例中的一种扣分项的示意图;
图7是本公开实施例中的一种图片处理装置的结构示意图;
图8是本公开实施例中的一种电子设备的结构示意图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。 本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
随着互联网技术的不断发展,在给定图片上添加文字效果在游戏、视频、音乐、购物网站、广告设计等应用程序中被广泛应用。
本公开的发明人发现,在相关技术中,对于向用户展示的推荐图片都需要后期工作人员手动对推荐图片进行渲染,但是人工渲染的效率较低。
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开实施例提供了一种图片处理方法、装置、设备、存储介质和程序产品,将给定文字和谐美观的放置在图片中,实现图片的快速渲染。
本公开实施例提供了一种图片处理方法,该方法可以适用于多种不同的应用场景。例如,可以应用在视频类应用程序中,例如:影音类应用程序或者短视频类应用程序。具体的,客户端接收用户上传视频,从所述视频中选取一帧作为封面背景图,并且确定封面背景图上添加的文字,将上述文字通过本公开实施例提供的图片处理方法添加至封面背景图上,形成该视频的封面。
再如:还可以应用在购物类或者广告设计类应用程序中。具体的,客户端接收用户上传的商品图片和商品描述文字,将上述商品描述文字通过本公开实施例提供的图片处理方法添加至商品图片上,形成一个具有文字说明的商品图片或者广告设计图。
可以理解的是,本公开实施例提供的图片处理方法并不限于如上所述的几种应用场景,此处只是示意性说明。
下面将结合附图,对本申请实施例提出的图片处理方法进行详细介绍。
图1是本公开实施例中的一种图片处理方法的流程图。本实施例可适用于对任意一张 图片添加文字效果的情况,该方法可以由图片处理装置执行,该图片处理装置可以采用软件和/或硬件的方式实现,该图片处理装置可配置于电子设备中。
例如:所述电子设备可以是移动终端、固定终端或便携式终端,例如移动手机、站点、单元、设备、多媒体计算机、多媒体平板、互联网节点、通信器、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、个人通信系统(PCS)设备、个人导航设备、个人数字助理(PDA)、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者其任意组合,包括这些设备的配件和外设或者其任意组合。
再如:所述电子设备可以是服务器,其中,所述服务器可以是实体服务器,也可以是云服务器,服务器可以是一个服务器,或者服务器集群。
如图1所述,本公开实施例提供的图片处理方法主要包括如下步骤S101至S104。
在步骤S101,确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M。
其中,所述待处理图片可以是给定的任意一张图片。例如:可以是一张需要添加文字说明的照片,也可以是视频中提取的任意一个视频帧,还可以是需要进行广告设计的商品图片等等。
在一个实施方式中,所述待处理图片可以是用户直接上传的图片,例如:在购物类网站、广告设计类网站、照片设计类网站中,用户直接上传中客户端的图片。
在另一个实施方式中,所述待处理图片可以是从用户上传的视频中确定待处理图片。例如:可以是上述视频中任意选取的一张视频帧,也可以是用户指定的视频帧,还可以是多个视频帧拼接之后的图片。
在另一个实施方式中,所述待处理图片还可以是根据用户上传的文字信息从图库中选取的图片。例如:在音乐类应用程序中,根据用户选取的歌单,将歌单中某首歌的演唱者作为待处理图片。
需要说明的是,本实施例中仅对待处理图片的选取进行示例性说明,而非限定。
其中,所述文本区域可以理解为待处理图片中添加文字的一个连通区域。具体的,所述文本区域是指待处理图片中添加文字后不会导致画面主体被遮挡的一个区域。例如:所述文本区域不能是待处理图片中的人脸区域。其中,N个文本区域是指N个文字的连通区域,即N个不同位置的连通区域。如图2所示,放置在N个位置的文字连通区域。
文本区域添加的文字可以是客户端接收到的用户输入的文字,例如:商品图片中用户对商品的描述。文本区域添加的文字可以是客户端提取的视频的名称,例如:待处理图片是视频帧时,文字可以是电影或者电视名称。
进一步的,上述文字可以是汉字、英文、韩文、希腊字母、阿拉伯数字等任意一种现有的可书写文字,还可以是“%”、“@”、“&”等任意一种可书写的符号。
在一个实施方式中,任意选择待处理图片中的N个连通区域作为待处理图片的文本区域。
在一个实施方式中,将待处理图片输入至预先训练的图文匹配模型,确定待处理图片对应的目标模板,基于目标模板中文本区域的位置确定N个文本区域的位置。
其中,所述图案类型可以理解为文字填充或者边框的特殊效果。可选的,目标图案类型可以是目标颜色、目标纹理、目标效果等中的任意一种或多种。其中,所述目标颜色可以是一个颜色值对应的颜色,也可以是多个颜色值对应的渐变颜色。目标纹理可以理解为文字填充纹理,其中,目标纹理可以是系统默认纹理,或者,可以响应用户输入的纹理选择操作,确定目标纹理。目标效果可以是添加阴影、倒影、增加文字边框、发光、三维立体效果等等中的一种或者多种的组合。
进一步的,文本区域中的每个文字图案类型可以相同,也可以不同,本实施例中不再进行限定。
在步骤S102,针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片。在本公开的实施例中,术语“一个或多个”也即为“至少一个”,以下类似。
图2是本公开实施例提供的N个文本区域的示意图。如图2所述,一张图片上可以包括文本区域1,文本区域2,……,文本区域n,N个文本区域,针对一个或多个文本区域,使用一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片。
例如,针对一个文本区域,使用m个文字图案类型进行渲染。例如:文本区域1分别使用m个文字图案类型进行渲染,得到m个第一渲染图片,其中,m小于或等于M。这样得到的m个第一渲染图片是在一个文本区域内,渲染的文字图案类型不同。
例如:使用1个文字图案类型对n个文本区域进行渲染,得到n个第一渲染图片,其中,n小于或等于N。这样得到的m个第一渲染图片是相同文字图案类型的文字分布在图片的不同区域。
例如:针对n个文本区域,分别使用m个文字图案类型进行渲染,得到n×m个第一 渲染图片,其中,n小于或等于N,m小于或等于M。
具体的,在文本区域1分别使用m个文字图案类型进行渲染,得到m个第一渲染图片;在文本区域2分别使用m个文字图案类型进行渲染,得到m个第一渲染图片;……;在文本区域n分别使用m个文字图案类型进行渲染,得到m个第一渲染图片。n个文本区域,分别使用m个文字图案类型进行渲染,得到n×m个第一渲染图片。
在步骤S103,将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分。
在本实施例中,通过评分模型对每个第一渲染图片进行评分,根据评分结果确定目标图片。
在S104,根据一个或多个第一渲染图片的评分确定目标图片。
其中,目标图片可以作为视频的封面图,也可以是歌单的封面图,还可以是商品宣传图。
在一个实施例中,根据一个或多个第一渲染图片的评分确定目标图片,包括:将所述一个或多个第一渲染图片输入至评分模型,得到各个第一渲染图片的评分;将评分从大到小进行排序,将排序在前的若干个第一渲染图片,在客户端进行展示,响应于用户对第一渲染图片的选择操作,确定目标图片。
在本实施例中,将评分在前几的第一渲染图片展示给用户,由用户选择目标图片,可以使得用户对目标图片进行选择,方便用户根据自己的喜好进行选择。
在一个实施方式中,将评分最高的第一渲染图片确定为目标图片,可以避免后期工作人员手动对推荐图片进行渲染的问题,将给定文字和谐美观的放置在图片中,实现图片的快速渲染。
本公开实施例公开了一种图片处理方法,包括:确定待处理图片的N个文本区域和M个文字图案类型,针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;根据一个或多个第一渲染图片的评分确定目标图片。本公开实施例通过使用多个文本区域和文字图案类型对图片进行渲染后,对渲染后的图片进行评分,得到目标图片,将给定文字和谐美观的放置在图片中,实现图片的快速渲染,避免了后期工作人员手动对推荐图片进行渲染的问题。
在上述实施例的基础上,本公开实施例对“确定待处理图片的N个文本区域”的过程进行了优化,如图3所示,优化后的该过程主要包括如下步骤S301至S303。
在步骤S301,确定所述待处理图片的类别。
在本实施例中,待处理图片的类别主要根据图片中的主体进行确定。可选的,图片类别可以包括:人物,沙滩,建筑物,汽车,卡通,猫,狗,花,事物,合拍,山峰,室内,湖(包括海),夜景,自拍,天空,雕塑,街景,日落,文本,树等。图片类别主要用于对待处理图片进行分类。
进一步的,待处理图片的类别可以从待处理图片的标签信息中获取,也可以是采用图像识别方式提取待处理图片中的主体特征,基于主体特征确定待处理图片的类别。
例如:提取到待处理图片中的主体特征是一座大厦,则确定待处理图片的类型是建筑物。
在步骤S302,基于所述待处理图片的类别确定目标模板。
其中,所述目标模板可以理解为待处理图片渲染时的参考图片,即待处理图片中的文本区域的位置可以参照目标模板进行确定。具体的,模板是指一张或者多张添加文字效果的图片,并且有模板信息对该图片的相关信息进行说明。
进一步的,模板包括模板背景图和模板信息。其中,模板背景图可以理解一张或者多张添加文字效果的图片。模板信息包括模板ID(标识)、模板标题、文字字号、文字行数、字体名称、字体大小、文字图案类型配色规则或模板分类标签等。
进一步的,读取模板信息中的模板分类标签可以获取模板的类别;将模板类别与待处理图片的类别一致的模板确定为目标模板。
例如:待处理图片的类别是人物,可以将模板类型是人物的模板,确定为目标模板。待处理图片的类别是大海,可以将模板类型是大海的模板,确定为目标模板。
需要说明的是,目标模板可以是一个模板,也可以是多个模板,本实施例中不进行具体的限定。
在一个实施方式中,基于所述待处理图片的类别确定目标模板,包括:基于所述待处理图片的类别和模板信息确定模板候选集;从所述模板候选集中选择所述待处理图片对应的目标模板。
在本实施例中,在模板库中查找与所述待处理图片的类别一致的模板确定为模板候选集。在本实施例中,通过待处理图片的类别筛除一部分模板,从一个限定的集合中选取目标模板,减少了模板选取范围,提高了模板选取效率。
在一个实施方式中,可以选择模板候选集中的任意一个模板作为目标模板。
在一个实施方式中,从所述模板候选集中选择所述待处理图片对应的目标模板,包括:针对所述模板候选集中的一个或多个模板,确定所述模板背景图与所述待处理图片之间的图像匹配度;确定所述模板信息与所述待处理图片之间的图文匹配度;基于所述图像匹配度和/或所述图文匹配度确定所述待处理图片对应的目标模板。
其中,图像匹配度D_ii可以理解为模板背景图与所述待处理图片之间的相似程度,其中,图像匹配度越高,说明两个图片之间的相似程度越高。
其中,图文匹配度D_it可以理解为语言描述与图片之间的匹配程度,其中,图文匹配度D_it越高,说明语言描述与图片之间的相似程度越高。例如:语言描述是“大象和山林”,图片是一片大海,则说明图文匹配度D_it低。语言描述是“大象和山林”,图片是一个大象在树林中休息,则说明图文匹配度D_it高。
基于所述图像匹配度确定所述待处理图片对应的目标模板,包括:将图像匹配度最高的模板确定为所述待处理图片对应的目标模板。
基于所述图文匹配度确定所述待处理图片对应的目标模板,包括:将图文匹配度最高的模板确定为所述待处理图片对应的目标模板。
基于所述图像匹配度和所述图文匹配度确定所述待处理图片对应的目标模板包括:将所述图像匹配度和所述图文匹配度进行求和计算,将最大和值对应的模板确定为目标模板。
其中,图像匹配度和图文匹配度的计算方法,本实施例中不再进行赘述。
本实施例中,通过图与图之间的距离和图文距离确定目标模板,使得目标模板与待处理图片之间高度相似,提高图片渲染效果。
在步骤S303,基于所述目标模板确定所述待处理图片的N个文本区域。
在上述实施例的基础上,本公开实施例对“基于所述目标模板确定所述待处理图片的N个文本区域”的过程进行了优化,如图4所示,优化后的改过程主要包括如下步骤S401至S403。
在步骤S401,基于目标模板背景图中的文本区域确定文本区域候选集。
在本实施例中,从目标模板信息和目标模板背景图中获取文本区域的相关信息。
例如:从目标模板信息中读取文字字号、文字行数、字体名称、字体大小,直接作为该文本区域的文字的属性。
进一步的,根据文字字数和文字字号确定文本区域的尺寸。其中,文字字号是目 标模板中文字的字号。进一步的,将文字字号对应的单个字体宽度与文本字数的乘积作为文本区域的宽度,将文字字号对应的单个字体高度作为文本区域的高度。
进一步的,确定目标模板中文本区域的位置,将目标模板中的文本区域位置进行调整,得到多个文本区域位置,将多个文本区域位置作为文本区域候选集。
例如:目标模板中文本区域在模板背景图的居中位置,将文本区域位置进行调整,得到多个文本区域的位置。例如:向左移动10个像素点,向右移动10个像素点,向上移动10个像素点,向下移动10个像素点等。具体的调整策略本实施例中仅进行示例性说明,而非限定。
在步骤S402,对所述文本区域候选集中的一个或多个文字候选区域进行渲染,得到一个或多个第二渲染图片。
在本实施例中,将一个或多个文字候选区域分别采用同一种图案类型渲染至待处理图片中,得到一个或多个第二渲染图片。上述同一种图案类型可以是任意一种颜色或者纹理,本实施例中不进行限定。可选的,上述同一种图案类型为黑色或者白色。
在步骤S403,基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域。
在一个实施方式中,针对一个或多个第二渲染图片,确定每个第二渲染图片中,文本区域的纹理复杂度,得到各个第二渲染图片对应的纹理复杂度。
将上述纹理复杂度按照从大到小的顺序进行排序,将排在前N个的纹理复杂度文字候选区域确定为文本区域。
在一个实施方式中,基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定该第二渲染图片中文字候选区域的纹理复杂度;将该第二渲染图片输入至所述评分模型,得到第一评分结果;基于所述纹理复杂度和所述第一评分结果确定N个文本区域。
在一个实施方式中,基于所述纹理复杂度和所述第一评分结果确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定根据所述纹理复杂度和所述第一评分结果计算得到的第一加权值;将所述第一加权值从大到小进行排序;将排在前N个的第一加权值对应的文字候选区域确定为文本区域。
在本实施例中,针对一个或多个第二渲染图片,输入至评分模型,得到该第二渲染图片对应的第一评分结果;同时计算该第二渲染图片中文本区域的纹理复杂度;将第一评分结果和所述纹理复杂度进行加权计算,得到第一加权值。对多个第二渲染图片执行上述操作,得到多个第一加权值,将多个第一加权值从大到小进行排序;将排在前N个的第一加 权值对应的文字候选区域作为N个文本区域。
在上述实施例的基础上,本公开实施例对“确定待处理图片的M个文字图案类型”的过程进行优化,如图5所示,优化后的该过程主要包括如下步骤S501至S504。
在步骤S501,将所述待处理图片转换至HSV颜色空间。
其中,HSV颜色空间是通过色度(H),饱和度(S),亮度(V)三个参数来表示一个颜色,HSV颜色空间是RGB颜色系统的三维表示方式。
其中,色度(H)分量用角度度量,取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°。它们的补色是:黄色为60°,青色为180°,紫色为300°。
其中,从所述待渲染图片的底色信息中提取整个待渲染图片的HSV颜色空间中的色度分量。
在步骤S502,针对所述待处理图片中的一个或多个像素点(即至少一个像素点),获取HSV颜色空间中的色度值。
在一个实施方式中,将整张待渲染图片转换至HSV颜色空间,获取HSV颜色空间中的色度值。
在另一个实施方式中,将待渲染图片中文本区域对应的图像转换至HSV颜色空间,获取HSV颜色空间中的色度值。
在步骤S503,基于一个或多个像素点的所述色度值确定所述文字颜色候选集。
其中,基于色度分量平均值H_Avg,所述饱和度分量平均值S_Avg和所述亮度分量平均值V_Avg确定所述文本目标颜色。
在本实施例中,从待渲染图片中提取的色度值,或者,从待渲染图片的文本区域对应的图像中提取色度值,并计算多个像素点对应的色度平均值,得到色度平均值H_Avg。
从所有颜色集合S中找到和色度平均值H_Avg在H值纬度上差异最小的颜色值对应的所有颜色作为文字的颜色候选集O。H值差异最小保证文字颜色看着和谐美观。
在步骤S504,从所述文字颜色候选集中选择M个文字颜色。
在本实施例中,可以在颜色候选集中任意选择M个颜色。还可以在颜色候选集中选择饱和度大于饱和度阈值或者亮度大于亮度阈值的颜色确定M个文字图案类型。
在上述实施例中,确定N个文本区域,针对N个文本区域中的一个或多个文本区域,均使用文字颜色候选集中一个或多个文字候选颜色进行渲染,每个文本区域可 以得到一个或多个第三渲染图片,基于一个或多个第三渲染图片中确定该文本区域对应的一个文字颜色。对N个文本区域重复进行上述操作,可以得到N个文字颜色。从N个文字颜色中确定M个文字颜色。
在一个实施方式中,从所述文字颜色候选集中选择M个文字颜色,包括:针对一个或多个文本区域,使用所述文字颜色候选集中的一个或多个文字候选颜色分别进行渲染,得到多个第三渲染图片;基于所述第三渲染图片的背景对比度确定M个文字颜色。
在本实施例中,针对文本区域1使用多个文字候选颜色分别进行渲染,得到多个第三渲染图片,确定每个第三渲染图片中,文本区域的背景对比度。将背景对比度最高的第三渲染图片中使用的文字候选颜色确定为文字颜色。
进一步的,一个文本区域会确定一个文字颜色,N个文本区域确定N个文字颜色,从N个文字颜色中选取M个文字颜色。
在一个实施方式中,基于所述第三渲染图片的背景对比度确定M个文字颜色,包括:针对一个或多个第三渲染图片,确定该第三渲染图片中所述文本区域的背景对比度;将该第三渲染图片输入至所述评分模型,得到第二评分结果;确定根据所述背景对比度和所述第二评分结果计算得到的第二加权值;基于所述第二加权值确定为该文本区域对应的M个文字颜色。
在本实施例中,针对文本区域1使用多个文字候选颜色分别进行渲染,得到多个第三渲染图片,确定每个第三渲染图片中,文本区域的背景对比度。同时,将每个第三渲染图片,输入至评分模型,得到该第三渲染图片对应的第二评分结果;将第二评分结果和所述背景对比度进行加权计算,得到第二加权值。对多个第三渲染图片执行上述操作,得到多个第二加权值,将多个加权值中,最大的加权值对应的颜色确定该文本区域对应的文字颜色。针对N个文本区域,均执行上述操作,得到N个文字颜色。
在本实施例中,对N个文字颜色值进行比较,颜色值相同的颜色仅保留其中一个,以筛除颜色值相同的颜色,得到M个不同的文字颜色,其中M小于N。
在本实施例中,对N个文字图案类型值进行比较,如果所有文字图案类型值均不相同,直接从N个文字图案类型中确定M个文字图案类型,其中M等于N。
在一个实施方式中,所述评分模型的训练方法包括:根据样本图片的图片质量对所述样本图片进行数据标注;对数据标注后的样本图片进行训练,得到所述评分模型。
在本实施例中,首先进行数据标注,数据标注一般是一个主观的过程,这里构建一个客观/主观的数据标注过程,把数据客观标注的部分分离出来提高数据标注准确率。对数据 进行标注后,用于训练一个5分类的分类模型,但是模型评分是通过把5个分类的评分平均后映射到对应分数上,得到评分模型。
在本实施例中,根据样本图片的质量对其打分,如果样本图片的图像显示错误、图像特别模糊或者旋转图,标注舍弃。其中,背景虚化的图片不算图像模糊。不考虑文字内容和图像的相关性,只考虑文本区域是否使得整个图像和谐美观,只考虑能够图像中最多字号前三的文字,其他文字或者字体大小过小均不考虑。
进一步的,基于主观维度进行打分。例如:文本区域所在位置使整体构图和谐美观,一般会放在与主体相对的位置或空白的位置,可适当增减分数,标注时可先预设。
进一步的,基于客观维度的扣分项,例如:文字对图像中的显著性目标产生遮挡(例如:对眼睛遮挡或整体遮挡1/2以上,如图6所示)按照遮挡范围扣除预设分数;如果该图片中包括主要人物和非主要人物,即对非主要人物发生遮挡无需考虑当前条件,考虑后面的条件即可。其中,标题太小或者没有标题除预设分数;或者文字重叠,则按照文字重叠率扣除预设分数。其中,文字图案类型与文字所在区域的背景颜色相近,按照颜色为相近程度,抠除预设分数;其中,主体居于图像中间,文字向左右两侧有偏移,或文字和主体均在图像一侧,使得图像整体构图不平衡,抠除预设分数。
图7是本公开实施例中的一种图片处理装置的结构示意图。本实施例可适用于对任意一张图片添加文字效果的情况。该图片处理装置可以采用软件和/或硬件的方式实现。该图片处理装置可配置于电子设备中。
如图7所述,本公开实施例提供的图片处理装置主要包括:文本区域和颜色确定模块71、第一渲染模块72、评分确定模块73和目标图片确定模块74。
文本区域和颜色确定模块71,用于确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M。
第一渲染模块72,用于针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片。
评分确定模块73,用于将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分。
目标图片确定模块74,用于根据一个或多个第一渲染图片的评分确定目标图片。
本公开实施例公开了一种图片处理装置,用于执行如下步骤:确定待处理图片的N个文本区域和M个文字图案类型,针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第 一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;根据一个或多个第一渲染图片的评分确定目标图片。本公开实施例通过使用多个文本区域和文字图案类型对图片进行渲染后,对渲染后的图片进行评分,得到目标图片,将给定文字和谐美观的放置在图片中,实现图片的快速渲染,避免了后期工作人员手动对推荐图片进行渲染的问题。
在一个实施方式中,文本区域和颜色确定模块包括文本区域确定模块和文字图案类型确定模块。
在一个实施方式中,文本区域确定模块包括:图片类型确定单元,用于确定所述待处理图片的类别;目标模板确定单元,用于基于所述待处理图片的类别确定目标模板;和文本区域确定单元,用于基于所述目标模板确定所述待处理图片的N个文本区域。
在一个实施方式中,目标模板确定单元,具体用于基于所述待处理图片的类别和模板信息确定模板候选集;和从所述模板候选集中选择所述待处理图片对应的目标模板。
在一个实施方式中,所述模板包括模板背景图。目标模板确定单元,具体用于针对所述模板候选集中的一个或多个模板,确定所述模板背景图与所述待处理图片之间的图像匹配度;确定所述模板信息与所述待处理图片之间的图文匹配度;和基于所述图像匹配度和/或所述图文匹配度确定所述待处理图片对应的目标模板。
在一个实施方式中,文本区域确定单元,具体用于基于目标模板背景图中的文本区域确定文本区域候选集;对所述文本区域候选集中的一个或多个文字候选区域进行渲染,得到一个或多个第二渲染图片;和基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域。
在一个实施方式中,文本区域确定单元,具体用于基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定该第二渲染图片中文字候选区域的纹理复杂度;将该第二渲染图片输入至所述评分模型,得到第一评分结果;和基于所述纹理复杂度和所述第一评分结果确定N个文本区域。
在一个实施方式中,文本区域确定单元,具体用于针对一个或多个所述第二渲染图片,确定根据所述纹理复杂度和所述第一评分结果计算得到的第一加权值;将所述第一加权值从大到小进行排序;将排在前N个的第一加权值对应的文字候选区域确定为文本区域。
在一个实施方式中,文字图案类型确定模块,包括:图片转换单元,用于将所述待处理图片转换至HSV颜色空间;色度值提取单元,用于针对所述待处理图片中的一个或多个像素点,获取HSV颜色空间中的色度值;文字颜色候选集确定单元,用于基于一个或 多个像素点的所述色度值确定所述文字颜色候选集;和文字颜色确定单元,用于从所述文字颜色候选集中选择M个文字颜色。
在一个实施方式中,文字颜色确定单元,具体用于从所述文字颜色候选集中选择M个文字颜色,包括:针对一个或多个文本区域,使用所述文字颜色候选集中的一个或多个文字候选颜色分别进行渲染,得到多个第三渲染图片;和基于所述第三渲染图片的背景对比度确定M个文字颜色。
在一个实施方式中,文字颜色确定单元,具体用于针对一个或多个第三渲染图片,确定该第三渲染图片中所述文本区域的背景对比度;将该第三渲染图片输入至所述评分模型,得到第二评分结果;确定根据所述背景对比度和所述第二评分结果计算得到的第二加权值;和基于所述第二加权值确定为该文本区域对应的M个文字颜色。
在一个实施方式中,所述装置还包括:评分模型训练模块,用于根据样本图片的图片质量对所述样本图片进行数据标注,以及对数据标注后的样本图片进行训练,得到所述评分模型。
本公开实施例提供的图片处理装置,可执行本公开方法实施例所提供的图片处理方法中所执行的步骤,具备执行步骤和有益效果此处不再赘述。
图8为本公开实施例中的一种电子设备的结构示意图。下面具体参考图8,其示出了适于用来实现本公开实施例中的电子设备800的结构示意图。本公开实施例中的电子设备800可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴终端设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。图8示出的终端设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储装置808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理以实现如本公开所述的实施例的图片处理方法。在RAM 803中,还存储有终端设备800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。
通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(LCD)、 扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许终端设备800与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的终端设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码,从而实现如上所述的页面跳转方法。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM 802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。例如,计算机可读存储介质为非瞬时性计算机可读存储介质。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该终端设备执行时,使得该终端设备:确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和根据一个或多个第一渲染图片的评分确定目标图片。
可选的,当上述一个或者多个程序被该终端设备执行时,该终端设备还可以执行上述实施例所述的其他步骤。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,所述方法包括:确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和根据一个或多个第一渲染图片的评分确定目标图片。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,确定待处理图片的N个文本区域,包括:确定所述待处理图片的类别;基于所述待处理图片的类别确定目标模板;和基于所述目标模板确定所述待处理图片的N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,基于所述待处理图片的类别确定目标模板,包括:基于所述待处理图片的类别和模板信息确定模板候选集;和从所述模板候选集中选择所述待处理图片对应的目标模板。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,所述模板包括模板背景图;相应的,从所述模板候选集中选择所述待处理图片对应的目标模板,包括:针对所述模板候选集中的一个或多个模板,确定所述模板背景图与所述待处理图片之间的图像匹配度;确定所述模板信息与所述待处理图片之间的图文匹配度;和基于所述图像匹配度和/或所述图文匹配度确定所述待处理图片对应的目标模板。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,基于所述目标模 板确定所述待处理图片的N个文本区域,包括:基于目标模板背景图中的文本区域确定文本区域候选集;对所述文本区域候选集中的一个或多个文字候选区域进行渲染,得到一个或多个第二渲染图片;和基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定该第二渲染图片中文字候选区域的纹理复杂度;将该第二渲染图片输入至所述评分模型,得到第一评分结果;和基于所述纹理复杂度和所述第一评分结果确定N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,基于所述纹理复杂度和所述第一评分结果确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定根据所述纹理复杂度和所述第一评分结果计算得到的第一加权值;将所述第一加权值从大到小进行排序;和将排在前N个的第一加权值对应的文字候选区域确定为文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,所述文字图案类型包括文字颜色;确定待处理图片的M个文字图案类型,包括:将所述待处理图片转换至HSV颜色空间;针对所述待处理图片中的一个或多个像素点,获取HSV颜色空间中的色度值;基于一个或多个像素点的所述色度值确定所述文字颜色候选集;和从所述文字颜色候选集中选择M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,从所述文字颜色候选集中选择M个文字颜色,包括:针对一个或多个文本区域,使用所述文字颜色候选集中的一个或多个文字候选颜色分别进行渲染,得到多个第三渲染图片;和基于所述第三渲染图片的背景对比度确定M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,基于所述第三渲染图片的背景对比度确定M个文字颜色,包括:针对一个或多个第三渲染图片,确定该第三渲染图片中所述文本区域的背景对比度;将该第三渲染图片输入至所述评分模型,得到第二评分结果;确定根据所述背景对比度和所述第二评分结果计算得到的第二加权值;和基于所述第二加权值确定为该文本区域对应的M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理方法,所述评分模型的训练方法包括:根据样本图片的图片质量对所述样本图片进行数据标注;和对数 据标注后的样本图片进行训练,得到所述评分模型。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,所述装置包括:其中,文本区域和颜色确定模块,用于确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;第一渲染模块,用于针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;评分确定模块,用于将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和目标图片确定模块,用于根据一个或多个第一渲染图片的评分确定目标图片。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文本区域和颜色确定模块包括文本区域确定模块和文字图案类型确定模块;其中,文本区域确定模块,包括:图片类型确定单元,用于确定所述待处理图片的类别;目标模板确定单元,用于基于所述待处理图片的类别确定目标模板;和文本区域确定单元,用于基于所述目标模板确定所述待处理图片的N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,目标模板确定单元,具体用于基于所述待处理图片的类别和模板信息确定模板候选集;和从所述模板候选集中选择所述待处理图片对应的目标模板。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,所述模板包括模板背景图;目标模板确定单元,具体用于针对所述模板候选集中的一个或多个模板,确定所述模板背景图与所述待处理图片之间的图像匹配度;确定所述模板信息与所述待处理图片之间的图文匹配度;和基于所述图像匹配度和/或所述图文匹配度确定所述待处理图片对应的目标模板。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文本区域确定单元,具体用于基于目标模板背景图中的文本区域确定文本区域候选集;对所述文本区域候选集中的一个或多个文字候选区域进行渲染,得到一个或多个第二渲染图片;和基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文本区域确定单元,具体用于基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定该第二渲染图片中文字候选区域的纹理复杂度;将该第二渲染图片输入至所述评分模型,得到第一评分结果;和基于所述纹理复杂度和所述第一评分结果确定N个文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文本区域确定单元,具体用于针对一个或多个所述第二渲染图片,确定根据所述纹理复杂度和所述第一评分结果计算得到的第一加权值;将所述第一加权值从大到小进行排序;和将排在前N个的第一加权值对应的文字候选区域确定为文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文字图案类型确定模块,包括:图片转换单元,用于将所述待处理图片转换至HSV颜色空间;色度值提取单元,用于针对所述待处理图片中的一个或多个像素点,获取HSV颜色空间中的色度值;文字颜色候选集确定单元,用于基于一个或多个像素点的所述色度值确定所述文字颜色候选集;和文字颜色确定单元,用于从所述文字颜色候选集中选择M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文字颜色确定单元,具体用于从所述文字颜色候选集中选择M个文字颜色,包括:针对一个或多个文本区域,使用所述文字颜色候选集中的一个或多个文字候选颜色分别进行渲染,得到多个第三渲染图片;和基于所述第三渲染图片的背景对比度确定M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,文字颜色确定单元,具体用于针对一个或多个第三渲染图片,确定该第三渲染图片中所述文本区域的背景对比度;将该第三渲染图片输入至所述评分模型,得到第二评分结果;确定根据所述背景对比度和所述第二评分结果计算得到的第二加权值;基于所述第二加权值确定为该文本区域对应的M个文字颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片处理装置,所述装置该包括评分模型训练模块,用于根据样本图片的图片质量对所述样本图片进行数据标注;和对数据标注后的样本图片进行训练,得到所述评分模型。
根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:一个或多个处理器;和存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开提供的任一所述的图片处理方法。
根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开提供的任一所述的图片处理方法。
本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序 或指令,该计算机程序或指令被处理器执行时实现如上所述的图片处理方法。
本公开实施例还提供了一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行如上所述的图片处理方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。
Claims (16)
- 一种图片处理方法,包括:确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片;将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和根据一个或多个第一渲染图片的评分确定目标图片。
- 根据权利要求1所述的方法,其中,确定待处理图片的N个文本区域,包括:确定所述待处理图片的类别;基于所述待处理图片的类别确定目标模板;和基于所述目标模板确定所述待处理图片的N个文本区域。
- 根据权利要求2所述的方法,其中,基于所述待处理图片的类别确定目标模板,包括:基于所述待处理图片的类别和模板信息确定模板候选集;和从所述模板候选集中选择所述待处理图片对应的目标模板。
- 根据权利要求3所述的方法,其中:所述模板包括模板背景图;以及从所述模板候选集中选择所述待处理图片对应的目标模板,包括:针对所述模板候选集中的一个或多个模板,确定所述模板背景图与所述待处理图片之间的图像匹配度;确定所述模板信息与所述待处理图片之间的图文匹配度;和基于所述图像匹配度和/或所述图文匹配度确定所述待处理图片对应的目标模板。
- 根据权利要求2所述的方法,其中,基于所述目标模板确定所述待处理图片的N个文本区域,包括:基于目标模板背景图中的文本区域确定文本区域候选集;对所述文本区域候选集中的一个或多个文字候选区域进行渲染,得到一个或多个第二渲染图片;和基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域。
- 根据权利要求5所述的方法,其中,基于一个或多个所述第二渲染图片的纹理复杂度确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定该第二渲染图片中文字候选区域的纹理复杂度;将该第二渲染图片输入至所述评分模型,得到第一评分结果;和基于所述纹理复杂度和所述第一评分结果确定N个文本区域。
- 根据权利要求6所述的方法,其中,基于所述纹理复杂度和所述第一评分结果确定N个文本区域,包括:针对一个或多个所述第二渲染图片,确定根据所述纹理复杂度和所述第一评分结果计算得到的第一加权值;将所述第一加权值从大到小进行排序;和将排在前N个的第一加权值对应的文字候选区域确定为文本区域。
- 根据权利要求1所述的方法,其中:所述文字图案类型包括文字颜色;以及确定待处理图片的M个文字图案类型,包括:将所述待处理图片转换至HSV颜色空间;针对所述待处理图片中的一个或多个像素点,获取HSV颜色空间中的色度值;基于一个或多个像素点的所述色度值确定所述文字颜色候选集;和从所述文字颜色候选集中选择M个文字颜色。
- 根据权利要求8所述的方法,其中,从所述文字颜色候选集中选择M个文字颜色,包括:针对一个或多个文本区域,使用所述文字颜色候选集中的一个或多个文字候选颜色分别进行渲染,得到多个第三渲染图片;和基于所述第三渲染图片的背景对比度确定M个文字颜色。
- 根据权利要求9所述的方法,其中,基于所述第三渲染图片的背景对比度确定M个文字颜色,包括:针对一个或多个第三渲染图片,确定该第三渲染图片中所述文本区域的背景对比度;将该第三渲染图片输入至所述评分模型,得到第二评分结果;确定根据所述背景对比度和所述第二评分结果计算得到的第二加权值;和基于所述第二加权值确定为该文本区域对应的M个文字颜色。
- 根据权利要求1所述的方法,其中,所述评分模型的训练方法包括:根据样本图片的图片质量对所述样本图片进行数据标注;和对数据标注后的样本图片进行训练,得到所述评分模型。
- 一种图片处理装置,其特征在于,所述装置包括:文本区域和颜色确定模块,用于确定待处理图片的N个文本区域和M个文字图案类型,其中,N和M为大于或等于1的整数,所述N大于或等于M;第一渲染模块,用于针对N个文本区域中的一个或多个文本区域,使用M个文字图案类型中的一个或多个文字图案类型进行渲染,得到一个或多个第一渲染图片片;评分确定模块,用于将一个或多个所述第一渲染图片输入至评分模型,得到一个或多个第一渲染图片的评分;和目标图片确定模块,用于根据一个或多个第一渲染图片的评分确定目标图片。
- 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器;和存储装置,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1至11中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1至11中任一项所述的方法。
- 一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如权利要求1至11中任一项所述的方法。
- 一种计算机程序,包括:指令,所述指令当由处理器执行时使所述处理器执行如权利要求1至11中任一项所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/704,432 US20250078354A1 (en) | 2021-11-05 | 2022-11-02 | Image processing method and apparatus, device, storage medium and program product |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111308491.2A CN113989404B (zh) | 2021-11-05 | 2021-11-05 | 图片处理方法、装置、设备、存储介质和程序产品 |
| CN202111308491.2 | 2021-11-05 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023078281A1 true WO2023078281A1 (zh) | 2023-05-11 |
Family
ID=79746898
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/129170 Ceased WO2023078281A1 (zh) | 2021-11-05 | 2022-11-02 | 图片处理方法、装置、设备、存储介质和程序产品 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20250078354A1 (zh) |
| CN (1) | CN113989404B (zh) |
| WO (1) | WO2023078281A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119182977A (zh) * | 2024-09-10 | 2024-12-24 | 平安科技(深圳)有限公司 | 基于人工智能的封面生成方法、装置、计算机设备及介质 |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113989404B (zh) * | 2021-11-05 | 2024-06-25 | 北京字节跳动网络技术有限公司 | 图片处理方法、装置、设备、存储介质和程序产品 |
| CN115658195A (zh) * | 2022-09-26 | 2023-01-31 | 维沃移动通信有限公司 | 显示方法、装置、电子设备和存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150070373A1 (en) * | 2012-08-23 | 2015-03-12 | Google Inc. | Clarification of Zoomed Text Embedded in Images |
| CN111311554A (zh) * | 2020-01-21 | 2020-06-19 | 腾讯科技(深圳)有限公司 | 图文内容的内容质量确定方法、装置、设备及存储介质 |
| CN111935528A (zh) * | 2020-06-22 | 2020-11-13 | 北京百度网讯科技有限公司 | 视频生成方法和装置 |
| CN113989404A (zh) * | 2021-11-05 | 2022-01-28 | 北京字节跳动网络技术有限公司 | 图片处理方法、装置、设备、存储介质和程序产品 |
| CN114820881A (zh) * | 2022-04-12 | 2022-07-29 | 上海商汤智能科技有限公司 | 图片的生成方法、智能终端及其计算机可读存储介质 |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP2963584B1 (en) * | 2013-02-28 | 2020-07-15 | Glory Ltd. | Character recognition method and character recognition system |
| JP6338234B2 (ja) * | 2013-11-12 | 2018-06-06 | 国立大学法人富山大学 | 領域分け方法、領域分けプログラム及び画像処理システム |
| WO2015167525A1 (en) * | 2014-04-30 | 2015-11-05 | Hewlett-Packard Development Company, L.P. | Automatic page layout for text items and image items |
| US20160093080A1 (en) * | 2014-09-30 | 2016-03-31 | Microsoft Technology Licensing, Llc | Optimizing the Legibility of Displayed Text |
| US10109092B1 (en) * | 2015-03-24 | 2018-10-23 | Imagical LLC | Automated text layout, color and other stylization on an image or video, and the tracking and application of user color preferences |
| CN108122198A (zh) * | 2017-12-07 | 2018-06-05 | 北京奇虎科技有限公司 | 一种在视频中融合推荐内容的实现方法、装置和服务器 |
| CN109978972B (zh) * | 2019-03-20 | 2023-04-25 | 郑州阿帕斯科技有限公司 | 一种图片中的文字编辑的方法及装置 |
| CN110264545A (zh) * | 2019-06-19 | 2019-09-20 | 北京字节跳动网络技术有限公司 | 图片生成方法、装置、电子设备及存储介质 |
| US10964024B2 (en) * | 2019-06-26 | 2021-03-30 | Adobe Inc. | Automatic sizing and placement of text within a digital image |
| CN110706310B (zh) * | 2019-08-23 | 2021-10-22 | 华为技术有限公司 | 一种图文融合方法、装置及电子设备 |
| CN111596998A (zh) * | 2020-05-13 | 2020-08-28 | 青岛海信移动通信技术股份有限公司 | 一种水墨屏的页面处理方法及终端 |
-
2021
- 2021-11-05 CN CN202111308491.2A patent/CN113989404B/zh active Active
-
2022
- 2022-11-02 WO PCT/CN2022/129170 patent/WO2023078281A1/zh not_active Ceased
- 2022-11-02 US US18/704,432 patent/US20250078354A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150070373A1 (en) * | 2012-08-23 | 2015-03-12 | Google Inc. | Clarification of Zoomed Text Embedded in Images |
| CN111311554A (zh) * | 2020-01-21 | 2020-06-19 | 腾讯科技(深圳)有限公司 | 图文内容的内容质量确定方法、装置、设备及存储介质 |
| CN111935528A (zh) * | 2020-06-22 | 2020-11-13 | 北京百度网讯科技有限公司 | 视频生成方法和装置 |
| CN113989404A (zh) * | 2021-11-05 | 2022-01-28 | 北京字节跳动网络技术有限公司 | 图片处理方法、装置、设备、存储介质和程序产品 |
| CN114820881A (zh) * | 2022-04-12 | 2022-07-29 | 上海商汤智能科技有限公司 | 图片的生成方法、智能终端及其计算机可读存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119182977A (zh) * | 2024-09-10 | 2024-12-24 | 平安科技(深圳)有限公司 | 基于人工智能的封面生成方法、装置、计算机设备及介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113989404A (zh) | 2022-01-28 |
| US20250078354A1 (en) | 2025-03-06 |
| CN113989404B (zh) | 2024-06-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109618222B (zh) | 一种拼接视频生成方法、装置、终端设备及存储介质 | |
| JP7448628B2 (ja) | 関連コンテンツを使用した画像の効率的な増強 | |
| CN109635621B (zh) | 用于第一人称视角中基于深度学习识别手势的系统和方法 | |
| WO2023078281A1 (zh) | 图片处理方法、装置、设备、存储介质和程序产品 | |
| US10943256B2 (en) | Methods and systems for automatically generating advertisements | |
| US11099809B2 (en) | Display apparatus and control method thereof | |
| CN110865862B (zh) | 一种页面背景设置方法、装置及电子设备 | |
| CN110602554A (zh) | 封面图像确定方法、装置及设备 | |
| CN109688463A (zh) | 一种剪辑视频生成方法、装置、终端设备及存储介质 | |
| WO2020253766A1 (zh) | 图片生成方法、装置、电子设备及存储介质 | |
| WO2023088036A1 (zh) | 页面展示方法及装置、电子设备、存储介质和程序产品 | |
| CN111131876B (zh) | 视频直播的控制方法、装置、终端及计算机可读存储介质 | |
| CN111696176A (zh) | 图像处理方法、装置、电子设备及计算机可读介质 | |
| WO2023078284A1 (zh) | 图片渲染方法、装置、设备、存储介质和程序产品 | |
| US12380926B2 (en) | Video generation method, apparatus, device, and storage medium | |
| WO2023279843A1 (zh) | 内容搜索方法、装置、设备和存储介质 | |
| CN116389849A (zh) | 视频生成方法、装置、设备及存储介质 | |
| CN113204691B (zh) | 一种信息展示方法、装置、设备及介质 | |
| CN111353536B (zh) | 图像的标注方法、装置、可读介质和电子设备 | |
| WO2023093683A1 (zh) | 图像剪裁方法、模型训练方法、装置、电子设备及介质 | |
| CN118429474A (zh) | 一种图像生成方法、装置、设备及存储介质 | |
| CN113032626A (zh) | 搜索结果处理方法、装置、电子设备和存储介质 | |
| WO2023056835A1 (zh) | 视频封面生成方法、装置、电子设备及可读介质 | |
| WO2023197648A1 (zh) | 截图处理方法及装置、电子设备和计算机可读介质 | |
| CN119648720A (zh) | 图像裁剪方法、装置、电子设备、存储介质及程序产品 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22889303 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.08.2024) |
|
| WWP | Wipo information: published in national office |
Ref document number: 18704432 Country of ref document: US |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22889303 Country of ref document: EP Kind code of ref document: A1 |