WO2023078284A1 - 图片渲染方法、装置、设备、存储介质和程序产品 - Google Patents

图片渲染方法、装置、设备、存储介质和程序产品 Download PDF

Info

Publication number
WO2023078284A1
WO2023078284A1 PCT/CN2022/129186 CN2022129186W WO2023078284A1 WO 2023078284 A1 WO2023078284 A1 WO 2023078284A1 CN 2022129186 W CN2022129186 W CN 2022129186W WO 2023078284 A1 WO2023078284 A1 WO 2023078284A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
image
rendered
area
color
Prior art date
Application number
PCT/CN2022/129186
Other languages
English (en)
French (fr)
Inventor
郭冠军
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023078284A1 publication Critical patent/WO2023078284A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular to an image rendering 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 an image rendering method, the method including:
  • the image to be rendered is rendered based on the text target text type and the text target pattern type.
  • an image rendering device comprising:
  • a text area determining module configured to process the image to be rendered to determine the text area
  • a target font size determination module configured to determine the target text type of the text based on the attribute information of the text region
  • a target color determination module configured to determine a text target pattern type based on the image to be rendered
  • a rendering module configured to render the picture to be rendered based on the text target text type and the text target pattern type.
  • an embodiment of the present disclosure provides an electronic device, and the electronic device includes:
  • processors one or more processors
  • the one or more processors are made to implement the picture rendering 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 rendering 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 instruction, and when the computer program or instruction is executed by a processor, the image rendering described in any one of the above first aspects is implemented method.
  • FIG. 1 is a flowchart of an image rendering method in an embodiment of the present disclosure
  • FIG. 2 is a flowchart of an image rendering method in an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a text area in a picture to be rendered provided by an embodiment of the present disclosure
  • Fig. 4 is a schematic diagram of a text color candidate set provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a rendered picture provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of an image rendering device in an embodiment of the present disclosure.
  • FIG. 7 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” means “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.
  • embodiments of the present disclosure provide a picture rendering method, device, equipment, storage medium and program product, which place a given text in a picture in a harmonious and beautiful manner, and realize picture rendering. fast rendering.
  • the image rendering method proposed in the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
  • Fig. 1 is a flow chart of a picture rendering method in an embodiment of the present disclosure. This embodiment is applicable to adding a text effect to any picture.
  • the method can be executed by a picture rendering device, and the picture rendering device can use Realized by means of software and/or hardware, the image rendering device can be configured in electronic equipment.
  • 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; it may be a server or a server cluster.
  • the image rendering method provided by the embodiment of the present disclosure mainly includes the following steps.
  • S101 Process the image to be rendered to determine a text area.
  • the picture to be rendered may be any given picture.
  • it can be a photo to which text needs to be added, or any video frame extracted from a video.
  • only the image to be rendered is described, not limited.
  • the text area can be understood as a connected area where text is added in the image to be rendered.
  • Text can be added in the text area, and the text refers to text information related to the image to be rendered.
  • the above text information may be determined according to the image information to be rendered, or may be text input by the user that needs to be added to the image to be rendered.
  • the text information may be the name of the film and television video.
  • the above text information may be the main content of the picture to be rendered, such as "mountain” and "big tree”.
  • the above text information may be text information given by the user. Wherein, the user-given text information is input by the user through the input device.
  • a connected region is selected as a text region at any position in the image to be rendered, for example: a connected region is selected as a text region in the middle of the image to be rendered, and another example: a connected region is selected at the upper left of the image to be rendered Connected regions serve as text regions. Further, the above text area may be selected as an area that will not cause the main body of the screen to be blocked after text is added to the image to be rendered.
  • the user's selection operation in the image to be rendered is received, and the area selected by the user in the image to be rendered is used as a text area, for example: the user manually selects a rectangular connected area in the image to be rendered, and the Rectangular connected regions are used as text regions.
  • the image to be rendered is input into a pre-trained segmentation model, and the text region corresponding to the image to be rendered is determined according to the image mask output by the pre-trained segmentation model.
  • the attribute information of the text area may be at least one of the width or height of a rectangular frame circumscribing the text area, wherein the above width and height may be expressed in units of length or in pixels, which are not described in this embodiment Make specific restrictions.
  • Text type can be understood as information that characterizes text features, such as: text size, text font, text font, character spacing, text relative to the text area and other related information.
  • the character font size refers to the information representing the size of a character, such as the initial number, the small beginning, the first number, and the second number; the character font refers to the information representing the shape of Chinese characters, such as Kai, Song, and Hei Ti, and can also represent the shape of characters in other languages
  • the information of the text; the font of the text refers to information such as bold, italic, etc. that represent a special effect of a text.
  • 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.
  • the target font size of the text is determined based on the width of the bounding box of the text area. That is, the text in the target font size can fill the entire text area.
  • the bounding box of the text area is a rectangular bounding box, and the width of the bounding box can be understood as the length of the abscissa in the two-dimensional coordinates.
  • the target font size is calculated from the largest font size in order, and for each font size, the text width under the font size is calculated, and it is determined whether the text width is smaller than or equal to the bounding box width of the text area.
  • the text width refers to the corresponding length of all texts under one font size. For example: small size 2 font, the width of each character is 6.3mm, and the number of characters in the text is 10, then the width of the text is 63mm.
  • the width of a character is determined for each font size; the ratio of the bounding box to the number of characters in the text is calculated, and the font size corresponding to the width of the closest character to the ratio is determined as the target font size.
  • font size 1 the width of each character is 9.8mm, font size 2, the width of each character is 7.4mm, font size 2, the width of each character is 6.3mm, font size 3, the width of each character The width is 5.6mm. If the width of the bounding box is 60mm and the number of text characters is 9 characters, the ratio of the width of the bounding box to the number of text characters is 6.67. The ratio is closest to 6.3mm, so select the second size corresponding to 6.3mm and determine it as the target font size of the text.
  • the number of text words that can be accommodated by the bounding box width is calculated for each font size in descending order from the largest font size, until the number of text words that can be accommodated is greater than the actual number of text words, then the font size corresponding to the number of text words that can be accommodated Determine the target font size for the text.
  • font size 1 the width of each character is 9.8mm
  • font size 2 the width of each character is 7.4mm
  • font size 2 the width of each character is 6.3mm
  • font size 3 the width of each character The width is 5.6mm.
  • the width of the bounding box is 70mm
  • the actual number of characters is 10
  • the size 1 font can hold 7.1 characters
  • the size 2 font can hold 9.4 characters
  • the size 2 font can hold 11 characters
  • the size 2 font can hold 11 characters.
  • the number of characters is greater than the actual number of characters, so the small two size is determined as the target font.
  • the system default font is used as the text target font, or the target font can be determined in response to a font selection operation input by the user.
  • the system default glyph for example: regular glyph
  • the target glyph can be determined in response to a glyph (bold, italic) selection operation input by the user.
  • 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 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 text target color may be determined according to the color information of the picture to be rendered.
  • the above color information can be represented by any one of RGB color system, HSV color space or HSL color space.
  • the RGB color system obtains a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them with each other.
  • the values corresponding to the three color channels in the RGB color system in the image to be rendered are extracted, and the values are directly determined as the text target color.
  • the values corresponding to the three color channels in the RGB color system in the area corresponding to the text area are extracted, the color corresponding to the value is determined, and the complementary color of the color is determined as the text target color. For example: after extracting the text area, the color corresponding to the RGB value is red, and the complementary color green of red is determined as the text target color.
  • the HSV color space expresses a color through three parameters of chroma (H), saturation (S), and brightness (V).
  • the HSV color space is a three-dimensional representation of the RGB color system.
  • the chromaticity value of the HSV color space is extracted for the picture to be rendered, and the average value of the H value of the corresponding text area image is calculated, and the color value with the largest difference from H_Avg is found as the text color value.
  • any part of the image in the image to be rendered is extracted as the text target texture.
  • the text is displayed and rendered according to certain rules in the text area.
  • the above certain rules include: center display, left display, right display and so on. The specific display and rendering manner will not be described in detail in this embodiment.
  • An embodiment of the present disclosure provides an image rendering method, including: processing the image to be rendered to determine a text area; determining the text target text type based on the attribute information of the text area; determining the text target pattern type based on the image to be rendered; The text target text type and the text target pattern type render the picture to be rendered.
  • the embodiment of the present disclosure determines the text type based on the obtained text area, determines the text pattern type based on the picture to be rendered, and renders the text according to the text type and text pattern type, and adds it to the text area on the picture, which is about to give
  • the text is harmoniously and beautifully placed in the picture to achieve fast rendering of the picture.
  • FIG. 2 is a flow chart of the optimized image rendering method in the embodiment of the present disclosure. As shown in FIG. 2 , the present disclosure The optimized image rendering method provided in the embodiment mainly includes the following steps.
  • Video generally refers to a video composed of multiple video frames, such as short video, live video, film and television video, etc. This application does not limit the specific type of video, etc.
  • the video to be processed is, for example, a video without a cover picture added.
  • the image rendering method provided by the embodiment of the present disclosure may be executed after receiving the cover generation instruction, that is, steps S201-S207.
  • the cover generation instruction may be generated and sent in response to the cover operation input by the user, or may be automatically generated and sent after receiving the video uploaded by the user and detecting that the video does not have a video cover.
  • the video cover refers to an image used to display a summary of the video.
  • the video cover may be a static image, and the static video cover may also be called a static video cover.
  • the video cover may also be a dynamic video segment, and a dynamic video cover may also be called a dynamic video cover.
  • the video platform displays images on the cover of the video list, and the displayed video cover is helpful for users to have a general understanding of the live broadcast content.
  • any frame of the video to be processed is selected as the image to be rendered; or, based on the user's selection operation, the video frame selected by the user is selected as the image to be rendered.
  • a method for training a segmentation model which mainly includes: collecting data samples, and the data samples mainly include a base map and a picture mask.
  • the collected data samples are input to the neural network model for training to obtain a segmentation model.
  • the segmentation model After the image to be rendered is input to the segmentation model, the segmentation model performs processing to obtain the image mask.
  • Fig. 3 is a schematic diagram of a text area in a picture to be rendered provided by an embodiment of the present disclosure.
  • the image to be rendered on the leftmost side in Figure 3 is input to the segmentation model, the segmentation model processes it to obtain the grayscale image in the middle, and binarizes the grayscale image to obtain the image mask on the right membrane.
  • binarization processing is to classify the target and the background.
  • the most commonly used method for binarizing grayscale images is the threshold method, that is, using the difference between the target and the background in the image, the image is set to two different levels, and an appropriate threshold is selected to determine whether a pixel is The target is still the background, thus obtaining a binarized image.
  • the threshold method is used to perform binarization processing on the grayscale image in the middle of FIG. 3 to obtain the binarized image on the right side of FIG. 3 .
  • the foreground area can be understood as an area composed of white pixels in the binarized image mask, such as the white area in the right figure in FIG. 3 .
  • the foreground area may also be referred to as an area of interest.
  • the background area which refers to the area composed of black pixels in the binarized image mask, such as the black area in the right figure in Figure 3 .
  • the first threshold is used to determine whether the size of the foreground region in the picture mask is too small. If the size of the foreground area in the picture mask is greater than or equal to the set first threshold, it means that the size of the foreground area in the picture mask is larger and can be set as a text area. If the size of the foreground area in the picture mask is smaller than If the first threshold is set, it means that the foreground area in the image mask is too small. Setting the text area may cause the main body of the image to be blocked by text, which is not suitable as a text area. You need to select another position as a text area.
  • the attribute information of the text area includes the width of the bounding box of the text area, and the target text type of the text includes the target font size of the text.
  • the bounding box of the text area can be understood as the bounding box of the white pixels on the right in FIG. 3 .
  • determining the text target font size based on the width of the bounding box and the number of text characters includes: traversing each font size from the largest font size; determining the text width based on the traversed current font size and the number of text characters; When it is less than or equal to the width of the bounding box, the current font size traversed is determined as the text target font size.
  • the maximum font size and the minimum font size can be set in advance, and the maximum font size can generally be the maximum font size that comes with the system, for example: the maximum font size is the initial number.
  • the minimum font size is the minimum font size that comes with the system, for example: the minimum font size for Chinese is eight.
  • the minimum font size can be set according to the size of the image to be rendered. If the image to be rendered is too large and the text font is too small, the display will be unsightly and disharmonious, and the font that is too small will also affect the viewing effect of the audience. Therefore, set the minimum font size according to the size of the image to be rendered, which can avoid Counting the font size too many times wastes resources and time.
  • determining the text width based on the traversed current font size and the number of text characters may include: taking the product of a single font width corresponding to the current font size and the number of text characters as the text width.
  • each font size is traversed from the largest font size; the product of the single font width corresponding to the current font size and the number of text characters is used as the text width; when the text width is less than or equal to the width of the bounding box, it will traverse to The current font size of is determined as the text target font size.
  • the text width For example: take the largest font size and the initial number as the current font size, multiply the single font width corresponding to the initial font by the number of text words, and use it as the text width, compare the text width with the width of the bounding box, if the text width is less than or equal to the bounding box Box width, determine the initial font size as the text target font size. If the text width is greater than the width of the bounding box, select a smaller font, such as the small initial font as the current font size, multiply the single font width corresponding to the small initial font with the number of words in the text, and use the text width and the circumscribed box as the text width.
  • the box width if the text width is less than or equal to the width of the bounding box, determine the small initial font as the text target font size; if the text width is greater than the width of the bounding box, select a smaller font, such as the first font as the current font size, and return to the step of taking the product of the single font width corresponding to the current font size and the number of text characters as the text width and subsequent steps until the text width is less than or equal to the width of the bounding box, and determine the traversed current font as the text target font size .
  • the HSV color space expresses a color through three parameters of chroma (H), saturation (S), and brightness (V).
  • 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° ⁇ 360°. It is calculated counterclockwise from red, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: yellow is 60°, cyan is 180°, purple is 300°;
  • the saturation (S) component indicates how close the color is to the spectral colors.
  • the saturation is high, and the color is deep and vivid.
  • the white light component of the spectral color is 0, and the saturation reaches the highest. Usually the value ranges from 0% to 100%, the larger the value, the more saturated the color.
  • the lightness (V) component represents the brightness of the color.
  • the lightness value is related to the brightness of the illuminant; for the object color, this value is related to the transmittance or reflectance of the object. Usually values range from 0% (black) to 100% (white).
  • the entire image to be rendered is converted to the HSV color space, and the chromaticity values in the HSV color space are obtained.
  • the image corresponding to the text area in the image to be rendered is converted to the HSV color space, and the chromaticity value in the HSV color space is obtained.
  • the text target color is determined based on a hue component average value H_Avg, the saturation component average value S_Avg and the luma component average value 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.
  • any color in the color candidate set can be selected as the text target color; the color with the highest saturation or the highest brightness can also be selected in the color candidate set as the text target color.
  • determining the text target color based on the chromaticity values of multiple pixels includes: calculating a chromaticity average value of the chromaticity values of multiple pixel points; determining the color based on the chromaticity average value A candidate set; for at least one pixel in the image to be rendered, obtain a saturation value and a brightness value in an HSV color space; based on the saturation value and/or the brightness value of at least one or more pixels A text target color is selected from the color candidate set.
  • the chromaticity value of the HSV color space is extracted for the picture to be rendered, and the corresponding text area map chromaticity average H_Avg is calculated, and the color value with the largest difference from the chromaticity average H_Avg is found as the text color value.
  • selecting the text target color from the color candidate set based on at least one of the saturation values or the brightness values of a plurality of pixels includes: calculating an average saturation value of a plurality of pixels or At least one of the brightness average; for each color value in the color candidate set, calculate the first difference between the color value and the saturation average, and/or, calculate the color value and the A second difference between brightness average values; at least one of the color corresponding to the first difference maximum value or the color of the second difference maximum value is determined as the text target color.
  • the color corresponding to the color value is determined as the text target color. If the color value corresponding to the first difference maximum value and the color value corresponding to the second difference value maximum value are not the same color value, then select the color corresponding to the color value of the first difference value maximum value or the second difference value The color corresponding to the color value with the maximum value is used as the target text color.
  • selecting the color with the largest difference in saturation components and the largest difference in brightness average value as the target text color can make the contrast between the text color and the background color strong, which is conducive to improving the reading experience.
  • the picture rendering method provided by the embodiment of the present disclosure further includes: when the foreground area in the picture mask is smaller than a first threshold, dividing the picture to be rendered into a first area and a second area; The text area is set in the first area or the second area.
  • the first threshold is used to determine whether the foreground area in the image mask is too small. If the foreground area in the picture mask is smaller than the set first threshold, it means that the foreground area in the picture mask is too small to be suitable as a text area, and another area needs to be reselected and placed as a text area.
  • the first area and the second area can be understood as two areas with different image subjects.
  • the first area is a sky area
  • the second area is a ground area
  • the first area is a beach area
  • the second area is a picture area.
  • the image to be rendered is divided into two different areas; the text area is set in the first area or the second area.
  • the manner of dividing the image to be rendered into two regions will not be described in detail in this implementation.
  • the size of the first area and the second area is judged, and the text area is placed in the area with a larger area; if the area difference between the two areas is not large, select a text area that is relatively close to the upper edge or left side of the image to be rendered. The area where the text area is placed. This keeps the text nice and harmonious.
  • the text area is set at a preset position of the image to be rendered.
  • the second threshold is used to determine whether the first area or the second area is too small. If both the first area and the second area are smaller than the set second threshold, it means that the first area and the second area are both too small to be used as text areas, and other areas need to be reselected to be placed as text areas. At this time, you can specify to place the text area anywhere in the image to be rendered.
  • the preset position in the picture to be rendered may be the middle position of the picture to be rendered, or the picture to be rendered may be divided according to a certain ratio, and the text area may be set at the divided position.
  • the certain ratio may be forty-six ratio, thirty-seven ratio, or golden section ratio, etc. This keeps the text nice and harmonious.
  • the image to be rendered is divided into a sky area and a ground area; the text area is placed on the sky area, that is, the text "On the way to dream” is added to the sky area.
  • the text area can be divided into a main title area and a subtitle area.
  • the division of the text area may be divided into two areas on average, or may be divided according to a certain ratio.
  • the text area can be used as the main title area, and an area near the text area can be selected as the subtitle area.
  • FIG. 6 is a schematic structural diagram of a picture rendering device in an embodiment of the present disclosure. This embodiment is applicable to adding text effects to any picture.
  • the picture rendering device can be implemented by software and/or hardware.
  • the image rendering device can be configured in electronic equipment.
  • the image rendering device mainly includes a text area determination module 61 , a text type determination module 62 , a pattern type determination module 63 and a rendering module 64 .
  • the text area determination module 61 is used to process the picture to be rendered to determine the text area; the target font size determination module 62 is used to determine the text target text type based on the attribute information of the text area; the target color determination module 63 is used for Determine a text target pattern type based on the to-be-rendered picture; a rendering module 64, configured to render the to-be-rendered picture based on the text target text type and the text target pattern type.
  • An embodiment of the present disclosure provides an image rendering device, which is used to perform the following steps: process the image to be rendered to determine a text area; determine the text target text type based on the attribute information of the text area; determine the text based on the image to be rendered Target pattern type: rendering the picture to be rendered based on the text target text type and the text target pattern type.
  • the embodiment of the present disclosure determines the text type based on the obtained text area, determines the text pattern type based on the picture to be rendered, and renders the text according to the text type and text pattern type, and adds it to the text area on the picture, which is about to give
  • the text is harmoniously and beautifully placed in the picture to achieve fast rendering of the picture.
  • the text area determination module includes: an image mask determination unit, configured to input the image to be rendered into the segmentation model to obtain an image mask; a text area determination unit, configured to Membrane, to determine the text area corresponding to the image to be rendered.
  • the text area determination unit is further configured to set the text area in the area corresponding to the foreground area in the image to be rendered when the foreground area in the image mask is greater than or equal to a first threshold.
  • the text area determination module further includes: a picture segmentation unit, configured to divide the picture to be rendered into a first area and a second area when the foreground area in the image mask is smaller than a first threshold Region: a text region determining unit, further configured to use the sky region or the ground region as a text region.
  • the text area determination unit is further configured to set the text area in the image to be rendered if the first area is smaller than a second threshold, or if the second area is smaller than a second threshold specified location.
  • the text target pattern type includes: text target color; and the pattern type determination module includes: an image conversion unit, configured to convert the image to be rendered into an HSV color space; a chromaticity value acquisition unit, For at least one pixel in the image to be rendered, acquire a chroma value in the HSV color space; a target color unit, for determining the text target based on the chroma value of at least one or more pixels color.
  • the target color unit includes: a chromaticity average calculation subunit, used to calculate the chromaticity average value of the chromaticity values of one or more pixel points; a color candidate set determination subunit, used to determine based on the The chromaticity average value determines the color candidate set; the saturation value and brightness value acquisition subunit is used to obtain at least one of the saturation value or the brightness value in the HSV color space for at least one pixel point in the picture to be rendered
  • a target color determination subunit configured to select a text target color from the color candidate set based on at least one of the saturation value or the brightness value of one or more pixels.
  • the target color determination subunit is specifically configured to calculate at least one of the average saturation or average brightness of one or more pixels; for each color value in the color candidate set, calculate the color at least one of calculating a first difference between the color value and the saturation average, or calculating a second difference between the color value and the brightness average; maximizing the first difference At least one of the corresponding color or the color of the second maximum difference value is determined as the text target color.
  • the attribute information of the text area includes the width of the bounding box of the text area, and the target text type of the text includes the target font size of the text;
  • a character type determining module configured to determine the target font size of the text based on the width of the bounding box and the number of characters in the text.
  • the text type determination module is specifically configured to traverse each font size starting from the largest font size; determine the text width based on the traversed current font size and the number of text words; when the text width is less than or equal to the bounding box width , determine the traversed current font size as the text target font size.
  • the device further includes: a picture-to-be-rendered determination module, configured to select a video frame in the video to be processed as a picture to be rendered; the device also includes: a cover determination module, configured to After the text type and the text item pattern type render the picture to be rendered, the rendered picture is determined as the cover of the video to be processed.
  • a picture-to-be-rendered determination module configured to select a video frame in the video to be processed as a picture to be rendered
  • the device also includes: a cover determination module, configured to After the text type and the text item pattern type render the picture to be rendered, the rendered picture is determined as the cover of the video to be processed.
  • the device further includes: an instruction generation module, configured to generate a cover generation instruction in response to detecting that the video does not have a video cover after receiving the video uploaded by the user.
  • an instruction generation module configured to generate a cover generation instruction in response to detecting that the video does not have a video cover after receiving the video uploaded by the user.
  • the picture rendering device provided by the embodiment of the present disclosure can execute the steps performed in the picture rendering method provided by the method embodiment of the present disclosure, and has execution steps and beneficial effects, which will not be repeated here.
  • FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Referring specifically to FIG. 7 , it shows a schematic structural diagram of an electronic device 700 suitable for implementing an embodiment of the present disclosure.
  • the electronic device 700 in the embodiment of the present disclosure may include, but is not limited to, such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal ( 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. 7 is only an example, and should not limit the functions and scope of use of this embodiment of the present disclosure.
  • an electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.)
  • the program in the memory (RAM) 703 executes various appropriate actions and processes to realize the picture rendering method according to the embodiment of the present disclosure.
  • various programs and data necessary for the operation of the terminal device 700 are also stored.
  • the processing device 701, ROM 702, and RAM 703 are connected to each other through a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704 .
  • the following devices can be connected to the I/O interface 705: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 707 such as a computer; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709.
  • the communication means 709 may allow the terminal device 700 to perform wireless or wired communication with other devices to exchange data. While FIG. 7 shows a terminal device 700 having various means, it should 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 709, or from storage means 708, or from ROM 702.
  • the processing device 701 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.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • 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: processes the picture to be rendered to obtain a text area; based on the attribute information of the text area Determine the text target font size; determine the text target color based on the background color information of the image to be rendered; render the image to be rendered based on the text target font size and the text target color.
  • 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 method for rendering an image, including: processing the image to be rendered to determine a text area; determining a text target text type based on the attribute information of the text area; The picture to be rendered determines the text target pattern type; the picture to be rendered is rendered based on the text target text type and the text target pattern type.
  • the present disclosure provides an image rendering method, processing the image to be rendered to determine the text area, including: inputting the image to be rendered into a segmentation model to obtain an image mask; The image mask determines the text area corresponding to the image to be rendered.
  • the present disclosure provides a picture rendering method.
  • determining the text area corresponding to the picture to be rendered includes: the foreground area in the picture mask is larger than or When it is equal to the first threshold, the text area is set in the area corresponding to the foreground area in the image to be rendered.
  • the present disclosure provides a picture rendering method, the method further comprising: when the foreground area in the picture mask is smaller than a first threshold, segmenting the picture to be rendered are the first area and the second area; set the text area in the first area or the second area.
  • the present disclosure provides a picture rendering method, the method including: if the first area is smaller than a second threshold, or if the second area is smaller than the second threshold, then The text area is set at a preset position of the image to be rendered.
  • the present disclosure provides a picture rendering method
  • the text target pattern type includes: text target color
  • determining the text target pattern type based on the image to be rendered includes: The picture to be rendered is converted to HSV color space; for at least one pixel point in the picture to be rendered, the chromaticity value in the HSV color space is obtained; the text is determined based on the chromaticity value of one or more pixel points target color.
  • the present disclosure provides an image rendering method, determining the text target color based on the chromaticity value of one or more pixel points, including: calculating one or more pixel points The chromaticity average value of the chromaticity value; Determine the color candidate set based on the chromaticity average value; For at least one pixel point in the picture to be rendered, obtain at least one of the saturation value or the brightness value in the HSV color space One: selecting a text target color from the color candidate set based on at least one of the saturation value or the brightness value of one or more pixels.
  • the present disclosure provides an image rendering method, based on at least one of the saturation value or the brightness value of one or more pixels, from the color candidate Concentratingly select the text target color, including: calculating at least one of the average saturation or the average brightness of one or more pixels; for each color value in the color candidate set, calculating the color value and the saturation average at least one of the first difference between values, or the second difference between the color value and the brightness average value; the color corresponding to the maximum value of the first difference or the second At least one of the colors corresponding to the maximum difference value is determined as the text target color.
  • the present disclosure provides an image rendering method, the attribute information of the text region includes the width of the bounding box of the text region, and the target text type of the text includes the target font size of the text; and based on the Determining the target font size of the text based on the attribute information of the text area includes: determining the target font size of the text based on the width of the bounding box and the number of words in the text.
  • the present disclosure provides an image rendering method, which determines the text target font size based on the width of the bounding box and the number of text characters, including: traversing each font size from the largest font size; The current font size and the number of text characters determine the text width; when the text width is less than or equal to the width of the bounding box, the traversed current font size is determined as the text target font size.
  • the present disclosure provides a picture rendering method, the method further comprising: selecting a video frame in the video to be processed as the picture to be rendered; based on the target text type of the text and After the text item pattern type renders the picture to be rendered, the rendered picture is determined as the cover of the video to be processed.
  • the present disclosure provides a picture rendering method, the method further includes: after receiving the video uploaded by the user, in response to detecting that the video does not have a video cover, generating a cover Generate instructions.
  • the present disclosure provides an image rendering device, including: a text area determination module, configured to process the image to be rendered to determine the text area; a target font size determination module, configured to The attribute information of the text area determines the text target text type; the target color determination module is used to determine the text target pattern type based on the background color information of the image to be rendered; the rendering module is used to determine the text target text type based on the text target text type and the text The target pattern type renders the image to be rendered.
  • a text area determination module configured to process the image to be rendered to determine the text area
  • a target font size determination module configured to The attribute information of the text area determines the text target text type
  • the target color determination module is used to determine the text target pattern type based on the background color information of the image to be rendered
  • the rendering module is used to determine the text target text type based on the text target text type and the text
  • the target pattern type renders the image to be rendered.
  • the present disclosure provides an image rendering device, a text area determination module, including: an image mask determination unit, configured to input the image to be rendered into a segmentation model to obtain an image Mask: a text area determination unit configured to determine the text corresponding to the image to be rendered according to the image mask.
  • the present disclosure provides an image rendering device, the text area determination unit is further configured to set the text area to An area corresponding to the foreground area in the picture to be rendered.
  • the present disclosure provides an image rendering device, the text area determination module further includes: an image segmentation unit, configured to be used when the foreground area in the image mask is smaller than a first threshold The image to be rendered is divided into a first area and a second area; the text area determination unit is further configured to use the sky area or the ground area as a text area.
  • the present disclosure provides an image rendering device, the text region determination unit is further configured to if the first region is smaller than a second threshold, or if the second region is smaller than the second threshold, the text area is set at a preset position of the picture to be rendered.
  • the present disclosure provides an image rendering device, the text object pattern type includes: text object color; and the pattern type determination module includes: an image conversion unit, configured to The picture to be rendered is converted to the HSV color space; the chromaticity value acquisition unit is used to acquire the chromaticity value in the HSV color space for at least one pixel in the picture to be rendered; the target color unit is used to obtain based on at least one The chromaticity values of one or more pixel points determine the text target color.
  • the present disclosure provides an image rendering device, the target color unit includes: a chromaticity average calculation subunit, used to calculate the color of the chromaticity value of one or more pixel points A color average value; a color candidate set determination subunit, configured to determine a color candidate set based on the chroma average value; a saturation value and a brightness value acquisition subunit, used for at least one pixel in the image to be rendered, Obtaining at least one of a saturation value or a brightness value in the HSV color space; a target color determination subunit, configured to be based on at least one of the saturation value or the brightness value of one or more pixels, A text target color is selected from the color candidate set.
  • a chromaticity average calculation subunit used to calculate the color of the chromaticity value of one or more pixel points A color average value
  • a color candidate set determination subunit configured to determine a color candidate set based on the chroma average value
  • a saturation value and a brightness value acquisition subunit used for at least one
  • the present disclosure provides an image rendering device, the target color determination subunit is specifically configured to calculate at least one of the average saturation value or the average brightness value of one or more pixels kind; for each color value in the color candidate set, calculate the first difference between the color value and the saturation average, or the second difference between the color value and the brightness average at least one of: determining at least one of the color corresponding to the first maximum difference value or the color corresponding to the second maximum difference value as the text target color.
  • the present disclosure provides an image rendering device, the attribute information of the text area includes the width of the bounding box of the text area, and the target text type of the text includes the target font size of the text; the text type is determined A module configured to determine the target font size of the text based on the width of the bounding box and the word count of the text.
  • the present disclosure provides an image rendering device, a text type determination module, specifically configured to traverse each font size starting from the largest font size; determine the text width based on the traversed current font size and the number of text characters ; When the text width is less than or equal to the bounding box width, determine the traversed current font size as the text target font size.
  • the present disclosure provides an image rendering device, the device further comprising: a picture to be rendered determining module, configured to select a video frame from the video to be processed as the picture to be rendered;
  • the device also includes: a cover determination module, configured to determine the rendered picture as the cover of the video to be processed after rendering the picture to be rendered based on the text target text type and the text target pattern type .
  • the device further includes: an instruction generation module, configured to generate a cover generation instruction in response to detecting that the video does not have a video cover after receiving the video uploaded by the user.
  • an instruction generation module configured to generate a cover generation instruction in response to detecting that the video does not have a video cover after receiving the video uploaded by the user.
  • the present disclosure provides an electronic device, including:
  • processors one or more processors
  • memory for storing one or more programs
  • the one or more processors are made to implement any one of the image rendering 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 rendering as described in any one provided in the present disclosure is realized. method.
  • An embodiment of the present disclosure further 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 rendering method as described above is implemented.

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

本公开实施例公开了一种图片渲染方法、装置、设备、存储介质和程序产品,其中图片渲染方法包括:对待渲染图片进行处理以确定文本区域;基于所述文本区域的属性信息确定文本目标文字类型;基于所述待渲染图片确定文本目标图案类型;基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。

Description

图片渲染方法、装置、设备、存储介质和程序产品
相关申请的交叉引用
本申请是以CN申请号为202111308496.5,申请日为2021年11月5日的申请为基础,并主张其优先权,该CN申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及图像处理技术领域,尤其涉及一种图片渲染方法、装置、设备、存储介质和程序产品。
背景技术
随着科学技术的进步,视频技术发展日趋成熟。在常见的视频网站或应用程序中,通过向用户展示推荐图片的方式进行视频推荐。
发明内容
第一方面,本公开实施例提供一种图片渲染方法,所述方法包括:
对待渲染图片进行处理以确定文本区域;
基于所述文本区域的属性信息确定文本目标文字类型;
基于所述待渲染图片确定文本目标图案类型;
基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
第二方面,本公开实施例提供一种图片渲染装置,所述装置包括:
文本区域确定模块,用于对待渲染图片进行处理以确定文本区域;
目标字号确定模块,用于基于所述文本区域的属性信息确定文本目标文字类型;
目标颜色确定模块,用于基于所述待渲染图片确定文本目标图案类型;
渲染模块,用于基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
第三方面,本公开实施例提供一种电子设备,所述电子设备包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上述第一方面中任一项所述的图片渲染方法。
第四方面,本公开实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面中任一项所述的图片渲染方法。
第五方面,本公开实施例提供一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上述第一方面中任一项所述的图片渲染方法。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1为本公开实施例中的一种图片渲染方法的流程图;
图2为本公开实施例中的一种图片渲染方法的流程图;
图3是本公开实施例提供的待渲染图片中文本区域的示意图;
图4是本公开实施例提供的文本颜色候选集的示意图;
图5是本公开实施例提供的渲染后的图片的示意图;
图6为本公开实施例中的一种图片渲染装置的结构示意图;
图7为本公开实施例中的一种电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基 于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
在相关技术中,对于向用户展示的推荐图片都需要后期工作人员手动对推荐图片进行渲染,导致渲染速度较慢、效率较低。
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开实施例提供了一种图片渲染方法、装置、设备、存储介质和程序产品,将给定文字和谐美观的放置在图片中,实现图片的快速渲染。下面将结合附图,对本申请实施例提出的图片渲染方法进行详细介绍。
图1为本公开实施例中的一种图片渲染方法的流程图,本实施例可适用于对任意一张图片添加文字效果的情况,该方法可以由图片渲染装置执行,该图片渲染装置可以采用软件和/或硬件的方式实现,该图片渲染装置可配置于电子设备中。
例如:所述电子设备可以是移动终端、固定终端或便携式终端,例如移动手机、站点、单元、设备、多媒体计算机、多媒体平板、互联网节点、通信器、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、个人通信系统(PCS)设备、个人导航设备、个人数字助理(PDA)、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者其任意组合,包括这些设备的配件和外设或者其任意组合。
再如:所述电子设备可以是服务器,其中,所述服务器可以是实体服务器,也可以是云服务器;可以是一个服务器,或者服务器集群。
如图1所述,本公开实施例提供的图片渲染方法主要包括如下步骤。
S101、对待渲染图片进行处理以确定文本区域。
所述待渲染图片可以是给定的任意一张图片。例如:可以是一张需要添加文字的照片,也可以是视频中提取的任意一个视频帧。本实施例中,仅对待渲染图片进行说明,而非限定。
所述文本区域可以理解为待渲染图片中添加文字的一个连通区域。文本区域中可以添加文本,该文本是指与待渲染图片相关的文本信息。上述文本信息可以根据待渲染图片信息来确定,也可以是用户输入的需要添加在待渲染图片上的文本。
例如:如果待渲染图片是一个影视视频中的图片,文本信息可以该影视视频的名称。又如:上述文本信息可以是待渲染图片的主体内容,如“山峰”“大树”等。再如:上述文本信息可以是用户给定的文本信息。其中,用户给定文本信息由用户通过输入装置进行输入。
在一些实施例中,在待渲染图片中任意位置选取一个连通区域作为文本区域,例如:在待渲染图片的中间位置选取一个连通区域作为文本区域,又如:在待渲染图片的左上位置选取一个连通区域作为文本区域。进一步的,上述文本区域可选为在待渲染图片中添加文字后不会导致画面主体被遮挡的一个区域。
在一些实施例中,接收用户在待渲染图片中的选中操作,将用户在待渲染图片中选中的区域作为文本区域,例如:用户在所述待渲染图片中手动选择一个矩形连通区域,将该矩形连通区域作为文本区域。
在一些实施例中,将待渲染图片输入至预先训练的分割模型,根据所述预先训练的分割模型输出的图片掩膜,确定待渲染图片对应的文本区域。
S102、基于所述文本区域的属性信息确定文本目标文字类型。
所述文本区域的属性信息可以文本区域外接矩形框的宽度或高度中的至少一种,其中,上述宽度和高度可以用长度单位来表示,也可以用像素点来表示,本实施例中不再进行具体的限定。
文字类型可以理解为表征文字特征的信息,例如:文字字号,文字字体,文字字形、字符间隔、文字相对文本区域的位置等相关信息。文字字号是指初号、小初、一号、二号等表征一个文字大小的信息;文字字体时是指楷体、宋体、黑体等表征中文文字形状的信息,也可以是表示其他语言的文字形状的信息;文字字形是指加粗、倾斜等表征一个文字特殊效果的信息。进一步的,上述文字可以是汉字、英文、韩文、希腊字母、阿拉伯数字等任意一种现有的可书写文字,还可以是“%”、“@”、“&”等任意一种可书写的符号。
进一步的,基于所述文本区域的外接框宽度来确定文本的目标字号。即使用目标字号的文文字可以填充满整个文本区域。可选的,所述文本区域的外接框是矩形外接框,外接框的宽度可以理解为二维坐标中横坐标的长度。
在一些实施例中,目标字号计算是从最大字号依次减小,针对每一个字号,计算该字号下的文本宽度,判断该文本宽度是否小于或等于所述文本区域的外接框宽度。所述文本宽度是指在一个字号下,全部文字对应的长度。例如:小二号字体,每一个文字的宽度是6.3mm,文本字数为10,那么文本宽度为63mm。
在一些实施例中,确定每个字号下,一个文字的宽度;计算外接框与文本字数的比值,将与该比值最接近的文字的宽度对应的字号确定为目标字号。例如:一号字体,每一个文字的宽度是9.8mm,二号字体,每一个文字的宽度是7.4mm,小二号字体,每一个文字的宽度是6.3mm,三号字体,每个文字的宽度是5.6mm。如果外接框的宽度是60mm,文本字数是9个字,外接框的宽度与文本字数的比值为6.67。该比值与6.3mm最接近,选取6.3mm对应的小二号,确定为文本目标字号。
在一些实施例中,从最大字号依次减小,计算每一个字号下,该外接框宽度可容纳的文本字数,直到可容纳的文本字数大于实际文本字数,则将该可容纳文本字数对应的字号确定为文本目标字号。例如:一号字体,每一个文字的宽度是9.8mm,二号字体,每一个文字的宽度是7.4mm,小二号字体,每一个文字的宽度是6.3mm,三号字体,每个文字的宽度是5.6mm。如果外接框的宽度是70mm,实际字数是10个,一号字体可容纳7.1个字,二号字体可容纳9.4个字,小二号字体可容纳11个字,小二号字体对应的可容纳字数大于实际字数,因此将小二号确定为目标字体。
在一些实施例中,将系统默认字体作为文本目标字体,或者,可以响应用户输入的字体选择操作,确定目标字体。
在一些实施例中,将系统默认字形(例如:常规字形)作为文本目标字体,或者,可以响应用户输入的字形(加粗、倾斜)选择操作,确定目标字形。
S103、基于所述待渲染图片确定文本目标图案类型。
所述图案类型可以理解为文字填充或者边框的特殊效果。可选的,目标图案类型可以是目标颜色、目标纹理、目标效果等中的任意一种或多种。所述目标颜色可以是一个颜色值对应的颜色,也可以是多个颜色值对应的渐变颜色。目标纹理可以理解为文字填充纹理,其中,目标纹理可以是系统默认纹理,或者,可以响应用户输入的纹理选择操作,确定目标纹理。目标效果可以是添加阴影、倒影、增加文字边框、发光、 三维立体效果等等中的一种或者多种的组合。
在一些实施例中,可以根据待渲染图片的颜色信息确定文本目标颜色。上述颜色信息可以用RGB颜色系统、HSV颜色空间或HSL颜色空间中的任意一种方式来表示。
RGB颜色系统是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的。
在一些实施例中,提取待渲染图片中RGB颜色系统中三个颜色通道分别对应的数值,并将该数值直接确定为文本目标颜色。
在一些实施例中,提取文本区域对应的该区域内RGB颜色系统中三个颜色通道分别对应的数值,确定该数值对应的颜色,并将该颜色的互补色确定为文本目标颜色。例如:提取文本区域之后,RGB数值对应的颜色为红色,将红色的互补色绿色确定为文本目标颜色。
HSV颜色空间是通过色度(H),饱和度(S),亮度(V)三个参数来表示一个颜色,HSV颜色空间是RGB颜色系统的三维表示方式。
在一些实施例中,针对待渲染图片提取HSV颜色空间的色度值,并计算对应文本区域图像H值的平均值,将找到和H_Avg差异最大的颜色值作为文字颜色值。
在一些实施例中,提取待渲染图片中的任意一部分图像作为文本目标纹理。
S104、基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
在本实施例中,根据文本目标文字类型和文本目标图案类型,把文字在文本区域内按照一定的规则进行显示渲染。上述一定的规则包括:居中显示,靠左显示、靠右显示等等。具体的显示渲染方式本实施例中不再进行具体的介绍。
本公开实施例提供了一种图片渲染方法,包括:对待渲染图片进行处理确定文本区域;基于所述文本区域的属性信息确定文本目标文字类型;基于所述待渲染图片确定文本目标图案类型;基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。本公开实施例通过基于得到文本区域确定文本文字类型,基于待渲染图片确定文本图案类型,并根据文本文字类型和文本图案类型对文字进行渲染后,添加到图片上的文本区域中,即将给定文字和谐美观的放置在图片中,实现图片的快速渲染。
在上述实施例的基础上,本公开实施例对上述图片渲染方法进行了进一步的优化,图2是本公开实施例中的优化后的图片渲染方法的流程图,如图2所示,本公开实施 例提供的优化后的图片渲染方法主要包括如下步骤。
S201、在待处理视频中选取视频帧作为待渲染图片。
视频泛指由多个视频帧组成的视频,比如短视频、直播视频、影视视频等,本申请不限制视频的具体类型等。待处理视频例如为未添加封面图片的视频。
在本实施例中,可以是接收封面生成指令后执行本公开实施例提供的图片渲染方法,即步骤S201-S207。封面生成指令可以是响应用户输入的封面操作而生成并发送,也可以是接收到用户上传的视频后,检测到该视频不存在视频封面,则自动生成并发送封面生成指令。
视频封面是指用于展示视频概要的图像,视频封面可以是静态的图像,静态的视频封面又可以称为静态视频封面。视频封面也可以是动态的视频片段,动态的视频封面又可以称为动态视频封面。例如视频平台在视频列表封面展示的图像,展示的视频封面利于用户大致了解直播内容。
在一些实施例中,选取待处理视频中的任意一帧画面作为待渲染图片;或者,基于用户的选取操作,选择用户选取的视频帧作为待渲染图片。
S202、将所述待渲染图片输入至分割模型,得到图片掩膜。
在本实例中提供训练分割模型的方法,主要包括:采集数据样本,数据样本主要包括底图和图片掩膜。将采集到的数据样本输入至神经网络模型进行训练,得到分割模型。
将待渲染图片输入至分割模型后,分割模型进行处理,可以得到该图片掩膜。
图3是本公开实施例提供的待渲染图片中文本区域的示意图。如图3所示,将图3中最左侧的待渲染图片输入至分割模型,分割模型进行处理得到中间的灰度图,对所述灰度图进行二值化处理得到右侧的图片掩膜。
进一步的,二值化处理的目的是将目标与背景分类。将灰度图像进行二值化处理最常用的方法是阈值法,即,利用图像中目标与背景的差异,把图像分别设置为两个不同的级别,选取一个合适的阈值,以确定某像素是目标还是背景,从而获得二值化的图像。
在本实施例中,采用阈值法对图3中间的灰度图进行二值化处理,得到图3右侧的二值化图。
S203、在所述图片掩膜中的前景区域大于或等于第一阈值时,将文本区域设置在所述前景区域在待渲染图片中对应的区域。
所述前景区域可以理解为二值化的图片掩膜中白色像素点构成的区域,如图3中右侧图中的白色区域。所述前景区域还可以称为感兴趣区域。与前景区域相对应的是背景区域,背景区域是指二值化的图片掩膜中黑色像素点构成的区域,如图3中右侧图中的黑色区域。
所述第一阈值用于确定该图片掩膜中的前景区域尺寸是否过小的。如果图片掩膜中的前景区域尺寸是大于或等于设定的第一阈值,则表示该图片掩膜中的前景区域尺寸较大,可以设置为文本区域,如果图片掩膜中的前景区域尺寸小于设定的第一阈值,则表示该图片掩膜中的前景区域过小,设置文本区域可能会导致图片主体被文字遮挡,不适合作为文本区域,需要重新选择其他的位置作为文本区域。
S204、基于所述外接框的宽度和文本字数确定文本目标字号。
所述文本区域的属性信息包括文本区域外接框的宽度,所述文本目标文字类型包括文本目标字号。文本区域外接框可以理解为图3中右侧白色像素点的外接框。
在一些实施例中,基于所述外接框的宽度和文本字数确定文本目标字号,包括:从最大字号开始遍历每个字号;基于遍历到的当前字号和文本字数确定文本宽度;在所述文本宽度小于或等于所述外接框宽度时,将遍历到的当前字号确定为文本目标字号。
需要说明的是,可以预先设定最大字号和最小字号,最大字号一般可以是系统自带的的最大字号,例如:最大字号是初号。最小字号为系统自带最小字号,例如:中文的最小字号是八号。
在一些实施例中,最小字号可以根据待渲染图片的大小进行设定。如果待渲染图片过大,而文本字体过小,会显示不美观,不和谐,过小的字体也影响观众的查看效果,因此,将最小字号根据待渲染图片的大小来设定,这样可以避免过多次的计算字号,浪费资源和时间。
在本实施中,基于遍历到的当前字号和文本字数确定文本宽度,可以包括:将当前字号对应的单个字体宽度与文本字数的乘积作为文本宽度。
在一些实施例中,从最大字号开始遍历每个字号;将当前字号对应的单个字体宽度与文本字数的乘积作为文本宽度;在所述文本宽度小于或等于所述外接框宽度时,将遍历到的当前字号确定为文本目标字号。
例如:将最大字号,初号作为当前字号,将初号字体对应的单个字体宽度与文本字数相乘,作为文本宽度,将文本宽度与外接框宽度进行比较,如果文本宽度小于或 等于所述外接框宽度,将初号字体确定为文本目标字号。如果文本宽度大于所述外接框宽度,则选取小一号字体,如小初字体作为当前字号,将小初号字体对应的单个字体宽度与文本字数相乘,作为文本宽度,将文本宽度与外接框宽度进行比较,如果文本宽度小于或等于所述外接框宽度,将小初号字体确定为文本目标字号;如果文本宽度大于所述外接框宽度,则选取小一号字体,如一号字体作为当前字号,并返回执行将当前字号对应的单个字体宽度与文本字数的乘积作为文本宽度的步骤以及后续步骤,直到文本宽度小于或等于所述外接框宽度,将遍历到的当前字体确定为文本目标字号。
S205、将所述待渲染图片转换至HSV颜色空间。
HSV颜色空间是通过色度(H),饱和度(S),亮度(V)三个参数来表示一个颜色,HSV颜色空间是RGB颜色系统的三维表示方式。
色度(H)分量用角度度量,取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°。它们的补色是:黄色为60°,青色为180°,紫色为300°;
饱和度(S)分量表示颜色接近光谱色的程度。一种颜色,可以看成是某种光谱色与白色混合的结果。光谱色所占的比例愈大,颜色接近光谱色的程度就愈高,颜色的饱和度也就愈高。饱和度高,颜色则深而艳。光谱色的白光成分为0,饱和度达到最高。通常取值范围为0%~100%,值越大,颜色越饱和。
明度(V)分量表示颜色明亮的程度,对于光源色,明度值与发光体的光亮度有关;对于物体色,此值和物体的透射比或反射比有关。通常取值范围为0%(黑)到100%(白)。
S206、针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的色度值。
在一些实施例中,将整张待渲染图片转换至HSV颜色空间,获取HSV颜色空间中的色度值。
在另一些实施方式中,将待渲染图片中文本区域对应的图像转换至HSV颜色空间,获取HSV颜色空间中的色度值。
S207、基于至少一个或多个像素点的所述色度值确定所述文本目标颜色。
在一些实施例中,基于色度分量平均值H_Avg,所述饱和度分量平均值S_Avg和所述亮度分量平均值V_Avg确定所述文本目标颜色。
在一些实施例中,从待渲染图片中提取的色度值,或者,从待渲染图片的文本区域对应的图像中提取色度值,并计算多个像素点对应的色度平均值,得到色度平均值H_Avg。
从所有颜色集合S中找到和色度平均值H_Avg在H值纬度上差异最小的颜色值对应的所有颜色作为文字的颜色候选集O。如图4所示,根据色度平均值H_Avg确定图4中的哪一列颜色为颜色候选集O。H值差异最小保证文字颜色看着和谐美观。
进一步的,可以在颜色候选集中选择任意一个颜色作为文本目标颜色;还可以在颜色候选集中选择饱和度最高或者亮度最高的颜色作为文本目标颜色。
在一些实施例中,基于多个像素点的所述色度值确定所述文本目标颜色,包括:计算多个像素点的色度值的色度平均值;基于所述色度平均值确定颜色候选集;针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的饱和度值和亮度值;基于至少一个或多个像素点的所述饱和度值和/或所述亮度值从所述颜色候选集中选择文本目标颜色。
在一些实施例中,针对待渲染图片提取HSV颜色空间的色度值,并计算对应文本区域图色度平均值H_Avg,将找到和色度平均值H_Avg差异最大的颜色值作为文字颜色值。
在一些实施例中,基于多个像素点的所述饱和度值或所述亮度值中的至少一个从所述颜色候选集中选择文本目标颜色,包括:计算多个像素点的饱和度平均值或亮度平均值中的至少一种;针对颜色候选集中每个颜色值,计算所述颜色值与所述饱和度平均值之间的第一差值,和/或,计算所述颜色值与所述亮度平均值之间的第二差值;将所述第一差值最大值对应的颜色或所述第二差值最大值的颜色中的至少一种,确定为文本目标颜色。
在一些实施例中,如果第一差值最大值对应的颜色值与所述第二差值最大值对应的颜色值是同一个颜色值,则将该颜色值对应的颜色确定为文本目标颜色。如果第一差值最大值对应的颜色值与所述第二差值最大值对应的颜色值不是同一个颜色值,则选择第一差值最大值的颜色值对应的颜色或者所述第二差值最大值的颜色值对应的颜色作为目标文本颜色。
在一些实施例中,选择饱和度分量差异最大和亮度平均值差异最大的颜色作为目标文本颜色,可以使得文本颜色与背景颜色对比度强,有利于提高阅读体验。
S208、基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行 渲染。
S209、将渲染后的图片确定为待处理视频的封面。
在一个实施例中,本公开实施例提供的图片渲染方法还包括:在所述图片掩膜中的前景区域小于第一阈值时,将所述待渲染图片分割为第一区域和第二区域;将所述文本区域设置在所述第一区域或所述第二区域。
所述第一阈值用于确定该图片掩膜中的前景区域是否过小的。如果图片掩膜中的前景区域小于设定的第一阈值,则表示该图片掩膜中的前景区域过小,不适合作为文本区域,需要重新选择其他的区域放置为文本区域。第一区域和第二区域可以理解为图像主体不同的两个区域。可选的,第一区域是天空区域,第二区域是地面区域;可选的,第一区域的沙滩区域,第二区域是画面区域。
在一些实施例中,将所述待渲染图片分割为两个不同的区域;将所述文本区域设置在所述第一区域或所述第二区域。将待渲染图片分割为两个区域的方式中本实施中不再赘述。
在一些实施例中,判断第一区域和第二区域的大小,将文本区域放置在面积较大的区域内;如果两个区域面积差别不大,则选择相对比较靠近待渲染图片上边缘或者左边的区域放置文本区域。这样可以保证文本美观和谐。
在一些实施例中,如果所述第一区域小于第二阈值,或,所述第二区域小于第二阈值,则将所述文本区域设置在所述待渲染图片的预设位置。
所述第二阈值用于确定该第一区域或第二区域是否过小的。如果第一区域和第二区域均小于设定的第二阈值,则表示该第一区域和第二区域均过小,不适合作为文本区域,需要重新选择其他的区域放置为文本区域。这时,可以指定待渲染图片中的任意位置放置文本区域。
可选的,所述待渲染图片中的预设位置可以是待渲染图片的中间位置,还可以是将所述待渲染图片按照一定的比例进行分割,将文本区域设置在分割处。其中,一定的比例可以是四六比例、三七比例、或者黄金分割比例等。这样可以保证文本美观和谐。
如图5所示,将待渲染图片分割为天空区域和地面区域;将文本区域方式在天空区域上,即将文字“寻梦的路上”添加在了天空区域。
在一些实施例中,如果文本信息中包括主标题和副标题,则可以将文本区域进行划分,划分为主标题区域和副标题区域。文本区域的划分可以是平均划分为2个区域, 也可以是按照一定的比例进行划分。
进一步的,如果文本区域过小,无法进行区域划分时,可以将文本区域作为主标题区域,将文本区域的附近选择一块区域作为副标题区域。
图6为本公开实施例中的一种图片渲染装置的结构示意图,本实施例可适用于对任意一张图片添加文字效果的情况,该图片渲染装置可以采用软件和/或硬件的方式实现,该图片渲染装置可配置于电子设备中。
如图6所述,本公开实施例提供的图片渲染装置主要包括如下文本区域确定模块61、文字类型确定模块62、图案类型确定模块63和渲染模块64。
其中,文本区域确定模块61,用于对待渲染图片进行处理以确定文本区域;目标字号确定模块62,用于基于所述文本区域的属性信息确定文本目标文字类型;目标颜色确定模块63,用于基于所述待渲染图片确定文本目标图案类型;渲染模块64,用于基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
本公开实施例提供了一种图片渲染装置,用于执行如下步骤:对待渲染图片进行处理以确定文本区域;基于所述文本区域的属性信息确定文本目标文字类型;基于所述待渲染图片确定文本目标图案类型;基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行渲染。本公开实施例通过基于得到文本区域确定文本文字类型,基于待渲染图片确定文本图案类型,并根据文本文字类型和文本图案类型对文本进行渲染后,添加到图片上的文本区域中,即将给定文字和谐美观的放置在图片中,实现图片的快速渲染。
在一些实施例中,文本区域确定模块,包括:图片掩膜确定单元单元,用于将所述待渲染图片输入至分割模型,得到图片掩膜;文本区域确定单元,用于根据所述图片掩膜,确定待渲染图片对应的文本区域。
在一些实施例中,文本区域确定单元进一步用于在所述图片掩膜中的前景区域大于或等于第一阈值时,将文本区域设置在所述前景区域在待渲染图片中对应的区域。
在一些实施例中,文本区域确定模块,还包括:图片分割单元,用于在所述图片掩膜中的前景区域小于第一阈值时,将所述待渲染图片分割为第一区域和第二区域;文本区域确定单元,还用于将所述天空区域或所述地面区域作为文本区域。
在一些实施例中,文本区域确定单元,还用于如果所述第一区域小于第二阈值,或,所述第二区域小于第二阈值,则将所述文本区域设置在所述待渲染图片的指定位置。
在一些实施例中,所述文本目标图案类型包括:文本目标颜色;并且图案类型确定模块,包括:图片转换单元,用于将所述待渲染图片转换至HSV颜色空间;色度值获取单元,用于针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的色度值;目标颜色单元,用于基于至少一个或多个像素点的所述色度值确定所述文本目标颜色。
在一些实施例中,目标颜色单元,包括:色度平均值计算子单元,用于计算一个或多个像素点的色度值的色度平均值;颜色候选集确定子单元,用于基于所述色度平均值确定颜色候选集;饱和度值和亮度值获取子单元,用于针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的饱和度值或亮度值中的至少一种;目标颜色确定子单元,用于基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色。
在一些实施例中,目标颜色确定子单元,具体用于计算一个或多个像素点的饱和度平均值或亮度平均值中的至少一种;针对颜色候选集中每个颜色值,计算所述颜色值与所述饱和度平均值之间的第一差值,或计算所述颜色值与所述亮度平均值之间的第二差值中的至少一种;将所述第一差值最大值对应的颜色或所述第二差值最大值的颜色中的至少一种,确定为文本目标颜色。
在一些实施例中,所述文本区域的属性信息包括文本区域外接框的宽度,所述文本目标文字类型包括文本目标字号;
文字类型确定模块,用于基于所述外接框的宽度和文本字数确定文本目标字号。
在一些实施例中,文字类型确定模块,具体用于从最大字号开始遍历每个字号;基于遍历到的当前字号和文本字数确定文本宽度;在所述文本宽度小于或等于所述外接框宽度时,将遍历到的当前字号确定为文本目标字号。
在一些实施例中,所述装置还包括:待渲染图片确定模块,用于在待处理视频中选取视频帧作为待渲染图片;所述装置还包括:封面确定模块,用于基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行渲染之后,将所述渲染后的图片确定为待处理视频的封面。
在一些实施例中,所述装置还包括:指令生成模块,用于在接收到用户上传的视频后,响应于检测到所述视频不存在视频封面,生成封面生成指令。
本公开实施例提供的图片渲染装置,可执行本公开方法实施例所提供的图片渲染方法中所执行的步骤,具备执行步骤和有益效果此处不再赘述。
图7为本公开实施例中的一种电子设备的结构示意图。下面具体参考图7,其示出了适于用来实现本公开实施例中的电子设备700的结构示意图。本公开实施例中的电子设备700可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴终端设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。图7示出的终端设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储装置708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理以实现如本公开所述的实施例的图片渲染方法。在RAM 703中,还存储有终端设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许终端设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的终端设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码,从而实现如上所述的页面跳转方法。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM 702被安装。在该计算机程序被处理装置701执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多 个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该终端设备执行时,使得该终端设备:对待渲染图片进行处理,得到文本区域;基于所述文本区域的属性信息确定文本目标字号;基于所述待渲染图片的底色信息确定文本目标颜色;基于所述文本目标字号和所述文本目标颜色对所述待渲染图片进行渲染。
可选的,当上述一个或者多个程序被该终端设备执行时,该终端设备还可以执行上述实施例所述的其他步骤。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完 全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,包括:对待渲染图片进行处理以确定文本区域;基于所述文本区域的属性信息确定文本目标文字类型;基于所述待渲染图片确定文本目标图案类型;基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,对待渲染图片进行处理以确定文本区域,包括:将所述待渲染图片输入至分割模型,得到图片掩膜;根据所述图片掩膜,确定待渲染图片对应的文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,根据所述图片掩膜,确定待渲染图片对应的文本区域包括:在所述图片掩膜中的前景区域大于或等于第一阈值时,将文本区域设置在所述前景区域在待渲染图片中对应的区域。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述方法还包括:在所述图片掩膜中的前景区域小于第一阈值时,将所述待渲染图片分割为第一区域和第二区域;将所述文本区域设置在所述第一区域或所述第二区域。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述方法包括:如果所述第一区域小于第二阈值,或,所述第二区域小于第二阈值,则将所述文本区域设置在所述待渲染图片的预设位置。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述文本目标图案类型包括:文本目标颜色;并且基于所述待渲染图片确定文本目标图案类型,包括:将所述待渲染图片转换至HSV颜色空间;针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的色度值;基于一个或多个像素点的所述色度值确定所述文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,基于一个或多个像素点的所述色度值确定所述文本目标颜色,包括:计算一个或多个像素点的色度值的色度平均值;基于所述色度平均值确定颜色候选集;针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的饱和度值或亮度值中的至少一种;基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色,包括:计算一个或多个像素点的饱和度平均值或亮度平均值中的至少一种;针对颜色候选集中每个颜色值,计算所述颜色值与所述饱和度平均值之间的第一差值,或者所述颜色值与所述亮度平均值之间的第二差值中的至少一种;将所述第一差值最大值对应的颜色或所述第二差值最大值对应的颜色中的至少一种确定为文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述文本区域的属性信息包括文本区域外接框的宽度,所述文本目标文字类型包括文本目标字号;并且基于所述文本区域的属性信息确定文本目标字号,包括:基于所述外接框的宽度和文本字数确定文本目标字号。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,基于所述外接框的宽度和文本字数确定文本目标字号,包括:从最大字号开始遍历每个字号;基于遍历到的当前字号和文本字数确定文本宽度;在所述文本宽度小于或等于所述外接框宽度时,将遍历到的当前字号确定为文本目标字号。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述方法还包括:在所述待处理视频中选取视频帧作为待渲染图片;基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行渲染之后,将所述渲染后的图片确定为待处理视频的封面。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染方法,所述方法还包括:在接收到用户上传的视频后,响应于检测到所述视频不存在视频封面,生成封面生成指令。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,包括:文本区域确定模块,用于对待渲染图片进行处理以确定文本区域;目标字号确定模块,用于基于所述文本区域的属性信息确定文本目标文字类型;目标颜色确定模块,用于基于所述待渲染图片的底色信息确定文本目标图案类型;渲染模块,用于基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,文本区域确定模块,包括:图片掩膜确定单元单元,用于将所述待渲染图片输入至分割模型,得到图片掩膜;文本区域确定单元,用于根据所述图片掩膜,确定待渲染图片对应的文本。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,文本区域确定单元进一步用于在所述图片掩膜中的前景区域大于或等于第一阈值时,将文本区域设置在所述前景区域在待渲染图片中对应的区域。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,文本区域确定模块,还包括:图片分割单元,用于在所述图片掩膜中的前景区域小于第一阈值时,将所述待渲染图片分割为第一区域和第二区域;文本区域确定单元,还用于将所述天 空区域或所述地面区域作为文本区域。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,文本区域确定单元,还用于如果所述第一区域小于第二阈值,或,所述第二区域小于第二阈值,则将所述文本区域设置在所述待渲染图片的预设位置。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,所述文本目标图案类型包括:文本目标颜色;并且,图案类型确定模块,包括:图片转换单元,用于将所述待渲染图片转换至HSV颜色空间;色度值获取单元,用于针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的色度值;目标颜色单元,用于基于至少一个或多个像素点的所述色度值确定所述文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,目标颜色单元,包括:色度平均值计算子单元,用于计算一个或多个像素点的色度值的色度平均值;颜色候选集确定子单元,用于基于所述色度平均值确定颜色候选集;饱和度值和亮度值获取子单元,用于针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的饱和度值或亮度值中的至少一种;目标颜色确定子单元,用于基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,目标颜色确定子单元,具体用于计算一个或多个像素点的饱和度平均值或亮度平均值中的至少一种;针对颜色候选集中每个颜色值,计算所述颜色值与所述饱和度平均值之间的第一差值,或所述颜色值与所述亮度平均值之间的第二差值中的至少一种;将所述第一差值最大值对应的颜色或所述第二差值最大值的颜色中的至少一种,确定为文本目标颜色。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,所述文本区域的属性信息包括文本区域外接框的宽度,所述文本目标文字类型包括文本目标字号;文字类型确定模块,用于基于所述外接框的宽度和文本字数确定文本目标字号。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,文字类型确定模块,具体用于从最大字号开始遍历每个字号;基于遍历到的当前字号和文本字数确定文本宽度;在所述文本宽度小于或等于所述外接框宽度时,将遍历到的当前字号确定为文本目标字号。
根据本公开的一个或多个实施例,本公开提供了一种图片渲染装置,所述装置还 包括:待渲染图片确定模块,用于在所述待处理视频中选取视频帧作为待渲染图片;所述装置还包括:封面确定模块,用于基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行渲染之后,将所述渲染后的图片确定为待处理视频的封面。
在一些实施例中,所述装置还包括:指令生成模块,用于在接收到用户上传的视频后,响应于检测到所述视频不存在视频封面,生成封面生成指令。
根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:
一个或多个处理器;
存储器,用于存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开提供的任一所述的图片渲染方法。
根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开提供的任一所述的图片渲染方法。
本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上所述的图片渲染方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (16)

  1. 一种图片渲染方法,包括:
    对待渲染图片进行处理以确定文本区域;
    基于所述文本区域的属性信息确定文本目标文字类型;
    基于所述待渲染图片确定文本目标图案类型;
    基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
  2. 根据权利要求1所述的图片渲染方法,其中,对待渲染图片进行处理以确定文本区域,包括:
    将所述待渲染图片输入至分割模型,得到图片掩膜;
    根据所述图片掩膜,确定待渲染图片对应的文本区域。
  3. 根据权利要求2所述的图片渲染方法,其中,所述根据所述图片掩膜,确定待渲染图片对应的文本区域包括:
    在所述图片掩膜中的前景区域大于或等于第一阈值时,将文本区域设置在所述前景区域在待渲染图片中对应的区域。
  4. 根据权利要求2所述的图片渲染方法,还包括:
    在所述图片掩膜中的前景区域小于第一阈值时,将所述待渲染图片分割为第一区域和第二区域;
    将所述文本区域设置在所述第一区域或所述第二区域。
  5. 根据权利要求4所述的图片渲染方法,还包括:
    如果所述第一区域小于第二阈值,或,所述第二区域小于第二阈值,则将所述文本区域设置在所述待渲染图片的预设位置。
  6. 根据权利要求1所述的图片渲染方法,其中,所述文本目标图案类型包括:文本目标颜色;并且,基于所述待渲染图片确定文本目标图案类型,包括:
    将所述待渲染图片转换至HSV颜色空间;
    针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的色度值;
    基于一个或多个像素点的所述色度值确定所述文本目标颜色。
  7. 根据权利要求6所述的图片渲染方法,其中,基于一个或多个像素点的所述色度值确定所述文本目标颜色,包括:
    计算一个或多个像素点的色度值的色度平均值;
    基于所述色度平均值确定颜色候选集;
    针对所述待渲染图片中的至少一个像素点,获取HSV颜色空间中的饱和度值或亮度值中的至少一种;
    基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色。
  8. 根据权利要求7所述的图片渲染方法,其中,基于一个或多个像素点的所述饱和度值或所述亮度值中的至少一种,从所述颜色候选集中选择文本目标颜色,包括:
    计算一个或多个像素点的饱和度平均值或亮度平均值中的至少一种;
    针对颜色候选集中每个颜色值,计算所述颜色值与所述饱和度平均值之间的第一差值、或所述颜色值与所述亮度平均值之间的第二差值中的至少一种;
    将所述第一差值最大值对应的颜色或所述第二差值最大值对应的颜色中的至少一种,确定为文本目标颜色。
  9. 根据权利要求1所述的图片渲染方法,其中,所述文本区域的属性信息包括文本区域外接框的宽度,所述文本目标文字类型包括文本目标字号;并且,
    基于所述文本区域的属性信息确定文本目标字号,包括:
    基于所述外接框的宽度和文本字数确定文本目标字号。
  10. 根据权利要求9所述的图片渲染方法,其中,基于所述外接框的宽度和文本字数确定文本目标字号,包括:
    从最大字号开始遍历每个字号;
    基于遍历到的当前字号和文本字数确定文本宽度;
    在所述文本宽度小于或等于所述外接框的宽度时,将遍历到的当前字号确定为文本目标字号。
  11. 根据权利要求1~10中任一项所述的图片渲染方法,还包括:
    在待处理视频中选取视频帧作为待渲染图片;
    基于所述文本目标文字类型和所述文本目图案类型对所述待渲染图片进行渲染之后,将渲染后的图片确定为待处理视频的封面。
  12. 根据权利要求11所述的图片渲染方法,还包括:
    在接收到用户上传的视频后,响应于检测到所述视频不存在视频封面,生成封面生成指令。
  13. 一种图片渲染装置,包括:
    文本区域确定模块,用于对待渲染图片进行处理以确定文本区域;
    目标字号确定模块,用于基于所述文本区域的属性信息确定文本目标文字类型;
    目标颜色确定模块,用于基于所述待渲染图片的底色信息确定文本目标图案类型;
    渲染模块,用于基于所述文本目标文字类型和所述文本目标图案类型对所述待渲染图片进行渲染。
  14. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-12中任一项所述的图片渲染方法。
  15. 一种计算机可读存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1-12中任一项所述的图片渲染方法。
  16. 一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如权利要求1-12中任一项所述的图片渲染方法。
PCT/CN2022/129186 2021-11-05 2022-11-02 图片渲染方法、装置、设备、存储介质和程序产品 WO2023078284A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111308496.5 2021-11-05
CN202111308496.5A CN113989396A (zh) 2021-11-05 2021-11-05 图片渲染方法、装置、设备、存储介质和程序产品

Publications (1)

Publication Number Publication Date
WO2023078284A1 true WO2023078284A1 (zh) 2023-05-11

Family

ID=79746901

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/129186 WO2023078284A1 (zh) 2021-11-05 2022-11-02 图片渲染方法、装置、设备、存储介质和程序产品

Country Status (2)

Country Link
CN (1) CN113989396A (zh)
WO (1) WO2023078284A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117036532A (zh) * 2023-10-10 2023-11-10 杭州芯翼科技有限公司 晶圆图生成方法、装置、电子设备和存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113989396A (zh) * 2021-11-05 2022-01-28 北京字节跳动网络技术有限公司 图片渲染方法、装置、设备、存储介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104076928A (zh) * 2014-07-15 2014-10-01 深圳市金立通信设备有限公司 一种调整文字显示区域色调的方法
CN109408177A (zh) * 2018-09-29 2019-03-01 北京金山安全软件有限公司 一种配置图片中文字颜色的方法、装置及电子设备
CN111161377A (zh) * 2019-12-26 2020-05-15 北京猎豹网络科技有限公司 一种图片中添加字符的方法、装置、电子设备及存储介质
US20200410686A1 (en) * 2019-06-26 2020-12-31 Adobe Inc. Automatic sizing and placement of text within a digital image
CN113989396A (zh) * 2021-11-05 2022-01-28 北京字节跳动网络技术有限公司 图片渲染方法、装置、设备、存储介质和程序产品

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111596998A (zh) * 2020-05-13 2020-08-28 青岛海信移动通信技术股份有限公司 一种水墨屏的页面处理方法及终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104076928A (zh) * 2014-07-15 2014-10-01 深圳市金立通信设备有限公司 一种调整文字显示区域色调的方法
CN109408177A (zh) * 2018-09-29 2019-03-01 北京金山安全软件有限公司 一种配置图片中文字颜色的方法、装置及电子设备
US20200410686A1 (en) * 2019-06-26 2020-12-31 Adobe Inc. Automatic sizing and placement of text within a digital image
CN111161377A (zh) * 2019-12-26 2020-05-15 北京猎豹网络科技有限公司 一种图片中添加字符的方法、装置、电子设备及存储介质
CN113989396A (zh) * 2021-11-05 2022-01-28 北京字节跳动网络技术有限公司 图片渲染方法、装置、设备、存储介质和程序产品

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117036532A (zh) * 2023-10-10 2023-11-10 杭州芯翼科技有限公司 晶圆图生成方法、装置、电子设备和存储介质
CN117036532B (zh) * 2023-10-10 2024-01-19 杭州芯翼科技有限公司 晶圆图生成方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113989396A (zh) 2022-01-28

Similar Documents

Publication Publication Date Title
WO2023078284A1 (zh) 图片渲染方法、装置、设备、存储介质和程序产品
CN109618222B (zh) 一种拼接视频生成方法、装置、终端设备及存储介质
CN109688463B (zh) 一种剪辑视频生成方法、装置、终端设备及存储介质
CN108600781B (zh) 一种视频封面生成的方法以及服务器
US20110305386A1 (en) Color Indication Tool for Colorblindness
CN110865862B (zh) 一种页面背景设置方法、装置及电子设备
CN110070551B (zh) 视频图像的渲染方法、装置和电子设备
CN110210532B (zh) 背景色生成方法、装置及电子设备
WO2022199364A1 (zh) 图像处理方法、装置、存储介质及设备
WO2023071707A1 (zh) 视频图像处理方法、装置、电子设备及存储介质
WO2022142875A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN110070495B (zh) 图像的处理方法、装置和电子设备
WO2023109842A1 (zh) 图像展示方法、装置、电子设备及存储介质
WO2022246985A1 (zh) 一种页面显示更新方法、装置、电子设备及存储介质
CN113742025A (zh) 页面生成方法、装置、设备和存储介质
WO2023056835A1 (zh) 视频封面生成方法、装置、电子设备及可读介质
US8824778B2 (en) Systems and methods for depth map generation
CN111369431A (zh) 图像的处理方法、装置、可读介质和电子设备
CN111626922A (zh) 图片生成方法、装置、电子设备及计算机可读存储介质
WO2023083152A1 (zh) 图像分割方法、装置、设备及存储介质
CN115953597B (zh) 图像处理方法、装置、设备及介质
CN112801997B (zh) 图像增强质量评估方法、装置、电子设备及存储介质
CN114422698A (zh) 视频生成方法、装置、设备及存储介质
CN114399696A (zh) 一种目标检测方法、装置、存储介质及电子设备
WO2023078281A1 (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: 22889306

Country of ref document: EP

Kind code of ref document: A1